TransparentModeController

class TransparentModeController(radioConfigRepository: RadioConfigRepository, serviceRepository: ServiceRepository, adminController: AdminController, nodeManager: NodeManager, scope: CoroutineScope)(source)

Tracks whether the connected node is in transparent mode (a raw LoRa modem for a host such as meshtasticd), what the user chose to do about it for this connection, and turns it off on request.

It writes no cache: the local config cache follows the SDK session's config, which takes the handshake, the writes acknowledged on that session's link and the connected node's answers to reads.

Constructors

Link copied to clipboard
constructor(radioConfigRepository: RadioConfigRepository, serviceRepository: ServiceRepository, adminController: AdminController, nodeManager: NodeManager, scope: CoroutineScope)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val active: Flow<Boolean>

Whether the connected node would drop a packet sent through it right now.

Link copied to clipboard

Functions

Link copied to clipboard

Closes the notice for this connection, leaving the node as it is.

Link copied to clipboard

Reads transparent_mode back after the user saved it on from settings over savedOn, and returns what the node reports, or null when it did not answer on that session or the session has changed since. The notice stays back while the read is out, and afterwards unless the node reports the mode off: firmware that does not know the field accepts the write and drops it, so that is not the user's choice taking effect.

Link copied to clipboard

The radio session a save to the connected node belongs to, or null while no node is connected.

Link copied to clipboard
Link copied to clipboard
fun turnOff(savedOn: RadioSessionContext? = null)

Reads the node's LoRa config, sends it back with only transparent_mode cleared, and reads it again. The outcome is TransparentModeTurnOff.TURNED_OFF only when that second read says so. The attempt runs in the controller's own scope and ends without an outcome when its session does. With savedOn it starts only while that is still the session, so a settings save cannot hand its turn-off to another one.