NetworkManager::WirelessDevice

Search for usage in LXR

NetworkManager::WirelessDevice Class Reference

#include <wirelessdevice.h>

Inheritance diagram for NetworkManager::WirelessDevice:

Public Types

typedef QFlags< CapabilityCapabilities
 
enum  Capability {
  NoCapability = 0x0, Wep40 = 0x1, Wep104 = 0x2, Tkip = 0x4,
  Ccmp = 0x8, Wpa = 0x10, Rsn = 0x20, ApCap = 0x40,
  AdhocCap = 0x80, FreqValid = 0x100, Freq2Ghz = 0x200, Freq5Ghz = 0x400,
  Mesh = 0x1000, IBSSRsn = 0x2000
}
 
typedef QList< PtrList
 
enum  OperationMode { Unknown = 0, Adhoc, Infra, ApMode }
 
typedef QSharedPointer< WirelessDevicePtr
 
- Public Types inherited from NetworkManager::Device
typedef QFlags< CapabilityCapabilities
 
enum  Capability { IsManageable = 0x1, SupportsCarrierDetect = 0x2 }
 
enum  Interfaceflag { None = NM_DEVICE_INTERFACE_FLAG_NONE, Up = NM_DEVICE_INTERFACE_FLAG_UP, LowerUp = NM_DEVICE_INTERFACE_FLAG_LOWER_UP, Carrier = NM_DEVICE_INTERFACE_FLAG_CARRIER }
 
typedef QFlags< InterfaceflagInterfaceflags
 
typedef QList< PtrList
 
enum  MeteredStatus {
  UnknownStatus = 0, Yes = 1, No = 2, GuessYes = 3,
  GuessNo = 4
}
 
typedef QSharedPointer< DevicePtr
 
enum  State {
  UnknownState = 0, Unmanaged = 10, Unavailable = 20, Disconnected = 30,
  Preparing = 40, ConfiguringHardware = 50, NeedAuth = 60, ConfiguringIp = 70,
  CheckingIp = 80, WaitingForSecondaries = 90, Activated = 100, Deactivating = 110,
  Failed = 120
}
 
enum  StateChangeReason {
  UnknownReason = 0, NoReason = 1, NowManagedReason = 2, NowUnmanagedReason = 3,
  ConfigFailedReason = 4, ConfigUnavailableReason = 5, ConfigExpiredReason = 6, NoSecretsReason = 7,
  AuthSupplicantDisconnectReason = 8, AuthSupplicantConfigFailedReason = 9, AuthSupplicantFailedReason = 10, AuthSupplicantTimeoutReason = 11,
  PppStartFailedReason = 12, PppDisconnectReason = 13, PppFailedReason = 14, DhcpStartFailedReason = 15,
  DhcpErrorReason = 16, DhcpFailedReason = 17, SharedStartFailedReason = 18, SharedFailedReason = 19,
  AutoIpStartFailedReason = 20, AutoIpErrorReason = 21, AutoIpFailedReason = 22, ModemBusyReason = 23,
  ModemNoDialToneReason = 24, ModemNoCarrierReason = 25, ModemDialTimeoutReason = 26, ModemDialFailedReason = 27,
  ModemInitFailedReason = 28, GsmApnSelectFailedReason = 29, GsmNotSearchingReason = 30, GsmRegistrationDeniedReason = 31,
  GsmRegistrationTimeoutReason = 32, GsmRegistrationFailedReason = 33, GsmPinCheckFailedReason = 34, FirmwareMissingReason = 35,
  DeviceRemovedReason = 36, SleepingReason = 37, ConnectionRemovedReason = 38, UserRequestedReason = 39,
  CarrierReason = 40, ConnectionAssumedReason = 41, SupplicantAvailableReason = 42, ModemNotFoundReason = 43,
  BluetoothFailedReason = 44, GsmSimNotInserted = 45, GsmSimPinRequired = 46, GsmSimPukRequired = 47,
  GsmSimWrong = 48, InfiniBandMode = 49, DependencyFailed = 50, Br2684Failed = 51,
  ModemManagerUnavailable = 52, SsidNotFound = 53, SecondaryConnectionFailed = 54, DcbFcoeFailed = 55,
  TeamdControlFailed = 56, ModemFailed = 57, ModemAvailable = 58, SimPinIncorrect = 59,
  NewActivation = 60, ParentChanged = 61, ParentManagedChanged = 62, Reserved = 65536
}
 
