DiscoveryScanState

sealed interface DiscoveryScanState(source)

State machine for a discovery scan lifecycle.

Idle → Preparing → Shifting → [Reconnecting] → Dwell → Shifting (loop) → Analysis → Complete(Success)
Any scanning → Cancelling → Restoring → Complete(Cancelled)
Any scanning → Failed(reason) → Restoring → Complete(Failed)
Reconnecting timeout → Paused

Inheritors

Types

Link copied to clipboard

All presets scanned; aggregating results.

Link copied to clipboard

User-initiated cancellation in progress; persisting partial results before restoring home preset.

Link copied to clipboard
data class Complete(val outcome: DiscoveryScanState.CompletionOutcome = CompletionOutcome.Success) : DiscoveryScanState

Scan finished and results are persisted.

Link copied to clipboard

Differentiates how a scan completed.

Link copied to clipboard
data class Dwell(val presetName: String, val remainingSeconds: Long, val totalSeconds: Long) : DiscoveryScanState

Listening on a preset and counting down the dwell timer.

Link copied to clipboard
data class Failed(val reason: String) : DiscoveryScanState

Scan failed due to an unrecoverable error.

Link copied to clipboard
data object Idle : DiscoveryScanState

No scan is active.

Link copied to clipboard
data class Paused(val reason: String) : DiscoveryScanState

Scan paused due to an unrecoverable transient condition (e.g. reconnect timeout).

Link copied to clipboard

Validating inputs, capturing home preset snapshot.

Link copied to clipboard
data class Reconnecting(val presetName: String) : DiscoveryScanState

Waiting for the radio to reconnect after a preset change.

Link copied to clipboard

Restoring the home preset after scan stop or completion.

Link copied to clipboard
data class Shifting(val presetName: String) : DiscoveryScanState

Radio is switching to a new LoRa preset.