FirmwareUpgradeState

sealed interface FirmwareUpgradeState<out S : Enum<*>>

The state of a firmware upgrade, as reported by the flow returned by the upgrade methods of FirmwareUpgradeManagerKtx and SUITUpgradeManagerKtx.

The flow is cold: the upgrade starts when the flow is collected, and is cancelled when the collection is cancelled. The first emitted state is always Started. The flow completes after Completed or Cancelled, and fails with a FirmwareUpgradeException if the upgrade fails.

Type Parameters

S

The type of the state of the upgrade process, which is FirmwareUpgradeManager.State or SUITUpgradeManager.State.

Inheritors

Types

Link copied to clipboard
data class Cancelled<out S : Enum<*>>(val state: S) : FirmwareUpgradeState<S>

The upgrade has been cancelled using the controller.

Link copied to clipboard

The upgrade has been completed successfully.

Link copied to clipboard

The upgrade has been started.

Link copied to clipboard
data class StateChanged<out S : Enum<*>>(val previous: S, val current: S) : FirmwareUpgradeState<S>

The upgrade process has moved to another state.

Link copied to clipboard
data class UploadProgress(val bytesSent: Int, val imageSize: Int, val timestamp: Long) : FirmwareUpgradeState<Nothing>

The progress of the upload of the image, or of the envelope or resource, to the device.