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{
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 * The bandwidth announced by the access point in MHz.
129 * @since 6.12.0.
130 */
131 uint bandwidth() const;
132 /**
133 * Helper method to convert wire representation of operation @p mode to enum
134 */
135 static OperationMode convertOperationMode(uint mode);
136
137Q_SIGNALS:
138 /**
139 * This signal is emitted when the signal strength of this network has changed.
140 *
141 * @param strength the new signal strength value for this network
142 */
143 void signalStrengthChanged(int strength);
144
145 /**
146 * This signal is emitted when the bitrate of this network has changed.
147 *
148 * @param bitrate the new bitrate value for this network
149 */
150 void bitRateChanged(int bitrate);
151
152 /**
153 * This signal is emitted when the capabilities of this network have changed.
154 *
155 * @param caps the new capabilities
156 */
157 void capabilitiesChanged(AccessPoint::Capabilities caps);
158
159 /**
160 * This signal is emitted when the WPA flags in use by this access point change
161 *
162 * @param flags the new flags
163 */
164 void wpaFlagsChanged(AccessPoint::WpaFlags flags);
165
166 /**
167 * This signal is emitted when the RSN(WPA2) flags in use by this access point change
168 *
169 * @param flags the new flags
170 */
171 void rsnFlagsChanged(AccessPoint::WpaFlags flags);
172 /**
173 * This signal is emitted when the ssid of this Access Point changes
174 *
175 * @param ssid the new SSID
176 */
178
179 /**
180 * This signal is emitted when the frequency used by this Access Point changes
181 *
182 * @param frequency the new frequency
183 */
185
186 /**
187 * This signal is emitted when the timestamp for the last time the access point was found
188 * in scan results changes
189 *
190 * @param lastSeen the timestamp for the last time the access point was found in scan results.
191 * @since 5.14.0
192 * @see lastSeen
193 */
195
196 /**
197 * This signal is emitted when bandwidth announced by the access point changes.
198 *
199 * @param lastSeen the bandwidth announced by the access point in MHz.
200 * @since 6.12.0
201 * @see bandwidth
202 */
204
205private:
206 Q_DECLARE_PRIVATE(AccessPoint)
207
208 AccessPointPrivate *const d_ptr;
209};
210
211Q_DECLARE_OPERATORS_FOR_FLAGS(AccessPoint::WpaFlags)
212
213}
214#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
@ None
Null capability - says nothing about the access point.
Definition accesspoint.h:46
@ Privacy
Access point supports privacy measures.
Definition accesspoint.h:47
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.
uint bandwidth() const
The bandwidth announced by the access point in MHz.
OperationMode
The access point's current operating mode.
Definition accesspoint.h:36
@ Unknown
not associated with a network
Definition accesspoint.h:37
@ 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 bandwidthChanged(uint bandwidth)
This signal is emitted when bandwidth announced by the access point changes.
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
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 11 2025 11:57:51 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.