RadioConfigUseCase

open class RadioConfigUseCase(radioController: RadioController)(source)

Use case for interacting with radio configuration components.

Every request method takes an onRequestId callback invoked with the request's packet ID before the send is issued. Callers that correlate responses by request ID (e.g. RadioConfigViewModel.requestIds) MUST register the ID in this callback rather than after the method returns: the send suspends until the radio acks the packet via QueueStatus, and for the locally connected node the firmware (2.8+) delivers the admin response through its synchronous loopback before that ack — so a post-return registration loses the race and the response is dropped.

Constructors

Link copied to clipboard
constructor(radioController: RadioController)

Functions

Link copied to clipboard
open suspend fun getCannedMessages(destNum: Int, onRequestId: (Int) -> Unit = {}): Int

Requests the canned messages from the radio.

Link copied to clipboard
open suspend fun getChannel(destNum: Int, index: Int, onRequestId: (Int) -> Unit = {}): Int

Requests a channel from the radio.

Link copied to clipboard
open suspend fun getConfig(destNum: Int, configType: Int, onRequestId: (Int) -> Unit = {}): Int

Requests a configuration section from the radio.

Link copied to clipboard
open suspend fun getDeviceConnectionStatus(destNum: Int, onRequestId: (Int) -> Unit = {}): Int

Requests the device connection status from the radio.

Link copied to clipboard
open suspend fun getModuleConfig(destNum: Int, moduleConfigType: Int, onRequestId: (Int) -> Unit = {}): Int

Requests a module configuration section from the radio.

Link copied to clipboard
open suspend fun getOwner(destNum: Int, onRequestId: (Int) -> Unit = {}): Int

Requests the owner information from the radio.

Link copied to clipboard
open suspend fun getRingtone(destNum: Int, onRequestId: (Int) -> Unit = {}): Int

Requests the ringtone from the radio.

Link copied to clipboard
open suspend fun removeFixedPosition(destNum: Int)

Removes the fixed position on the radio.

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

Sets the canned messages on the radio.

Link copied to clipboard
open suspend fun setConfig(destNum: Int, config: Config, onRequestId: (Int) -> Unit = {}): Int

Updates a configuration section on the radio.

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

Updates the fixed position on the radio.

Link copied to clipboard
open suspend fun setHamMode(destNum: Int, hamParameters: HamParameters, onRequestId: (Int) -> Unit = {}): Int

Enables amateur-radio (ham) mode on the locally connected node via set_ham_mode. At protobufs 2.7.25 only call_sign and short_name are user-supplied; long_name becomes settable when meshtastic/protobufs#941 ships.

Link copied to clipboard
open suspend fun setModuleConfig(destNum: Int, config: ModuleConfig, onRequestId: (Int) -> Unit = {}): Int

Updates a module configuration section on the radio.

Link copied to clipboard
open suspend fun setOwner(destNum: Int, user: User, onRequestId: (Int) -> Unit = {}): Int

Updates the owner information on the radio.

Link copied to clipboard
open suspend fun setRemoteChannel(destNum: Int, channel: Channel, onRequestId: (Int) -> Unit = {}): Int

Updates a channel on the radio.

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

Sets the ringtone on the radio.