9#include "accesspoint_p.h"
11#include "wirelessdevice.h"
15NetworkManager::AccessPointPrivate::AccessPointPrivate(
const QString &path, AccessPoint *q)
26 , mode(AccessPoint::Unknown)
37 if (caps & NM_802_11_AP_FLAGS_PRIVACY) {
38 capFlags |= AccessPoint::Privacy;
46 return (AccessPoint::WpaFlags)theirFlags;
49NetworkManager::AccessPoint::AccessPoint(
const QString &path,
QObject *parent)
51 , d_ptr(new AccessPointPrivate(
path, this))
57 NetworkManagerPrivate::FDO_DBUS_PROPERTIES,
63 QVariantMap initialProperties = NetworkManagerPrivate::retrieveInitialProperties(d->iface.staticInterfaceName(), path);
64 if (!initialProperties.isEmpty()) {
65 d->propertiesChanged(initialProperties);
69NetworkManager::AccessPoint::~AccessPoint()
84 return d->hardwareAddress;
90 return d->capabilities;
126 return d->maxBitRate;
138 return d->signalStrength;
151 case NM_802_11_MODE_UNKNOWN:
154 case NM_802_11_MODE_ADHOC:
157 case NM_802_11_MODE_INFRA:
160 case NM_802_11_MODE_AP:
164 qCDebug(NMQT) << Q_FUNC_INFO <<
"Unhandled mode" << mode;
169void NetworkManager::AccessPointPrivate::dbusPropertiesChanged(
const QString &interfaceName,
170 const QVariantMap &properties,
173 Q_UNUSED(invalidatedProperties);
174 if (interfaceName ==
QLatin1String(
"org.freedesktop.NetworkManager.AccessPoint")) {
175 propertiesChanged(properties);
179void NetworkManager::AccessPointPrivate::propertiesChanged(
const QVariantMap &properties)
185 QVariantMap::const_iterator it =
properties.constBegin();
187 const QString property = it.key();
190 Q_EMIT q->capabilitiesChanged(capabilities);
192 wpaFlags = convertWpaFlags(it->toUInt());
193 Q_EMIT q->wpaFlagsChanged(wpaFlags);
195 rsnFlags = convertWpaFlags(it->toUInt());
196 Q_EMIT q->rsnFlagsChanged(rsnFlags);
198 rawSsid = it->toByteArray();
200 Q_EMIT q->ssidChanged(ssid);
202 frequency = it->toUInt();
203 Q_EMIT q->frequencyChanged(frequency);
205 hardwareAddress = it->toString();
207 mode = q->convertOperationMode(it->toUInt());
209 maxBitRate = it->toUInt();
210 Q_EMIT q->bitRateChanged(maxBitRate);
212 signalStrength = it->toInt();
213 Q_EMIT q->signalStrengthChanged(signalStrength);
215 lastSeen = it->toInt();
216 Q_EMIT q->lastSeenChanged(lastSeen);
218 qCDebug(NMQT) << Q_FUNC_INFO <<
"Unhandled property" << property;
224#include "moc_accesspoint.cpp"
225#include "moc_accesspoint_p.cpp"
Represents an access point.
QString hardwareAddress() const
AccessPoint::WpaFlags wpaFlags() const
static OperationMode convertOperationMode(uint mode)
Helper method to convert wire representation of operation mode to enum.
OperationMode mode() const
int signalStrength() const
OperationMode
The access point's current operating mode.
@ Unknown
not associated with a network
@ ApMode
access point in an infrastructure network
@ Infra
a station in an infrastructure wireless network
@ Adhoc
part of an adhoc network
AccessPoint::WpaFlags rsnFlags() const
Capabilities capabilities() const
QByteArray rawSsid() const
Capabilities capabilities()
QString path(const QString &relativePath)
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
QDBusConnection sessionBus()
QDBusConnection systemBus()
QString fromUtf8(QByteArrayView str)