NetworkManager::WirelessDevice Class

class NetworkManager::WirelessDevice

A wireless network interface. More...

Header: #include <NetworkManagerQt/WirelessDevice>
CMake: find_package(KF6 REQUIRED COMPONENTS NetworkManagerQt)
target_link_libraries(mytarget PRIVATE KF6::NetworkManagerQt)
Inherits: NetworkManager::Device

Public Types

flags Capabilities
enum Capability { NoCapability, Wep40, Wep104, Tkip, Ccmp, …, IBSSRsn }
List
enum OperationMode { Unknown, Adhoc, Infra, ApMode }
Ptr

Public Functions

WirelessDevice(const QString &path, QObject *parent = nullptr)
virtual ~WirelessDevice() override
QStringList accessPoints() const
NetworkManager::AccessPoint::Ptr activeAccessPoint() const
int bitRate() const
NetworkManager::AccessPoint::Ptr findAccessPoint(const QString &uni)
NetworkManager::WirelessNetwork::Ptr findNetwork(const QString &ssid) const
QString hardwareAddress() const
(since 5.62.0) QDateTime lastRequestScan() const
(since 5.62.0) QDateTime lastScan() const
NetworkManager::WirelessDevice::OperationMode mode() const
NetworkManager::WirelessNetwork::List networks() const
QString permanentHardwareAddress() const
QDBusPendingReply<> requestScan(const QVariantMap &options = QVariantMap())
NetworkManager::WirelessDevice::Capabilities wirelessCapabilities() const

Reimplemented Public Functions

virtual NetworkManager::Device::Type type() const override

Signals

void accessPointAppeared(const QString &uni)
void accessPointDisappeared(const QString &uni)
void activeAccessPointChanged(const QString &)
void bitRateChanged(int bitrate)
void hardwareAddressChanged(const QString &)
(since 5.62.0) void lastScanChanged(const QDateTime &dateTime)
void modeChanged(NetworkManager::WirelessDevice::OperationMode)
void networkAppeared(const QString &ssid)
void networkDisappeared(const QString &ssid)
void permanentHardwareAddressChanged(const QString &)
void wirelessCapabilitiesChanged(NetworkManager::WirelessDevice::Capabilities)
void wirelessPropertiesChanged(uint)

Static Public Members

NetworkManager::WirelessDevice::Capabilities convertCapabilities(uint)
NetworkManager::WirelessDevice::OperationMode convertOperationMode(uint)

Detailed Description

Member Type Documentation

enum WirelessDevice::Capability
flags WirelessDevice::Capabilities

Capabilities (currently all encryption/authentication related) of the device

Note: FreqValid, Freq2Ghz, Freq5Ghz are available in runtime NM >= 1.0.2

The device's current operating mode

ConstantValueDescription
NetworkManager::WirelessDevice::NoCapability0x0Null capability
NetworkManager::WirelessDevice::Wep400x140 bit WEP cipher
NetworkManager::WirelessDevice::Wep1040x2104 bit WEP cipher
NetworkManager::WirelessDevice::Tkip0x4TKIP encryption cipher
NetworkManager::WirelessDevice::Ccmp0x8CCMP encryption cipher
NetworkManager::WirelessDevice::WpaWpa?WPA authentication protocol
NetworkManager::WirelessDevice::Rsn0x20RSN authethication protocol
NetworkManager::WirelessDevice::ApCap0x40The device supports Access Point mode.
NetworkManager::WirelessDevice::AdhocCap0x80The device supports Ad-Hoc mode.
NetworkManager::WirelessDevice::FreqValid0x100The device properly reports information about supported frequencies
NetworkManager::WirelessDevice::Freq2Ghz0x200The device supports 2.4Ghz frequencies
NetworkManager::WirelessDevice::Freq5Ghz0x400The device supports 5Ghz frequencies
NetworkManager::WirelessDevice::Mesh0x1000The device supports acting as a mesh point
NetworkManager::WirelessDevice::IBSSRsn0x2000device supports WPA2/RSN in an IBSS network

The Capabilities type is a typedef for QFlags<Capability>. It stores an OR combination of Capability values.

WirelessDevice::List

enum WirelessDevice::OperationMode

The device's current operating mode

ConstantValueDescription
NetworkManager::WirelessDevice::Unknown0not associated with a network
NetworkManager::WirelessDevice::Adhoc1part of an adhoc network
NetworkManager::WirelessDevice::Infra2a station in an infrastructure wireless network
NetworkManager::WirelessDevice::ApMode3access point in an infrastructure network