enum  Type {
  UnknownType = NM_DEVICE_TYPE_UNKNOWN, Ethernet = NM_DEVICE_TYPE_ETHERNET, Wifi = NM_DEVICE_TYPE_WIFI, Unused1 = NM_DEVICE_TYPE_UNUSED1,
  Unused2 = NM_DEVICE_TYPE_UNUSED2, Bluetooth = NM_DEVICE_TYPE_BT, OlpcMesh = NM_DEVICE_TYPE_OLPC_MESH, Wimax = NM_DEVICE_TYPE_WIMAX,
  Modem = NM_DEVICE_TYPE_MODEM, InfiniBand = NM_DEVICE_TYPE_INFINIBAND, Bond = NM_DEVICE_TYPE_BOND, Vlan = NM_DEVICE_TYPE_VLAN,
  Adsl = NM_DEVICE_TYPE_ADSL, Bridge = NM_DEVICE_TYPE_BRIDGE, Generic = NM_DEVICE_TYPE_GENERIC, Team = NM_DEVICE_TYPE_TEAM,
  Gre, MacVlan, Tun, Veth,
  IpTunnel, VxLan, MacSec, Dummy,
  Ppp, OvsInterface, OvsPort, OvsBridge,
  Wpan, Lowpan, WireGuard, WifiP2P
}
 
typedef QFlags< TypeTypes
 

Signals

void accessPointAppeared (const QString &uni)
 
void accessPointDisappeared (const QString &uni)
 
void activeAccessPointChanged (const QString &)
 
void bitRateChanged (int bitrate)
 
void hardwareAddressChanged (const QString &)
 
void lastScanChanged (const QDateTime &dateTime)
 
void modeChanged (WirelessDevice::OperationMode)
 
void networkAppeared (const QString &ssid)
 
void networkDisappeared (const QString &ssid)
 
void permanentHardwareAddressChanged (const QString &)
 
void wirelessCapabilitiesChanged (Capabilities)
 
void wirelessPropertiesChanged (uint)
 
- Signals inherited from NetworkManager::Device
void activeConnectionChanged ()
 
void autoconnectChanged ()
 
void availableConnectionAppeared (const QString &connection)
 
void availableConnectionChanged ()
 
void availableConnectionDisappeared (const QString &connection)
 
void capabilitiesChanged ()
 
void connectionStateChanged ()
 
void dhcp4ConfigChanged ()
 
void dhcp6ConfigChanged ()
 
void driverChanged ()
 
void driverVersionChanged ()
 
void firmwareMissingChanged ()
 
void firmwareVersionChanged ()
 
void interfaceFlagsChanged ()
 
void interfaceNameChanged ()
 
void ipInterfaceChanged ()
 
void ipV4AddressChanged ()
 
void ipV4ConfigChanged ()
 
void ipV6ConfigChanged ()
 
void managedChanged ()
 
void meteredChanged (MeteredStatus metered)
 
void mtuChanged ()
 
void nmPluginMissingChanged (bool nmPluginMissing)
 
void physicalPortIdChanged ()
 
void stateChanged (NetworkManager::Device::State newstate, NetworkManager::Device::State oldstate, NetworkManager::Device::StateChangeReason reason)
 
void stateReasonChanged ()
 
void udiChanged ()
 

Public Member Functions

 WirelessDevice (const QString &path, QObject *parent=nullptr)
 
 ~WirelessDevice () override
 
QStringList accessPoints () const
 
AccessPoint::Ptr activeAccessPoint () const
 
int bitRate () const
 
AccessPoint::Ptr findAccessPoint (const QString &uni)
 
WirelessNetwork::Ptr findNetwork (const QString &ssid) const
 
QString hardwareAddress () const
 
QDateTime lastRequestScan () const
 
QDateTime lastScan () const
 
WirelessDevice::OperationMode mode () const
 
WirelessNetwork::List networks () const
 
QString permanentHardwareAddress () const
 
QDBusPendingReply requestScan (const QVariantMap &options=QVariantMap())
 
Type type () const override
 
WirelessDevice::Capabilities wirelessCapabilities () const
 
- Public Member Functions inherited from NetworkManager::Device
 Device (const QString &path, QObject *parent=nullptr)
 
 ~Device () override
 
NetworkManager::ActiveConnection::Ptr activeConnection () const
 
template<class DevIface >
DevIface * as ()
 
template<class DevIface >
const DevIface * as () const
 
