SharedRadioInterfaceService

class SharedRadioInterfaceService(dispatchers: CoroutineDispatchers, environment: LinkEnvironmentObserver, processLifecycle: Lifecycle, radioPrefs: RadioPrefs, links: RadioLinks, analytics: PlatformAnalytics, radioOperationLock: RadioOperationLock, serviceStateWriter: ServiceStateWriter) : RadioInterfaceService(source)

The selected radio's SDK client and the app sessions it carries.

The SDK client owns connecting, backoff and reconnecting. This service builds one client per selected device through the platform's RadioLinks, connects and disconnects it, asks it to retry at once when Bluetooth, the network or the selected USB device comes back, keeps it off the radio while a RadioOperation needs the port, and publishes its ConnectionState to ServiceStateWriter. ConnectionState.Connected shows only once the app holds the session's config and nodes.

Constructors

Link copied to clipboard
constructor(dispatchers: CoroutineDispatchers, environment: LinkEnvironmentObserver, processLifecycle: Lifecycle, radioPrefs: RadioPrefs, links: RadioLinks, analytics: PlatformAnalytics, radioOperationLock: RadioOperationLock, serviceStateWriter: ServiceStateWriter)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val activeSession: StateFlow<RadioSessionContext?>
Link copied to clipboard
open override val connectionError: Flow<String>
Link copied to clipboard
open override val currentDeviceAddressFlow: StateFlow<String?>
Link copied to clipboard
Link copied to clipboard
open override val meshActivity: Flow<MeshActivity>
Link copied to clipboard
open override val mockTransportEnabled: StateFlow<Boolean>
Link copied to clipboard
open override val sessionGeneration: StateFlow<Long>
Link copied to clipboard

Functions

Link copied to clipboard
open fun adminForSession(session: RadioSessionContext): AdminApi?
Link copied to clipboard
open override fun adminSessionStatus(node: NodeId): Flow<AdminSessionStatus>
Link copied to clipboard
open override fun clientForSession(session: RadioSessionContext): RadioClient?
Link copied to clipboard
open override fun connect()
Link copied to clipboard
open suspend override fun deliverMqttProxy(message: MqttClientProxyMessage): Boolean
Link copied to clipboard
open suspend override fun disconnect()
Link copied to clipboard
open override fun getDeviceAddress(): String?
Link copied to clipboard
open override fun isSessionActive(session: RadioSessionContext): Boolean
Link copied to clipboard
open override fun reportReceiveActivity()
Link copied to clipboard
open override fun reportSendActivity()
Link copied to clipboard
open override fun requestNodeDbRefresh(session: RadioSessionContext): Boolean
Link copied to clipboard
open override fun sendPaced(session: RadioSessionContext, packet: MeshPacket): PacedMessageHandle?
Link copied to clipboard
open override fun sessionScope(session: RadioSessionContext): CoroutineScope?
Link copied to clipboard
open override fun setDeviceAddress(deviceAddr: String?): Boolean
Link copied to clipboard
open override fun toInterfaceAddress(interfaceId: InterfaceId, rest: String): String
Link copied to clipboard
open override fun tryLockdown(session: RadioSessionContext, auth: LockdownAuth): Boolean