RadioController

Central interface for controlling the radio and mesh network.

This is a composite interface that extends the focused sub-interfaces below. Feature modules that need the full surface inject RadioController; modules that need only a subset can inject the narrower interface for better testability and clearer dependency intent.

Sub-interfaces (mirrors SDK's layered API design):

  • AdminController — config, channels, owner, device lifecycle (→ SDK AdminApi)

  • MessagingController — send packets, reactions, contacts (→ SDK RadioClient.send*)

  • NodeController — favorite, ignore, mute, remove nodes (→ SDK AdminApi node ops)

  • QueryController — telemetry, traceroute, position queries (→ SDK TelemetryApi / RoutingApi)

When migrating to the SDK, each sub-interface becomes a thin adapter over the corresponding SDK API. The composite RadioController can then be deprecated and consumers migrated to the narrower interfaces one at a time.

Properties

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

Flow of notifications from the radio client.

Link copied to clipboard
abstract val connectionState: StateFlow<ConnectionState>

Canonical app-level connection state.

Functions

Link copied to clipboard

Clears the current clientNotification.

Link copied to clipboard
abstract suspend fun editSettings(destNum: Int, block: suspend AdminEditScope.() -> Unit)

Runs block inside a begin/commit edit-settings transaction on destNum.

Link copied to clipboard
abstract suspend fun factoryReset(destNum: Int, packetId: Int)

Performs a factory reset on a node.

Link copied to clipboard
abstract fun generatePacketId(): Int

Generates a unique packet ID for a new request.

Link copied to clipboard
abstract suspend fun getCannedMessages(destNum: Int, packetId: Int)

Requests the current canned messages from a remote node.

Link copied to clipboard
abstract suspend fun getChannel(destNum: Int, index: Int, packetId: Int)

Requests a specific channel configuration from a remote node.

Link copied to clipboard
abstract suspend fun getConfig(destNum: Int, configType: Int, packetId: Int)

Requests a specific configuration section from a remote node.

Link copied to clipboard
abstract suspend fun getDeviceConnectionStatus(destNum: Int, packetId: Int)

Requests the hardware connection status from a remote node.

Link copied to clipboard
abstract suspend fun getModuleConfig(destNum: Int, moduleConfigType: Int, packetId: Int)

Requests a module configuration section from a remote node.

Link copied to clipboard
abstract suspend fun getOwner(destNum: Int, packetId: Int)

Requests the current owner (user info) from a remote node.

Link copied to clipboard
abstract suspend fun getRingtone(destNum: Int, packetId: Int)

Requests the current ringtone from a remote node.

Link copied to clipboard
abstract suspend fun importContact(contact: SharedContact)

Imports a shared contact into the firmware's NodeDB.

Link copied to clipboard
abstract suspend fun nodedbReset(destNum: Int, packetId: Int, preserveFavorites: Boolean)

Resets the NodeDB on a node.

Link copied to clipboard
abstract suspend fun reboot(destNum: Int, packetId: Int)

Commands a node to reboot.

Link copied to clipboard
abstract suspend fun rebootToDfu(nodeNum: Int)

Commands a node to reboot into DFU mode.

Link copied to clipboard
abstract suspend fun refreshMetadata(destNum: Int)

Requests device metadata from a remote node.

Link copied to clipboard
abstract suspend fun removeByNodenum(packetId: Int, nodeNum: Int)

Removes a node from the mesh by its node number.

Link copied to clipboard
abstract suspend fun requestNeighborInfo(requestId: Int, destNum: Int)

Requests neighbor information (detected nodes) from a remote node.

Link copied to clipboard
abstract suspend fun requestPosition(destNum: Int, currentPosition: Position)

Requests the current GPS position from a remote node.

Link copied to clipboard
abstract suspend fun requestRebootOta(requestId: Int, destNum: Int, mode: Int, hash: ByteArray?)

Initiates an OTA reboot request.

Link copied to clipboard
abstract suspend fun requestTelemetry(requestId: Int, destNum: Int, typeValue: Int)

Requests telemetry data from a remote node.

Link copied to clipboard
abstract suspend fun requestTraceroute(requestId: Int, destNum: Int)

Initiates a traceroute request to a remote node.

Link copied to clipboard
abstract suspend fun requestUserInfo(destNum: Int)

Requests detailed user info from a remote node.

Link copied to clipboard
abstract suspend fun sendMessage(packet: DataPacket)

Sends a data packet to the mesh.

Link copied to clipboard
abstract suspend fun sendReaction(emoji: String, replyId: Int, contactKey: String)

Sends an emoji reaction to a message. Awaits local DB persistence.

Link copied to clipboard
abstract suspend fun sendSharedContact(nodeNum: Int): Boolean

Sends our shared contact information (identity and public key) to the firmware's NodeDB.

Link copied to clipboard
abstract suspend fun setCannedMessages(destNum: Int, messages: String)

Updates the canned messages configuration on a remote node.

Link copied to clipboard
abstract suspend fun setConfig(destNum: Int, config: Config, packetId: Int)

Updates the general configuration on a remote node.

Link copied to clipboard
abstract suspend fun setDeviceAddress(address: String)

Changes the device address (e.g., BLE MAC, IP address) we are communicating with.

Link copied to clipboard
abstract suspend fun setFavorite(nodeNum: Int, favorite: Boolean)

Sets the favorite status of a node on the radio.

Link copied to clipboard
abstract suspend fun setFixedPosition(destNum: Int, position: Position)

Sets a fixed position on a remote node.

Link copied to clipboard
abstract suspend fun setHamMode(destNum: Int, hamParameters: HamParameters, packetId: Int)

Enables amateur-radio (ham) mode on a node via AdminMessage.set_ham_mode.

Link copied to clipboard
abstract suspend fun setIgnored(nodeNum: Int, ignored: Boolean)

Sets the ignore status of a node on the radio.

Link copied to clipboard
abstract suspend fun setLocalChannel(channel: Channel)

Updates a local radio channel. Same fire-and-forget contract as setLocalConfig.

Link copied to clipboard
abstract suspend fun setLocalConfig(config: Config)

Updates the local radio configuration.

Link copied to clipboard
abstract suspend fun setModuleConfig(destNum: Int, config: ModuleConfig, packetId: Int)

Updates a module configuration on a remote node.

Link copied to clipboard
abstract suspend fun setOwner(destNum: Int, user: User, packetId: Int)

Updates the owner (user info) on a remote node.

Link copied to clipboard
abstract suspend fun setRemoteChannel(destNum: Int, channel: Channel, packetId: Int)

Updates a channel configuration on a remote node.

Link copied to clipboard
abstract suspend fun setRingtone(destNum: Int, ringtone: String)

Updates the notification ringtone on a remote node.

Link copied to clipboard
abstract suspend fun setTime(destNum: Int, packetId: Int)

Syncs a node's real-time clock to the phone's current time via AdminMessage.set_time_only.

Link copied to clipboard
abstract suspend fun shutdown(destNum: Int, packetId: Int)

Commands a node to shut down.

Link copied to clipboard
abstract fun startProvideLocation()

Starts providing the phone's location to the mesh.

Link copied to clipboard
abstract fun stopProvideLocation()

Stops providing the phone's location to the mesh.

Link copied to clipboard
abstract suspend fun toggleMuted(nodeNum: Int)

Toggles the mute status of a node on the radio. Mirrors the SDK's toggleMuted(NodeId).