upgrade

Upgrades the firmware using a single image.

The upgrade starts when the flow is collected, and is cancelled when the collection is. It may be paused, resumed and cancelled using the controller from FirmwareUpgradeState.Started.

Parameters

image

The image data, in the format of McuBoot.

settings

The settings of the upgrade.

mode

The mode of the upgrade, or null to leave the one set in the manager (the default is Mode.TEST_AND_CONFIRM).

Throws

if the upgrade fails.

if the image is not valid.

if another upgrade is in progress.


fun upgrade(images: ImageSet, settings: FirmwareUpgradeManager.Settings = Settings.Builder().build(), mode: FirmwareUpgradeManager.Mode? = null): Flow<FirmwareUpgradeState<FirmwareUpgradeManager.State>>

Upgrades the firmware using multiple images, for example for a device with many cores.

The upgrade starts when the flow is collected, and is cancelled when the collection is. It may be paused, resumed and cancelled using the controller from FirmwareUpgradeState.Started.

Parameters

images

The images, each with the index of the core it is for.

settings

The settings of the upgrade.

mode

The mode of the upgrade, or null to leave the one set in the manager (the default is Mode.TEST_AND_CONFIRM).

Throws

if the upgrade fails.

if another upgrade is in progress.