editSettings

abstract suspend fun editSettings(destNum: Int, block: suspend AdminEditScope.() -> Unit)(source)

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

The session is opened before block runs and committed after it returns normally, so callers can neither forget to commit nor leak a half-open session. Operations inside the block target destNum implicitly. Mirrors the SDK's AdminApi.editSettings { }.

All admin packets for the session — begin, the block's writes, and commit — are issued from the calling coroutine, which is required for the firmware to associate them with one transaction. The implementation waits for radio queue acceptance at both boundaries, so callers cannot start a later rebooting stage while this transaction is still queued or uncommitted.

For the locally connected node, a commit dispatched immediately before the expected transport departure is treated as accepted because the reboot can prevent an acknowledgement from returning. Local owner, config, module-config, and fixed-position projections are staged until that commit is accepted; they are discarded when the block or commit fails so local state cannot describe settings the device did not commit.

Firmware exposes no abort boundary, so commit is attempted in NonCancellable context even when block throws or the caller is cancelled. The original block failure is rethrown, with a distinct commit failure attached as a suppressed exception. When block succeeds and only the commit fails, the commit failure itself is thrown and the staged projections are discarded.

Throws

when the radio rejects or does not answer the begin or commit boundary.

when the outbound queue refuses a transactional write issued by block.