SessionAdmin

Runs admin commands on the local node through the active radio session's SDK admin API.

Constructors

Link copied to clipboard
constructor(radio: RadioInterfaceService, scope: ServiceScope)

Functions

Link copied to clipboard
fun activeClient(): RadioClient?

The active session's SDK client, or null when no radio session is active.

Link copied to clipboard
suspend fun <T> await(operation: String, command: suspend AdminApi.() -> AdminResult<T>): AdminResult<T>

Runs command and returns the device's answer, or AdminResult.NodeUnreachable when the session ends first.

Link copied to clipboard
fun launch(operation: String, onResult: suspend (AdminResult<*>) -> Unit = {}, command: suspend AdminApi.() -> AdminResult<*>)

Starts command without waiting for the device's answer and logs a failure. The SDK enqueues the packet before command first suspends, so commands started in order reach the radio in order.

Link copied to clipboard
suspend fun <T> run(command: suspend AdminApi.() -> AdminResult<T>): AdminResult<T>

Runs command and returns the device's answer, or AdminResult.NodeUnreachable without a radio session.