DiscoveryViewModel

class DiscoveryViewModel(scanEngine: DiscoveryScanEngine, serviceRepository: ServiceRepository, discoveryPrefs: DiscoveryPrefs, check24GhzCapability: Check24GhzCapability, meshBeaconRepository: MeshBeaconRepository, radioConfigRepository: RadioConfigRepository, discoveryDao: DiscoveryDao) : ViewModel(source)

Constructors

Link copied to clipboard
constructor(scanEngine: DiscoveryScanEngine, serviceRepository: ServiceRepository, discoveryPrefs: DiscoveryPrefs, check24GhzCapability: Check24GhzCapability, meshBeaconRepository: MeshBeaconRepository, radioConfigRepository: RadioConfigRepository, discoveryDao: DiscoveryDao)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Distinct custom channels advertised by beacons — offered as selectable scan targets (FR-007).

Link copied to clipboard

Mesh Beacon invitations received from other meshes, newest first.

Link copied to clipboard

Modem presets advertised by any received beacon — flagged in the scan-setup picker (FR-004).

Link copied to clipboard
Link copied to clipboard
val currentChannels: StateFlow<List<ChannelSettings>>

The radio's current channel settings (index 0 = primary) — drives the add-vs-switch decision.

Link copied to clipboard
val currentLora: StateFlow<Config.LoRaConfig?>

The radio's current LoRa config — drives the add-vs-switch decision for a beacon join.

Link copied to clipboard
Link copied to clipboard
val dwellDurationMinutes: StateFlow<Int>
Link copied to clipboard
val homePreset: StateFlow<ChannelOption>
Link copied to clipboard
val is24GhzBlocked: StateFlow<Boolean>
Link copied to clipboard
val isConnected: StateFlow<Boolean>
Link copied to clipboard
val isLora24Region: StateFlow<Boolean>

True when the radio is on the LORA_24 region.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard

Adds the preset an invitation advertised to the scan selection (union, never clearing the user's existing choices — matches Apple 014-mesh-beacons FR-003), so the user can survey the advertised mesh before joining. Persists like togglePreset so the shown selection and saved prefs never diverge. No-op if the offer carries no preset, or a preset with no matching ChannelOption.

Link copied to clipboard
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun reset()
Link copied to clipboard
fun setDwellDuration(minutes: Int)
Link copied to clipboard
fun startScan()
Link copied to clipboard
fun stopScan()
Link copied to clipboard
Link copied to clipboard