WifiProvisionViewModel
ViewModel for the WiFi provisioning flow.
Created per navigation entry, so the instance is scoped to the entry's ViewModelStoreOwner. A fresh NymeaWifiService (and its own BleConnectionFactory-backed org.meshtastic.core.ble.BleConnection) is created lazily for each provisioning session and cleaned up via onCleared. Device discovery and ordering live in DeviceDiscovery; nothing connects until the user taps a listed device or confirms an address.
Constructors
Properties
Functions
The user accepted the address held in WifiProvisionUiState.pendingAddress.
Connect to the device with address, or to the one the user picks in the browser's own chooser when address is null there. Where the app scans itself, a null address starts the device list instead: the connection never goes to whichever device advertises first. Pauses at WifiProvisionUiState.Phase.DeviceFound so the user can check the device before proceeding.
Connect to the listed device with address, which the user tapped.
Cancel any scan or pending confirmation, close any active BLE connection and return to the initial state.
Send WiFi credentials to the device.
Called when the user confirms they want to scan networks after device discovery.