Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorServiceNetwork::NetworkDevice Class Reference

One org.freedesktop.NetworkManager.Device object. More...

#include <PhosphorServiceNetwork/NetworkDevice.h>

Inheritance diagram for PhosphorServiceNetwork::NetworkDevice:
[legend]

Public Types

enum  DeviceType {
  Unknown = 0 , Ethernet = 1 , Wifi = 2 , Bluetooth = 5 ,
  OlpcMesh = 6 , Wimax = 7 , Modem = 8 , Infiniband = 9 ,
  Bond = 10 , Vlan = 11 , Adsl = 12 , Bridge = 13 ,
  Generic = 14 , Team = 15 , Tun = 16 , IpTunnel = 17 ,
  Macvlan = 18 , Vxlan = 19 , Veth = 20 , Macsec = 21 ,
  Dummy = 22 , Ppp = 23 , Wireguard = 29
}
 D-Bus path of the access point this device is currently associated with, or empty when it is associated with none — which is also what a non-Wi-Fi device always reports, since only org.freedesktop.NetworkManager.Device.Wireless carries the property. More...
enum  DeviceState {
  UnknownState = 0 , Unmanaged = 10 , Unavailable = 20 , Disconnected = 30 ,
  Prepare = 40 , Config = 50 , NeedAuth = 60 , IpConfig = 70 ,
  IpCheck = 80 , Secondaries = 90 , Activated = 100 , Deactivating = 110 ,
  Failed = 120
}

Signals

void interfaceNameChanged ()
void deviceTypeChanged ()
void stateChanged ()
void managedChanged ()
void activeAccessPointPathChanged ()
void detailsChanged ()

Public Member Functions

 NetworkDevice (const QString &dbusPath, QObject *parent=nullptr)
 NetworkDevice (QDBusConnection connection, const QString &dbusPath, QObject *parent=nullptr)
 ~NetworkDevice () override
QString dbusPath () const
QString interfaceName () const
DeviceType deviceType () const
DeviceState state () const
bool managed () const
QString activeAccessPointPath () const
uint stateReason () const
uint bitrate () const
QString ipAddress () const
qint64 lastScan () const

Detailed Description

One org.freedesktop.NetworkManager.Device object.

Owned by NetworkHost (parented to it), vended to consumers via the host's deviceAdded / deviceRemoved signals. Reads its interface name, type, state, and managed flag asynchronously via Properties.GetAll and keeps them live through a PropertiesChanged subscription.

Member Enumeration Documentation

◆ DeviceState

Enumerator
UnknownState 
Unmanaged 
Unavailable 
Disconnected 
Prepare 
Config 
NeedAuth 
IpConfig 
IpCheck 
Secondaries 
Activated 
Deactivating 
Failed 

◆ DeviceType

D-Bus path of the access point this device is currently associated with, or empty when it is associated with none — which is also what a non-Wi-Fi device always reports, since only org.freedesktop.NetworkManager.Device.Wireless carries the property.

A PATH rather than an AccessPoint*: the access-point objects are owned by AccessPointModel, which builds them per device, and handing out a pointer from here would make this class a second owner of something it does not manage the lifetime of. A consumer that has a model already compares this against each row's dbusPath, which is exactly what the comparison is for.

Enumerator
Unknown 
Ethernet 
Wifi 
Bluetooth 
OlpcMesh 
Wimax 
Modem 
Infiniband 
Bond 
Vlan 
Adsl 
Bridge 
Generic 
Team 
Tun 
IpTunnel 
Macvlan 
Vxlan 
Veth 
Macsec 
Dummy 
Ppp 
Wireguard 

Constructor & Destructor Documentation

◆ NetworkDevice() [1/2]

PhosphorServiceNetwork::NetworkDevice::NetworkDevice ( const QString & dbusPath,
QObject * parent = nullptr )
explicit

◆ NetworkDevice() [2/2]

PhosphorServiceNetwork::NetworkDevice::NetworkDevice ( QDBusConnection connection,
const QString & dbusPath,
QObject * parent = nullptr )

◆ ~NetworkDevice()

PhosphorServiceNetwork::NetworkDevice::~NetworkDevice ( )
override

Member Function Documentation

◆ activeAccessPointPath()

QString PhosphorServiceNetwork::NetworkDevice::activeAccessPointPath ( ) const
nodiscard

◆ activeAccessPointPathChanged

void PhosphorServiceNetwork::NetworkDevice::activeAccessPointPathChanged ( )
signal

◆ bitrate()

uint PhosphorServiceNetwork::NetworkDevice::bitrate ( ) const
nodiscard

◆ dbusPath()

QString PhosphorServiceNetwork::NetworkDevice::dbusPath ( ) const
nodiscard

◆ detailsChanged

void PhosphorServiceNetwork::NetworkDevice::detailsChanged ( )
signal

◆ deviceType()

DeviceType PhosphorServiceNetwork::NetworkDevice::deviceType ( ) const
nodiscard

◆ deviceTypeChanged

void PhosphorServiceNetwork::NetworkDevice::deviceTypeChanged ( )
signal

◆ interfaceName()

QString PhosphorServiceNetwork::NetworkDevice::interfaceName ( ) const
nodiscard

◆ interfaceNameChanged

void PhosphorServiceNetwork::NetworkDevice::interfaceNameChanged ( )
signal

◆ ipAddress()

QString PhosphorServiceNetwork::NetworkDevice::ipAddress ( ) const
nodiscard

◆ lastScan()

qint64 PhosphorServiceNetwork::NetworkDevice::lastScan ( ) const
nodiscard

◆ managed()

bool PhosphorServiceNetwork::NetworkDevice::managed ( ) const
nodiscard

◆ managedChanged

void PhosphorServiceNetwork::NetworkDevice::managedChanged ( )
signal

◆ state()

DeviceState PhosphorServiceNetwork::NetworkDevice::state ( ) const
nodiscard

◆ stateChanged

void PhosphorServiceNetwork::NetworkDevice::stateChanged ( )
signal

◆ stateReason()

uint PhosphorServiceNetwork::NetworkDevice::stateReason ( ) const
nodiscard

The documentation for this class was generated from the following file: