NetworkManagerQt

accesspoint.h
1/*
2 SPDX-FileCopyrightText: 2008 Will Stephenson <wstephenson@kde.org>
3 SPDX-FileCopyrightText: 2011-2013 Lamarque V. Souza <lamarque@kde.org>
4 SPDX-FileCopyrightText: 2013 Jan Grulich <jgrulich@redhat.com>
5
6 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7*/
8
9#ifndef NETWORKMANAGERQT_ACCESSPOINT_H
10#define NETWORKMANAGERQT_ACCESSPOINT_H
11
12#include <networkmanagerqt/networkmanagerqt_export.h>
13
14#include <nm-version.h>
15
16#include <QObject>
17#include <QSharedPointer>
18#include <QVariantMap>
19
21{
22class AccessPointPrivate;
23
24/**
25 * Represents an access point
26 */
27class NETWORKMANAGERQT_EXPORT AccessPoint : public QObject
28{
29 Q_OBJECT
30public:
32 typedef QList<Ptr> List;
33 /**
34 * The access point's current operating mode
35 */
37 Unknown = 0, /**< not associated with a network */
38 Adhoc, /**< part of an adhoc network */
39 Infra, /**< a station in an infrastructure wireless network */
40 ApMode, /**< access point in an infrastructure network */
41 };
42 /**
43 * General capabilities of an access point
44 */
46 None = 0x0, /**< Null capability - says nothing about the access point */
47 Privacy = 0x1, /**< Access point supports privacy measures */
48 };
49 /**
50 * Flags describing the access point's capabilities according to WPA (Wifi Protected Access)
51 */
52 enum WpaFlag {
53 PairWep40 = 0x1,
54 PairWep104 = 0x2,
55 PairTkip = 0x4,
56 PairCcmp = 0x8,
57 GroupWep40 = 0x10,
58 GroupWep104 = 0x20,
59 GroupTkip = 0x40,
60 GroupCcmp = 0x80,
61 KeyMgmtPsk = 0x100,
62 KeyMgmt8021x = 0x200,
63 KeyMgmtSAE = 0x400,
64 KeyMgmtOWE = 0x800,
65 KeyMgmtOWETM = 0x1000,
66 KeyMgmtEapSuiteB192 = 0x2000,
67 };
68 Q_DECLARE_FLAGS(Capabilities, Capability)
69 Q_FLAG(Capabilities)
70 Q_DECLARE_FLAGS(WpaFlags, WpaFlag)
71 Q_FLAG(WpaFlags)
72 explicit AccessPoint(const QString &path, QObject *parent = nullptr);
73 ~AccessPoint() override;
74
75 /**
76 * @return path of the access point
77 */
78 QString uni() const;
79 /**
80 * @return capabilities of an access point
81 */
82 Capabilities capabilities() const;
83 /**
84 * @return flags describing the access point's capabilities according to WPA (Wifi Protected Access).
85 * @see WpaFlag
86 */
87 AccessPoint::WpaFlags wpaFlags() const;
88 /**
89 * @return Flags describing the access point's capabilities according to the RSN (Robust Secure Network) protocol.
90 * @see WpaFlag
91 */
92 AccessPoint::WpaFlags rsnFlags() const;
93 /**
94 * @return The Service Set Identifier identifying the access point.
95 */
96 QString ssid() const;
97 /**
98 * @return raw SSID, encoded as a byte array
99 */
100 QByteArray rawSsid() const;
101 /**
102 * @return The radio channel frequency in use by the access point, in MHz.
103 */
104 uint frequency() const;
105 /**
106 * @return The hardware address (BSSID) of the access point.
107 */
108 QString hardwareAddress() const;
109 /**
110 * @return The maximum bitrate this access point is capable of, in kilobits/second (Kb/s).
111 */
112 uint maxBitRate() const;
113 /**
114 * @return Describes the operating mode of the access point.
115 */
116 OperationMode mode() const;
117 /**
118 * @return The current signal quality of the access point, in percent.
119 */
120 int signalStrength() const;
121 /**
122 * @return The timestamp (in CLOCK_BOOTTIME seconds) for the last time the access point
123 * was found in scan results. A value of -1 means the access point has never been found in scan results.
124 * @since 5.14.0
125 */
126 int lastSeen() const;
127
128 /**
129 * Helper method to convert wire representation of operation @p mode to enum
130 */
131 static OperationMode convertOperationMode(uint mode);
132
133Q_SIGNALS:
134 /**
135 * This signal is emitted when the signal strength of this network has changed.
136 *
137 * @param strength the new signal strength value for this network
138 */
139 void signalStrengthChanged(int strength);
140
141 /**
142 * This signal is emitted when the bitrate of this network has changed.
143 *
144 * @param bitrate the new bitrate value for this network
145 */
146 void bitRateChanged(int bitrate);
147
148 /**
149 * This signal is emitted when the capabilities of this network have changed.
150 *
151 * @param caps the new capabilities
152 */
154
155 /**
156 * This signal is emitted when the WPA flags in use by this access point change
157 *
158 * @param flags the new flags
159 */
161
162 /**
163 * This signal is emitted when the RSN(WPA2) flags in use by this access point change
164 *
165 * @param flags the new flags
166 */
168 /**
169 * This signal is emitted when the ssid of this Access Point changes
170 *
171 * @param ssid the new SSID
172 */
173 void ssidChanged(const QString &ssid);
174
175 /**
176 * This signal is emitted when the frequency used by this Access Point changes
177 *
178 * @param frequency the new frequency
179 */
180 void frequencyChanged(uint frequency);
181
182 /**
183 * This signal is emitted when the timestamp for the last time the access point was found
184 * in scan results changes
185 *
186 * @param lastSeen the timestamp for the last time the access point was found in scan results.
187 * @since 5.14.0
188 * @see lastSeen
189 */
190 void lastSeenChanged(int lastSeen);
191
192private:
193 Q_DECLARE_PRIVATE(AccessPoint)
194
195 AccessPointPrivate *const d_ptr;
196};
197
198Q_DECLARE_OPERATORS_FOR_FLAGS(AccessPoint::WpaFlags)
199
200}
201#endif
Represents an access point.
Definition accesspoint.h:28
void lastSeenChanged(int lastSeen)
This signal is emitted when the timestamp for the last time the access point was found in scan result...
void capabilitiesChanged(AccessPoint::Capabilities caps)
This signal is emitted when the capabilities of this network have changed.
Capability
General capabilities of an access point.
Definition accesspoint.h:45
void ssidChanged(const QString &ssid)
This signal is emitted when the ssid of this Access Point changes.
void signalStrengthChanged(int strength)
This signal is emitted when the signal strength of this network has changed.
void frequencyChanged(uint frequency)
This signal is emitted when the frequency used by this Access Point changes.
void rsnFlagsChanged(AccessPoint::WpaFlags flags)
This signal is emitted when the RSN(WPA2) flags in use by this access point change.
OperationMode
The access point's current operating mode.
Definition accesspoint.h:36
@ ApMode
access point in an infrastructure network
Definition accesspoint.h:40
@ Infra
a station in an infrastructure wireless network
Definition accesspoint.h:39
@ Adhoc
part of an adhoc network
Definition accesspoint.h:38
void bitRateChanged(int bitrate)
This signal is emitted when the bitrate of this network has changed.
WpaFlag
Flags describing the access point's capabilities according to WPA (Wifi Protected Access)
Definition accesspoint.h:52
void wpaFlagsChanged(AccessPoint::WpaFlags flags)
This signal is emitted when the WPA flags in use by this access point change.
This class allows querying the underlying system to discover the available network interfaces and rea...
Definition accesspoint.h:21
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:55:20 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.