FakeRadioInterfaceService

class FakeRadioInterfaceService(val serviceScope: CoroutineScope = MainScope()) : RadioInterfaceService(source)

A test double for RadioInterfaceService that provides an in-memory implementation. Address selection remains separate from session admission: connect publishes a fresh monotonically increasing session generation. Tests that need a connection state use FakeServiceRepository.connectionState, which the real service publishes to.

Constructors

Link copied to clipboard
constructor(serviceScope: CoroutineScope = MainScope())

Properties

Link copied to clipboard
open override val activeSession: StateFlow<RadioSessionContext?>
Link copied to clipboard
var client: RadioClient?

The SDK client clientForSession hands out while a session is admitted.

Link copied to clipboard
open override val connectionError: Flow<String>
Link copied to clipboard
open override val currentDeviceAddressFlow: StateFlow<String?>
Link copied to clipboard
val deliveredMqttProxyMessages: MutableList<MqttClientProxyMessage>

Broker messages handed to deliverMqttProxy, in order.

Link copied to clipboard

No capture asset in tests; flip per-test when exercising replay-gated behaviour.

Link copied to clipboard
open override val meshActivity: Flow<MeshActivity>
Link copied to clipboard
open override val mockTransportEnabled: MutableStateFlow<Boolean>
Link copied to clipboard

How many received frames were reported through reportReceiveActivity.

Link copied to clipboard

How many outbound packets were reported through reportSendActivity.

Link copied to clipboard
val serviceScope: CoroutineScope
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 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
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