SharedRadioInterfaceService

class SharedRadioInterfaceService(dispatchers: CoroutineDispatchers, bluetoothRepository: BluetoothRepository, networkRepository: NetworkRepository, processLifecycle: Lifecycle, radioPrefs: RadioPrefs, transportFactory: RadioTransportFactory, analytics: PlatformAnalytics) : RadioInterfaceService(source)

Shared multiplatform connection orchestrator for Meshtastic radios.

Manages the connection lifecycle (connect, active, disconnect, reconnect loop), device address state flows, and hardware state observability (BLE/Network toggles). Delegates the actual raw byte transport mapping to a platform-specific RadioTransportFactory.

Constructors

Link copied to clipboard
constructor(dispatchers: CoroutineDispatchers, bluetoothRepository: BluetoothRepository, networkRepository: NetworkRepository, processLifecycle: Lifecycle, radioPrefs: RadioPrefs, transportFactory: RadioTransportFactory, analytics: PlatformAnalytics)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val connectionError: SharedFlow<String>
Link copied to clipboard
open override val connectionState: StateFlow<ConnectionState>
Link copied to clipboard
open override val currentDeviceAddressFlow: StateFlow<String?>
Link copied to clipboard
open override val meshActivity: SharedFlow<MeshActivity>
Link copied to clipboard
open override val receivedData: Flow<ByteArray>
Link copied to clipboard
open override val serviceScope: CoroutineScope
Link copied to clipboard

Functions

Link copied to clipboard
open override fun connect()
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 handleFromRadio(bytes: ByteArray)
Link copied to clipboard
open override fun isMockTransport(): Boolean
Link copied to clipboard
fun keepAlive(now: Long = nowMillis)
Link copied to clipboard
open override fun onConnect()
Link copied to clipboard
open override fun onDisconnect(isPermanent: Boolean, errorMessage: String?)
Link copied to clipboard
open override fun resetReceivedBuffer()
Link copied to clipboard
open override fun sendToRadio(bytes: ByteArray)
Link copied to clipboard
open override fun setDeviceAddress(deviceAddr: String?): Boolean
Link copied to clipboard
open override fun toInterfaceAddress(interfaceId: InterfaceId, rest: String): String