bool autoconnect () const
 
Connection::List availableConnections ()
 
Capabilities capabilities () const
 
QVariant capabilitiesV () const
 
QDBusPendingReply deleteInterface ()
 
int designSpeed () const
 
DeviceStatistics::Ptr deviceStatistics () const
 
Dhcp4Config::Ptr dhcp4Config () const
 
Dhcp6Config::Ptr dhcp6Config () const
 
QDBusPendingReply disconnectInterface ()
 
QString driver () const
 
QString driverVersion () const
 
bool firmwareMissing () const
 
QString firmwareVersion () const
 
Interfaceflags interfaceFlags () const
 
QString interfaceName () const
 
QString ipInterfaceName () const
 
QHostAddress ipV4Address () const
 
IpConfig ipV4Config () const
 
IpConfig ipV6Config () const
 
bool isActive () const
 
bool isValid () const
 
bool managed () const
 
MeteredStatus metered () const
 
uint mtu () const
 
bool nmPluginMissing () const
 
QString physicalPortId () const
 
QDBusPendingReply reapplyConnection (const NMVariantMapMap &connection, qulonglong version_id, uint flags)
 
void setAutoconnect (bool autoconnect)
 
State state () const
 
DeviceStateReason stateReason () const
 
QString udi () const
 
QString uni () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static WirelessDevice::Capabilities convertCapabilities (uint)
 
static WirelessDevice::OperationMode convertOperationMode (uint)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Additional Inherited Members

- Properties inherited from NetworkManager::Device
bool autoconnect
 
NetworkManager::DeviceStatistics::Ptr deviceStatistics
 
QString driver
 
QString driverVersion
 
bool firmwareMissing
 
QString firmwareVersion
 
QVariant genericCapabilities
 
Interfaceflags InterfaceFlags
 
QString interfaceName
 
QString ipInterfaceName
 
QHostAddress ipV4Address
 
bool managed
 
MeteredStatus metered
 
uint mtu
 
bool nmPluginMissing
 
State state
 
DeviceStateReason stateReason
 
QString udi
 
QString uni
 
- Properties inherited from QObject
 objectName
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from NetworkManager::Device
NETWORKMANAGERQT_NO_EXPORT Device (DevicePrivate &dd, QObject *parent)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Attributes inherited from NetworkManager::Device
DevicePrivate *const d_ptr
 

Detailed Description

A wireless network interface.

Definition at line 27 of file wirelessdevice.h.

Member Enumeration Documentation

◆ Capability

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

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

Null capability.

Wep40 

40 bit WEP cipher

Wep104 

104 bit WEP cipher

Tkip 

TKIP encryption cipher.

Ccmp 

CCMP encryption cipher.

Wpa 

WPA authentication protocol.

Rsn 

RSN authethication protocol.

ApCap 

The device supports Access Point mode.

AdhocCap 

The device supports Ad-Hoc mode.

FreqValid 

The device properly reports information about supported frequencies.

Freq2Ghz 

The device supports 2.4Ghz frequencies.

Freq5Ghz 

The device supports 5Ghz frequencies.

Mesh 

The device supports acting as a mesh point.

IBSSRsn 

device supports WPA2/RSN in an IBSS network

Definition at line 49 of file wirelessdevice.h.

◆ OperationMode

The device's current operating mode.

Enumerator
Unknown 

not associated with a network

Adhoc 

part of an adhoc network

Infra 

a station in an infrastructure wireless network

ApMode 

access point in an infrastructure network

Definition at line 38 of file wirelessdevice.h.

Constructor & Destructor Documentation

◆ WirelessDevice()

WirelessDevice::WirelessDevice ( const QString path,
QObject parent = nullptr 
)
explicit

Creates a new WirelessDevice object.

Parameters
paththe DBus path of the devise

Definition at line 34 of file wirelessdevice.cpp.

◆ ~WirelessDevice()

WirelessDevice::~WirelessDevice ( )
override

Destroys a WirelessDevice object.

Definition at line 63 of file wirelessdevice.cpp.

Member Function Documentation

◆ accessPointAppeared

void NetworkManager::WirelessDevice::accessPointAppeared ( const QString uni)
signal

A new wireless access point appeared.

◆ accessPointDisappeared

void NetworkManager::WirelessDevice::accessPointDisappeared ( const QString uni)
signal

A wireless access point disappeared.

◆ accessPoints()

QStringList WirelessDevice::accessPoints ( ) const

