RadioLink

interface RadioLink(source)

One selected radio: its SDK client, which owns connecting and reconnecting, and the app pipeline it feeds.

Properties

Link copied to clipboard
abstract val client: RadioClient
Link copied to clipboard
open val connection: StateFlow<ConnectionState>

The client's connection state.

Functions

Link copied to clipboard
open fun close()

Releases what the link's transports hold, after the client has disconnected.

Link copied to clipboard
open suspend fun connect()

Connects the client; with auto-reconnect on it returns at the first connect and throws only on a failure.

Link copied to clipboard
open suspend fun disconnect()

Disconnects the client and waits for its teardown.

Link copied to clipboard
open fun failureReason(cause: MeshtasticException): TransportDisconnectReason?

What cause means for this kind of link in terms the user can act on, or null when it has no such reading.

Link copied to clipboard

Asks the link to refresh Android's cached GATT table on its next connect, after a firmware update. Returns false for a link with no GATT table, which leaves the request for a later Bluetooth link.

Link copied to clipboard
open fun retryNow(): Boolean

Ends the client's backoff wait so its next attempt starts now.

Link copied to clipboard
abstract suspend fun run(host: RadioSessionHost)

Feeds the client's sessions into the app through host until cancelled.