FirmwareUpgradeManagerKtx
Performs the firmware upgrade of a device running McuBoot, reporting its state using a Flow. It wraps FirmwareUpgradeManager.
The upgrade is a process of validating the images, uploading them, testing or confirming, and resetting the device, depending on the Mode. See the documentation of FirmwareUpgradeManager for details.
The manager can only perform one upgrade at a time, and keeps one callback. The upgrade flow takes it over for the time of the upgrade, and also makes the callbacks to be called on a background thread, instead of the UI thread. Do not use a callback set on the same manager at the same time.
Properties
Functions
Link copied to clipboard
fun upgrade(image: ByteArray, settings: FirmwareUpgradeManager.Settings = Settings.Builder().build(), mode: FirmwareUpgradeManager.Mode? = null): Flow<FirmwareUpgradeState<FirmwareUpgradeManager.State>>
Upgrades the firmware using a single image.
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.