Root of the NetworkManager surface. More...
#include <PhosphorServiceNetwork/NetworkHost.h>
Public Types | |
| enum | Connectivity { UnknownConnectivity = 0 , NoConnectivity = 1 , Portal = 2 , Limited = 3 , Full = 4 } |
Signals | |
| void | networkingEnabledChanged () |
| void | wirelessEnabledChanged () |
| void | connectivityChanged () |
| void | primaryConnectionTypeChanged () |
| void | deviceAdded (PhosphorServiceNetwork::NetworkDevice *device) |
| void | deviceRemoved (PhosphorServiceNetwork::NetworkDevice *device) |
| void | deviceCountChanged () |
| void | availableChanged () |
| void | wirelessHardwareEnabledChanged () |
| void | wwanChanged () |
| void | connectivityCheckUriChanged () |
| void | operationFinished (const QString &operation, const QString &path, const QString &errorName) |
Public Member Functions | |
| NetworkHost (QObject *parent=nullptr) | |
| NetworkHost (QDBusConnection connection, QObject *parent=nullptr) | |
| ~NetworkHost () override | |
| bool | networkingEnabled () const |
| bool | available () const |
| bool | wirelessHardwareEnabled () const |
| bool | wwanSupported () const |
| bool | wwanEnabled () const |
| bool | wwanHardwareEnabled () const |
| void | setWwanEnabled (bool enabled) |
| QString | connectivityCheckUri () const |
| void | refresh () |
| void | disconnectDevice (PhosphorServiceNetwork::NetworkDevice *device) |
| bool | wirelessEnabled () const |
| void | setWirelessEnabled (bool enabled) |
| Toggle the global Wi-Fi radio (NetworkManager WirelessEnabled). | |
| Connectivity | connectivity () const |
| QString | primaryConnectionType () const |
| int | deviceCount () const |
| QList< NetworkDevice * > | devices () const |
| PhosphorServiceNetwork::NetworkDevice * | deviceAt (int index) const |
| void | scanWifi () |
| Trigger a Wi-Fi scan on every managed Wi-Fi device (NM Device.Wireless.RequestScan). | |
| void | activateConnection (PhosphorServiceNetwork::NetworkConnection *connection, PhosphorServiceNetwork::NetworkDevice *device) |
| Activate an existing saved connection on a device (NM ActivateConnection). | |
| void | connectToAccessPoint (PhosphorServiceNetwork::NetworkDevice *device, PhosphorServiceNetwork::AccessPoint *accessPoint, const QString &passphrase={}, bool autoConnect=true, PhosphorServiceNetwork::NetworkConnection *existing=nullptr) |
| Create and activate a new Wi-Fi connection for an access point (NM AddAndActivateConnection). | |
Root of the NetworkManager surface.
Binds the system bus, exposes the manager-level connectivity / radio-toggle state, and materialises one NetworkDevice per org.freedesktop.NetworkManager.Device. Construct one, hand its pointer to a NetworkDeviceModel for list views, or bind the scalar properties directly for a status indicator.
|
explicit |
|
explicit |
|
override |
| void PhosphorServiceNetwork::NetworkHost::activateConnection | ( | PhosphorServiceNetwork::NetworkConnection * | connection, |
| PhosphorServiceNetwork::NetworkDevice * | device ) |
Activate an existing saved connection on a device (NM ActivateConnection).
Fire-and-forget; the result surfaces through the device's state and the manager's connectivity. No-op if either argument is null or the bus is unavailable.
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |
| void PhosphorServiceNetwork::NetworkHost::connectToAccessPoint | ( | PhosphorServiceNetwork::NetworkDevice * | device, |
| PhosphorServiceNetwork::AccessPoint * | accessPoint, | ||
| const QString & | passphrase = {}, | ||
| bool | autoConnect = true, | ||
| PhosphorServiceNetwork::NetworkConnection * | existing = nullptr ) |
Create and activate a new Wi-Fi connection for an access point (NM AddAndActivateConnection).
An empty passphrase builds an open profile; a non-empty one builds a WPA-PSK/SAE profile. Passing an existing matching profile updates its credentials without creating a duplicate. Request errors are delivered through operationFinished. No-op if either argument is null or the bus is unavailable.
|
signal |
|
nodiscard |
|
nodiscard |
|
signal |
|
signal |
|
nodiscard |
| void PhosphorServiceNetwork::NetworkHost::disconnectDevice | ( | PhosphorServiceNetwork::NetworkDevice * | device | ) |
|
nodiscard |
|
signal |
|
signal |
|
nodiscard |
|
signal |
| void PhosphorServiceNetwork::NetworkHost::refresh | ( | ) |
| void PhosphorServiceNetwork::NetworkHost::scanWifi | ( | ) |
Trigger a Wi-Fi scan on every managed Wi-Fi device (NM Device.Wireless.RequestScan).
Fire-and-forget; the scan refreshes each device's access-point list daemon-side, which an AccessPointModel bound to that device then surfaces (its rows update as the daemon emits AccessPointAdded/Removed). No-op when no Wi-Fi device is present.
| void PhosphorServiceNetwork::NetworkHost::setWirelessEnabled | ( | bool | enabled | ) |
Toggle the global Wi-Fi radio (NetworkManager WirelessEnabled).
Issues an async Properties.Set; the cached value updates when the daemon echoes the change back via PropertiesChanged, so reading the property immediately after the call still returns the old value.
| void PhosphorServiceNetwork::NetworkHost::setWwanEnabled | ( | bool | enabled | ) |
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |
|
signal |
|
nodiscard |
|
nodiscard |
|
nodiscard |