ConnectionState

sealed interface ConnectionState(source)

Lifecycle of the SDK's connection to a device.

Transitions from DisconnectedConnectingConfiguringConnected. May also transition back through Reconnecting if the transport drops or hangs.

Device sleep is not represented: devices do not announce sleep on the wire (the PhoneAPI simply goes silent). The SDK cannot reliably distinguish "device sleeping for ls_secs" from "transport hung". Sleep timing is observable via Config.power.ls_secs from the handshake; when the device stops responding, the state machine transitions through Reconnecting just as for any other disconnect.

Since

0.1.0

Inheritors

Types

Link copied to clipboard
data class Configuring(val phase: ConfigPhase, val progress: Float) : ConnectionState

Transport is up; completing handshake configuration.

Link copied to clipboard

Handshake complete; session is ready for use.

Link copied to clipboard
data class Connecting(val attempt: Int) : ConnectionState

Attempting to establish a connection.

Link copied to clipboard

SDK is not connected and has no active connection attempt.

Link copied to clipboard
data class Reconnecting(val cause: MeshtasticException, val attempt: Int) : ConnectionState

Connection dropped unexpectedly; attempting automatic reconnect.