Repository navigation
feat(network): initial WiFi hotspot support - #2825
Conversation
ab965cf to
9825cf9
Compare
9825cf9 to
c986434
Compare
bbedward
left a comment
There was a problem hiding this comment.
The work looks great, thanksa lot for the contribution. Just some small changes on the map access mainly which is better to guard with mutexes
|
What advantage does this have over hostapd? Why choose NetworkManager over hostapd? |
Establish the interface and manager plumbing for hotspot support so backends can opt in without expanding the core Backend contract. Only backends that implement HotspotBackend get hotspot state propagated; others are forced to unsupported regardless of what they self-report.
Wire up configure/ start/ stop hotspot through the request router so the QML service layer can drive hotspot operations. Bump API version to 27 and document the capability-gating contract clients should follow.
Implement HotspotBackend on NetworkManagerBackend with DMS-owned profile management, AP capability detection, and band validation. Device resolution is deferred to StartHotspot when no device is specified, so profiles survive hardware changes.
Filter AP-mode profiles and access points out of all client Wi-Fi paths so the DMS hotspot (and user-created APs) never appear as saved networks, visible networks, or connected state. This protects existing client behavior before hotspot controls are exposed in the UI.
Expose hotspot state and actions through DMSNetworkService, NetworkService, and LegacyNetworkService. Capability is gated on API version and backend-reported support, not backend name checks, and stays stable when Wi-Fi radio is disabled.
Settings shows a hotspot setup card as a sibling in the Wi-Fi tab with SSID, password, device, band, save, and start/ stop controls. Control Center shows a compact row that toggles a configured hotspot or routes to Settings for initial setup. Both stay visible when Wi-Fi is disabled, explaining the requirement instead of hiding.
c986434 to
a04730e
Compare
@knuxyl Hotspot support here is backend-agnostic, I implemented it as an optional capability. |
|
@bbedward Thanks for the review, I fixed the mutex issue :) |
* Add hotspot contract layer with capability-gated dispatch. Establish the interface and manager plumbing for hotspot support so backends can opt in without expanding the core Backend contract. Only backends that implement HotspotBackend get hotspot state propagated; others are forced to unsupported regardless of what they self-report. * Add IPC handlers and API docs for hotspot actions. Wire up configure/ start/ stop hotspot through the request router so the QML service layer can drive hotspot operations. Bump API version to 27 and document the capability-gating contract clients should follow. * Implement NetworkManager hotspot backend. Implement HotspotBackend on NetworkManagerBackend with DMS-owned profile management, AP capability detection, and band validation. Device resolution is deferred to StartHotspot when no device is specified, so profiles survive hardware changes. * Isolate client Wi-Fi state from AP-mode connections. Filter AP-mode profiles and access points out of all client Wi-Fi paths so the DMS hotspot (and user-created APs) never appear as saved networks, visible networks, or connected state. This protects existing client behavior before hotspot controls are exposed in the UI. * Prefer idle radios for automatic hotspot device selection. * Add hotspot properties and methods to QML service layer. Expose hotspot state and actions through DMSNetworkService, NetworkService, and LegacyNetworkService. Capability is gated on API version and backend-reported support, not backend name checks, and stays stable when Wi-Fi radio is disabled. * Add hotspot controls to Settings and Control Center. Settings shows a hotspot setup card as a sibling in the Wi-Fi tab with SSID, password, device, band, save, and start/ stop controls. Control Center shows a compact row that toggles a configured hotspot or routes to Settings for initial setup. Both stay visible when Wi-Fi is disabled, explaining the requirement instead of hiding. * Add translator context to hotspot strings.
Adds WiFi hotspot support to DMS through an optional backend capability, with NetworkManager as the first implementation. Unsupported backends and older servers (gated behind IPC API v28) hide the feature automatically.
UI
Settings
The WiFi settings tab now includes a dedicated hotspot card for configuring the SSID, password, device, and band. Users can save, start, stop, and edit the DMS-managed hotspot profile. An empty password creates an open network, and editing prefills the stored password so re-saving never silently changes security. Starting on a connected radio prompts for confirmation before disconnecting the current WiFi connection.
Control Center
Control Center now shows a compact hotspot row alongside the WiFi controls. Configured hotspots can be started or stopped directly. When setup is required, the row links to the WiFi settings tab.
Backend
DMS manages a dedicated NetworkManager profile identified by its
stable-id, leaving user-created hotspots untouched. Activation is asynchronous and follows NetworkManager state signals so the UI can show progress and report failures.Automatic device selection prefers the radio already hosting the hotspot, followed by idle AP-capable radios. A connected radio is used only as a last resort.
AP-mode connections are isolated from normal client WiFi state and operations, including network lists, saved-profile actions, QR and autoconnect handling, and connection-priority rewrites.
Requirements
dnsmasqfor NetworkManager's shared IPv4 method.Future work
Some adapters support simultaneous client and access-point operation through STA+AP concurrency. Supporting this requires creating a virtual AP interface and coordinating its channel with the client connection, which NetworkManager does not handle automatically. Until then, sharing an active WiFi connection requires a second adapter.
Testing
Tested with hermetic NetworkManager mocks and manually on an MT7921 using 2.4 and 5 GHz bands, open and WPA2 networks, and a phone client connected through an Ethernet uplink.