FakeRadioController

A test double for RadioController that provides a no-op implementation and tracks calls for assertions in tests.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
data class ChannelWrite(val destination: Int?, val channel: Channel)

One local or admin channel write. Local writes have no destination.

Link copied to clipboard
data class ConfigWrite(val destination: Int?, val config: Config)

One local or admin configuration write. Local writes have no destination.

Link copied to clipboard
data class ModuleConfigWrite(val destination: Int?, val config: ModuleConfig)

One module configuration write. Local writes have no destination.

Link copied to clipboard
data class OwnerWrite(val destination: Int?, val user: User)

One owner write. Local writes have no destination.

Link copied to clipboard
sealed interface SettingsOperation

Properties

Link copied to clipboard

High-level admin operation order, including edit transaction boundaries.

Link copied to clipboard
val allModuleConfigs: List<ModuleConfig>

Module configuration payloads in call order. Prefer moduleConfigWrites when destination identity matters.

Link copied to clipboard

Test hook that can suspend while a conditional local-configuration restore owns device selection.

Link copied to clipboard

Every local or admin channel write, preserving destination and call order together.

Link copied to clipboard
open override val clientNotification: StateFlow<ClientNotification?>
Link copied to clipboard

Every local or admin configuration write, preserving destination and call order together.

Link copied to clipboard
open override val connectionEpochs: StateFlow<ConnectionEpochs>
Link copied to clipboard
open override val connectionLifecycle: StateFlow<ConnectionLifecycle>
Link copied to clipboard
open override val connectionState: StateFlow<ConnectionState>
Link copied to clipboard
Link copied to clipboard

Destination node for every edit transaction, in order. Local edits use the fake's sentinel value of zero.

Link copied to clipboard

Destination node numbers of factoryReset calls, for tests asserting a reset was (or was not) sent.

Link copied to clipboard

When set, a channel write throws after this many total local/admin channelWrites — simulates mid-write failure.

Link copied to clipboard

When true, an edit transaction fails before the begin boundary is recorded.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val lastLocalConfig: Config?
Link copied to clipboard
Link copied to clipboard
var lastSetOwnerUser: User?
Link copied to clipboard
val localChannels: List<Channel>

Local channel payloads in call order. Prefer channelWrites when destination identity matters.

Link copied to clipboard
val localConfigs: List<Config>

Local configuration payloads in call order. Prefer configWrites when destination identity matters.

Link copied to clipboard
val localModuleConfigs: List<ModuleConfig>

Local module configuration payloads in call order. Prefer moduleConfigWrites when destination matters.

Link copied to clipboard

Destination node for every module configuration write, in order. Local writes have no destination.

Link copied to clipboard

Every module configuration write, preserving destination and call order together.

Link copied to clipboard
var onEditSettingsCommitted: suspend () -> Unit

Test hook invoked after an edit transaction commits.

Link copied to clipboard
var onRequestRebootOta: suspend (requestId: Int, destNum: Int, mode: Int, hash: ByteArray?) -> Unit

Deterministic test hook invoked inside every requestRebootOta call with the request parameters.

Link copied to clipboard
var onSendMessage: suspend (DataPacket) -> Unit

Deterministic suspension/fault hook invoked before a packet is recorded as sent.

Link copied to clipboard
var onSetFixedPosition: suspend (Int, Position) -> Unit

Test hook invoked before a fixed-position write is recorded.

Link copied to clipboard
var onStandaloneConfig: suspend (Config) -> Unit

Test hook invoked after a standalone general-config write.

Link copied to clipboard
var onStandaloneModuleConfig: suspend (ModuleConfig) -> Unit

Test hook invoked after a standalone module-config write.

Link copied to clipboard

Every local or admin owner write, preserving destination and call order together.

Link copied to clipboard

Number of upcoming local-channel writes to reject through the production queue-admission failure contract.

Link copied to clipboard

Number of upcoming local-config writes to reject through the production queue-admission failure contract.

Link copied to clipboard

Failure thrown by requestNeighborInfo, when set.

Link copied to clipboard

Device identity currently owned by the conditional restore seam.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val sessionGeneration: StateFlow<Long>
Link copied to clipboard

Every config and channel write, in their shared call order.

Link copied to clipboard
Link copied to clipboard

When true, setLocalConfig throws — simulates the radio link dropping mid config write.

Functions