List of wireless networks currently visible to the hardware.

Definition at line 72 of file wirelessdevice.cpp.

◆ activeAccessPoint()

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

AccessPoint pointer this interface is currently associated with.

Definition at line 85 of file wirelessdevice.cpp.

◆ activeAccessPointChanged

void NetworkManager::WirelessDevice::activeAccessPointChanged ( const QString )
signal

The active network changed.

◆ bitRate()

int WirelessDevice::bitRate ( ) const

Retrieves the effective bit rate currently attainable by this device.

Returns
the bitrate in Kbit/s

Definition at line 109 of file wirelessdevice.cpp.

◆ bitRateChanged

void NetworkManager::WirelessDevice::bitRateChanged ( int  bitrate)
signal

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

Parameters
bitratethe new bitrate value for this network

◆ convertCapabilities()

NetworkManager::WirelessDevice::Capabilities WirelessDevice::convertCapabilities ( uint  caps)
static

Helper method to convert wire representation of capabilities to enum.

Definition at line 264 of file wirelessdevice.cpp.

◆ convertOperationMode()

NetworkManager::WirelessDevice::OperationMode WirelessDevice::convertOperationMode ( uint  theirMode)
static

Helper method to convert wire representation of operation mode to enum.

Definition at line 242 of file wirelessdevice.cpp.

◆ findAccessPoint()

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

Finds access point object given its Unique Network Identifier.

Parameters
unithe 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

Definition at line 133 of file wirelessdevice.cpp.

◆ findNetwork()

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.

Definition at line 158 of file wirelessdevice.cpp.

◆ hardwareAddress()

QString WirelessDevice::hardwareAddress ( ) const

The hardware address currently used by the network interface.

Definition at line 91 of file wirelessdevice.cpp.

◆ hardwareAddressChanged

void NetworkManager::WirelessDevice::hardwareAddressChanged ( const QString )
signal

The device changed its hardware address.

◆ lastRequestScan()

QDateTime WirelessDevice::lastRequestScan ( ) const

The time the last RequestScan function was called.

Since
5.62.0
Returns

Definition at line 121 of file wirelessdevice.cpp.

◆ lastScan()

QDateTime WirelessDevice::lastScan ( ) const

The LastScan property value, converted to QDateTime.

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

Definition at line 115 of file wirelessdevice.cpp.

◆ lastScanChanged

void NetworkManager::WirelessDevice::lastScanChanged ( const QDateTime dateTime)
signal

The LastScan property has changed, meaning a scan has just finished.

Since
5.62.0
Note
will never be emitted when runtime NM < 1.12
See also
lastScanTime

◆ mode()

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

Retrieves the operation mode of this network.

Returns
the current mode
See also
OperationMode

Definition at line 103 of file wirelessdevice.cpp.

◆ modeChanged

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

The device switched operating mode.

◆ networkAppeared

void NetworkManager::WirelessDevice::networkAppeared ( const QString ssid)
signal

A wireless network appeared.

◆ networkDisappeared

void NetworkManager::WirelessDevice::networkDisappeared ( const QString ssid)
signal

A wireless network disappeared.

◆ networks()

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

Return the current list of networks.

Definition at line 152 of file wirelessdevice.cpp.

◆ permanentHardwareAddress()

QString WirelessDevice::permanentHardwareAddress ( ) const

The permanent hardware address of the network interface.

Definition at line 97 of file wirelessdevice.cpp.

◆ permanentHardwareAddressChanged

void NetworkManager::WirelessDevice::permanentHardwareAddressChanged ( const QString )
signal

The device changed its permanent hardware address.

◆ requestScan()

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

Asks the device for a new scan of available wireless networks.

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

Definition at line 78 of file wirelessdevice.cpp.

◆ type()

NetworkManager::Device::Type WirelessDevice::type ( ) const
overridevirtual

Return the type.

Reimplemented from NetworkManager::Device.

Definition at line 67 of file wirelessdevice.cpp.

◆ wirelessCapabilities()

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

Retrieves the capabilities of this wifi network.

Returns
the flag set describing the capabilities
See also
Capabilities

Definition at line 127 of file wirelessdevice.cpp.

◆ wirelessCapabilitiesChanged

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

The device changed its capabilities.

◆ wirelessPropertiesChanged

void NetworkManager::WirelessDevice::wirelessPropertiesChanged ( uint  )
signal

The device changed its properties.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 03:57:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.