AdminActionsUseCase

open class AdminActionsUseCase(radioController: RadioController, nodeRepository: NodeRepository)(source)

Use case for performing administrative and destructive actions on mesh nodes.

This component provides methods for rebooting, shutting down, or resetting nodes within the mesh. Each suspends until the device answers and returns that answer. A reset of the locally connected node also clears the phone's node database, unless the device refuses the reset.

Constructors

Link copied to clipboard
constructor(radioController: RadioController, nodeRepository: NodeRepository)

Functions

Link copied to clipboard
open suspend fun factoryReset(destNum: Int, isLocal: Boolean): AdminResult<Unit>

Factory resets destNum; isLocal also clears the phone's node database, which would be out of sync.

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

Resets the NodeDB on destNum; isLocal also clears the phone's node database the same way.

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

Reboots destNum.

Link copied to clipboard
open suspend fun rebootToDfu(destNum: Int): AdminResult<Unit>

Reboots an nRF52 destNum into its DFU bootloader; firmware answers nothing, so success means sent.

Link copied to clipboard
open suspend fun setTime(destNum: Int): AdminResult<Unit>

Syncs the node's real-time clock to the phone's current time, so a remote node whose RTC has drifted can be corrected without being on-site or using the CLI.

Link copied to clipboard
open suspend fun shutdown(destNum: Int): AdminResult<Unit>

Shuts down destNum.