AdminController

Device configuration and control operations.

Mirrors the SDK's AdminApi interface — local and remote configuration, channel management, owner identity, device lifecycle commands, and batch edit sessions. Implementations delegate to the session's RadioClient.admin. Operations that enqueue outbound admin packets can throw RadioRequestRejectedException when the current radio session cannot admit the handoff. “Fire-and-forget” means no device response is awaited, not that a local rejection is silently ignored.

See also

Inheritors

Functions

Link copied to clipboard
abstract suspend fun addRemoteContact(destNum: Int, contact: SharedContact): Boolean

Adds contact to destNum's node DB via AdminMessage.add_contact. Firmware also favorites it, except on a CLIENT_BASE node. Returns true once destNum acknowledges.

Link copied to clipboard
abstract suspend fun editLocalSettings(block: suspend AdminEditScope.() -> Unit)

Runs block as an editSettings transaction against the local node.

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): AdminResult<Unit>

Performs a factory reset on a node, BLE bonds included.

Link copied to clipboard
abstract suspend fun getCannedMessages(destNum: Int): AdminResult<String>

Reads the current canned messages.

Link copied to clipboard
abstract suspend fun getChannel(destNum: Int, index: Int): AdminResult<Channel>

Reads the channel at zero-based index.

Link copied to clipboard
abstract suspend fun getConfig(destNum: Int, configType: Int): AdminResult<Config>

Reads a configuration section; configType is an AdminMessage.ConfigType value.

Link copied to clipboard
abstract suspend fun getDeviceConnectionStatus(destNum: Int): AdminResult<DeviceConnectionStatus>

Reads the hardware connection status.

Link copied to clipboard
abstract suspend fun getDeviceMetadata(destNum: Int): AdminResult<DeviceMetadata>

Reads the device metadata, the remote-admin preflight.

Link copied to clipboard
abstract suspend fun getModuleConfig(destNum: Int, moduleConfigType: Int): AdminResult<ModuleConfig>

Reads a module configuration section; moduleConfigType is an AdminMessage.ModuleConfigType value.

Link copied to clipboard
abstract suspend fun getOwner(destNum: Int): AdminResult<User>

Reads the current owner (user info).

Link copied to clipboard
abstract suspend fun getRingtone(destNum: Int): AdminResult<String>

Reads the current ringtone.

Link copied to clipboard
abstract suspend fun nodedbReset(destNum: Int, preserveFavorites: Boolean): AdminResult<Unit>

Resets the NodeDB on a node.

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

Plays the node's saved ringtone once via AdminMessage.play_ringtone_request. Fire-and-forget: the firmware sends no response, and builds without RTTTL support ignore it.

Link copied to clipboard
abstract suspend fun reboot(destNum: Int): AdminResult<Unit>

Commands a node to reboot.

Link copied to clipboard
abstract suspend fun rebootToDfu(nodeNum: Int): AdminResult<Unit>

Commands a node to reboot into DFU mode; firmware answers nothing, so success means sent.

Link copied to clipboard
abstract suspend fun removeRemoteNode(destNum: Int, nodeNum: Int): Boolean

Removes nodeNum from destNum's node DB. Returns true once destNum acknowledges.

Link copied to clipboard
abstract fun requestDisplayFrame()

Requests a single framebuffer frame from the locally connected node, delivered like mirrored frames.

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

Sends an ESP32 OTA reboot request without waiting for the node's answer.

Link copied to clipboard
abstract fun sendInputEvent(eventCode: Int, kbChar: Int = 0, touchX: Int = 0, touchY: Int = 0)

Injects a physical input event (button/key/touch) into the locally connected node's UI via the firmware InputBroker. Event codes are the firmware's input_broker_event values. Non-suspend immediate send: input must not queue behind bulk admin traffic.

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): AdminResult<Unit>

Updates the general configuration on a node.

Link copied to clipboard
abstract fun setDisplayMirror(enabled: Boolean)

Enables or disables live display mirroring on the locally connected node. While enabled, the device streams its framebuffer as FromRadio.display_frame chunks — collect them via DisplayMirrorManager. Non-suspend (immediate send, bypassing the outbound FIFO) so lifecycle teardown can reliably disable the stream.

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): AdminResult<Unit>

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

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 setLocalConfigOn(session: RadioSessionContext, config: Config): AdminResult<Unit>

Writes config to the connected node of session and returns its answer, for a write whose input was read on that session. Nothing is sent once session no longer owns the radio; the answer is then AdminResult.NodeUnreachable.

Link copied to clipboard
abstract suspend fun setModuleConfig(destNum: Int, config: ModuleConfig): AdminResult<Unit>

Updates a module configuration on a node.

Link copied to clipboard
abstract suspend fun setOwner(destNum: Int, user: User): AdminResult<Unit>

Updates the owner (user info) on a node.

Link copied to clipboard
abstract suspend fun setRemoteChannel(destNum: Int, channel: Channel): AdminResult<Unit>

Updates a channel configuration on a node.

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

Favorites or unfavorites nodeNum in destNum's node DB. Returns true once destNum acknowledges.

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

Ignores or unignores nodeNum in destNum's node DB. Returns true once destNum acknowledges.

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): AdminResult<Unit>

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): AdminResult<Unit>

Commands a node to shut down.