Link copied to clipboard
open override fun clearClientNotification()
Link copied to clipboard
open suspend override fun editLocalSettings(block: suspend AdminEditScope.() -> Unit)
Link copied to clipboard
open suspend override fun editSettings(destNum: Int, block: suspend AdminEditScope.() -> Unit)
Link copied to clipboard
open suspend override fun factoryReset(destNum: Int, packetId: Int)
Link copied to clipboard
open override fun generatePacketId(): Int
Link copied to clipboard
open suspend override fun getCannedMessages(destNum: Int, packetId: Int)
Link copied to clipboard
open suspend override fun getChannel(destNum: Int, index: Int, packetId: Int)
Link copied to clipboard
open suspend override fun getConfig(destNum: Int, configType: Int, packetId: Int)
Link copied to clipboard
open suspend override fun getDeviceConnectionStatus(destNum: Int, packetId: Int)
Link copied to clipboard
open suspend override fun getModuleConfig(destNum: Int, moduleConfigType: Int, packetId: Int)
Link copied to clipboard
open suspend override fun getOwner(destNum: Int, packetId: Int)
Link copied to clipboard
open suspend override fun getRingtone(destNum: Int, packetId: Int)
Link copied to clipboard
open suspend override fun importContact(contact: SharedContact)
Link copied to clipboard
open suspend override fun nodedbReset(destNum: Int, packetId: Int, preserveFavorites: Boolean)
Link copied to clipboard
open suspend override fun reboot(destNum: Int, packetId: Int)
Link copied to clipboard
open suspend override fun rebootToDfu(nodeNum: Int)
Link copied to clipboard
open suspend override fun refreshMetadata(destNum: Int)
Link copied to clipboard
open suspend override fun removeByNodenum(packetId: Int, nodeNum: Int)
Link copied to clipboard
open suspend override fun requestNeighborInfo(requestId: Int, destNum: Int)
Link copied to clipboard
open suspend override fun requestPosition(destNum: Int, currentPosition: Position)
Link copied to clipboard
open suspend override fun requestRebootOta(requestId: Int, destNum: Int, mode: Int, hash: ByteArray?)
Link copied to clipboard
open suspend override fun requestTelemetry(requestId: Int, destNum: Int, typeValue: Int)
Link copied to clipboard
open suspend override fun requestTraceroute(requestId: Int, destNum: Int)
Link copied to clipboard
open suspend override fun requestUserInfo(destNum: Int)
Link copied to clipboard
open fun reset()

Resets all registered state flows and custom actions to their initial state.

Link copied to clipboard
open suspend override fun restoreLocalConfiguration(expectedDeviceAddress: String?, config: Config, primaryChannel: Channel?): Boolean
Link copied to clipboard
open suspend override fun sendMessage(packet: DataPacket)
Link copied to clipboard
open suspend override fun sendReaction(emoji: String, replyId: Int, contactKey: String)
Link copied to clipboard
open suspend override fun sendSharedContact(nodeNum: Int): Boolean
Link copied to clipboard
open suspend override fun setCannedMessages(destNum: Int, messages: String)
Link copied to clipboard
fun setClientNotification(notification: ClientNotification?)
Link copied to clipboard
open suspend override fun setConfig(destNum: Int, config: Config, packetId: Int)
Link copied to clipboard
Link copied to clipboard
open suspend override fun setDeviceAddress(address: String)
Link copied to clipboard
open suspend override fun setFavorite(nodeNum: Int, favorite: Boolean)
Link copied to clipboard
open suspend override fun setFixedPosition(destNum: Int, position: Position)
Link copied to clipboard
open suspend override fun setHamMode(destNum: Int, hamParameters: HamParameters, packetId: Int)
Link copied to clipboard
open suspend override fun setIgnored(nodeNum: Int, ignored: Boolean)
Link copied to clipboard
open suspend override fun setLocalChannel(channel: Channel)
Link copied to clipboard
open suspend override fun setLocalConfig(config: Config)
Link copied to clipboard
open suspend override fun setModuleConfig(destNum: Int, config: ModuleConfig, packetId: Int)
Link copied to clipboard
open suspend override fun setOwner(destNum: Int, user: User, packetId: Int)
Link copied to clipboard
open suspend override fun setRemoteChannel(destNum: Int, channel: Channel, packetId: Int)
Link copied to clipboard
open suspend override fun setRingtone(destNum: Int, ringtone: String)
Link copied to clipboard
fun setSessionGeneration(generation: Long)
Link copied to clipboard
open suspend override fun setTime(destNum: Int, packetId: Int)
Link copied to clipboard
open suspend override fun shutdown(destNum: Int, packetId: Int)
Link copied to clipboard
open override fun startProvideLocation()
Link copied to clipboard
open override fun stopProvideLocation()
Link copied to clipboard
open suspend override fun toggleMuted(nodeNum: Int)