NetworkManager (org.freedesktop.NetworkManager) device and connectivity readouts for Phosphor-based desktop shells.
Exposes the system bus org.freedesktop.NetworkManager surface (per-device interface/type/state, the global connectivity level, the networking and Wi-Fi radio toggles) as Qt + QML types. No UI. The shell decides how a connectivity icon, device list, or Wi-Fi toggle is rendered.
The library is a D-Bus client built on the generic PhosphorDBus::Client async helper. It observes manager + device state and offers a small write surface (toggle the Wi-Fi radio, trigger a Wi-Fi scan).
| Type | Role |
|---|---|
| NetworkDevice | One org.freedesktop.NetworkManager.Device. interfaceName, deviceType, state, managed. |
| NetworkHost | Owns the device set + manager state. networkingEnabled, wirelessEnabled (writable), connectivity, primaryConnectionType, deviceCount; scanWifi(), activateConnection(), connectToAccessPoint(); signals on device add/remove. |
| NetworkDeviceModel | QAbstractListModel over the host's devices. Roles: device, interfaceName, deviceType, deviceState, managed. |
| AccessPoint | One org.freedesktop.NetworkManager.AccessPoint. ssid, strength, frequency, bssid, security, secured. |
| AccessPointModel | QAbstractListModel over a Wi-Fi device's scanned APs (bind device). Roles: accessPoint, ssid, strength, frequency, bssid, security, secured. |
| NetworkConnection | One saved profile (Settings.Connection). id, uuid, connectionType. |
| NetworkConnectionModel | QAbstractListModel over NetworkManager's saved connections (self-bootstrapping). Roles: connection, id, uuid, connectionType. |
C++ shell composition root:
#include <PhosphorServiceNetwork/QmlRegistration.h>
int main(int argc, char** argv)
{
QGuiApplication app(argc, argv);
PhosphorServiceNetwork::registerQmlTypes();
// ... load shell.qml
}QML consumer (connectivity indicator + Wi-Fi toggle):
import Phosphor.Service.Network 1.0
NetworkHost { id: net }
Switch {
text: "Wi-Fi"
checked: net.wirelessEnabled
onToggled: net.wirelessEnabled = checked
}
Label {
text: net.connectivity === NetworkHost.Full ? "Online" : "Limited / offline"
}QML consumer (per-device list):
import Phosphor.Service.Network 1.0
NetworkHost { id: net }
NetworkDeviceModel { id: devices; host: net }
Repeater {
model: devices
delegate: Label { text: interfaceName + " (type " + deviceType + ", state " + deviceState + ")" }
}Shipped. The manager lifecycle (connectivity / radio-toggle state + device enumeration), NetworkDevice, NetworkDeviceModel, the Wi-Fi radio toggle and scanWifi() trigger, access-point surfacing (AccessPoint / AccessPointModel with derived security labels), the saved-connection list (NetworkConnection / NetworkConnectionModel), the connect paths (activateConnection() for a saved profile, connectToAccessPoint() via NM AddAndActivateConnection for open or WPA-PSK networks), and the phosphorctl-style CLI demo (examples/phosphor-service-network-cli: status, list-devices, list-connections, list-aps, scan, connect) covering the core capabilities (list connections, scan wifi, connect to AP). Live D-Bus integration tests against a fake NetworkManager fixture are a follow-up. The smoke harness pins the public contract (role names, enum wire constants, lifecycle) deterministically without a daemon.