WirelessDevice::Ptr

Member Function Documentation

[explicit] WirelessDevice::WirelessDevice(const QString &path, QObject *parent = nullptr)

Creates a new WirelessDevice object.

path the DBus path of the devise

[override virtual noexcept] WirelessDevice::~WirelessDevice()

Destroys a WirelessDevice object.

[signal] void WirelessDevice::accessPointAppeared(const QString &uni)

A new wireless access point appeared

[signal] void WirelessDevice::accessPointDisappeared(const QString &uni)

A wireless access point disappeared

QStringList WirelessDevice::accessPoints() const

List of wireless networks currently visible to the hardware

NetworkManager::AccessPoint::Ptr WirelessDevice::activeAccessPoint() const

AccessPoint pointer this interface is currently associated with

[signal] void WirelessDevice::activeAccessPointChanged(const QString &)

The active network changed.

int WirelessDevice::bitRate() const

Retrieves the effective bit rate currently attainable by this device.

Returns the bitrate in Kbit/s

[signal] void WirelessDevice::bitRateChanged(int bitrate)

This signal is emitted when the bitrate of this network has changed.

bitrate the new bitrate value for this network

[static] NetworkManager::WirelessDevice::Capabilities WirelessDevice::convertCapabilities(uint)

Helper method to convert wire representation of capabilities to enum

[static] NetworkManager::WirelessDevice::OperationMode WirelessDevice::convertOperationMode(uint)

Helper method to convert wire representation of operation mode to enum

NetworkManager::AccessPoint::Ptr WirelessDevice::findAccessPoint(const QString &uni)

Finds access point object given its Unique Network Identifier.

uni the identifier of the AP to find from this network interface Returns a valid AccessPoint object if a network having the given UNI for this device is known to the system, 0 otherwise

NetworkManager::WirelessNetwork::Ptr WirelessDevice::findNetwork(const QString &ssid) const

Find a network with the given ssid, a Null object is returned if it can not be found

QString WirelessDevice::hardwareAddress() const

The hardware address currently used by the network interface

[signal] void WirelessDevice::hardwareAddressChanged(const QString &)

The device changed its hardware address

[since 5.62.0] QDateTime WirelessDevice::lastRequestScan() const

The time the last RequestScan function was called Returns

This function was introduced in 5.62.0.

[since 5.62.0] QDateTime WirelessDevice::lastScan() const

The LastScan property value, converted to QDateTime

Note: will always return invalid QDateTime when runtime NM < 1.12 Returns

This function was introduced in 5.62.0.

[signal, since 5.62.0] void WirelessDevice::lastScanChanged(const QDateTime &dateTime)

* The LastScan property has changed, meaning a scan has just finished * * ote will never be emitted when runtime NM < 1.12 *

This function was introduced in 5.62.0.

See also lastScanTime.

NetworkManager::WirelessDevice::OperationMode WirelessDevice::mode() const

Retrieves the operation mode of this network.

Returns the current mode

See also OperationMode.

[signal] void WirelessDevice::modeChanged(NetworkManager::WirelessDevice::OperationMode)

The device switched operating mode.

[signal] void WirelessDevice::networkAppeared(const QString &ssid)

A wireless network appeared

[signal] void WirelessDevice::networkDisappeared(const QString &ssid)

A wireless network disappeared

NetworkManager::WirelessNetwork::List WirelessDevice::networks() const

Return the current list of networks

QString WirelessDevice::permanentHardwareAddress() const

The permanent hardware address of the network interface

[signal] void WirelessDevice::permanentHardwareAddressChanged(const QString &)

The device changed its permanent hardware address

QDBusPendingReply<> WirelessDevice::requestScan(const QVariantMap &options = QVariantMap())

Asks the device for a new scan of available wireless networks

options Options of scan

No documentation for options yet, see https://projects.gnome.org/NetworkManager/developers/api/09/spec.html#org.freedesktop.NetworkManager.Device.Wireless

[override virtual] NetworkManager::Device::Type WirelessDevice::type() const

Reimplements: Device::type() const.

Return the type

NetworkManager::WirelessDevice::Capabilities WirelessDevice::wirelessCapabilities() const

Retrieves the capabilities of this wifi network.

Returns the flag set describing the capabilities

See also Capabilities.

[signal] void WirelessDevice::wirelessCapabilitiesChanged(NetworkManager::WirelessDevice::Capabilities)

The device changed its capabilities

[signal] void WirelessDevice::wirelessPropertiesChanged(uint)

The device changed its properties