SUITUpgradeManagerKtx
Performs the firmware upgrade of a device using SUIT (Software Update for the Internet of Things), reporting its state using a Flow. It wraps SUITUpgradeManager.
The upgrade starts with sending the SUIT envelope. The device may then request resources, for example images, which are provided by the resourceProvider, and the process is repeated until the device reboots.
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(envelope: ByteArray, settings: FirmwareUpgradeSettings = FirmwareUpgradeSettings.Builder().build(), cacheImages: CacheImageSet? = null, resourceProvider: suspend (uri: URI) -> ByteArray = {
throw McuMgrException("The device requested a resource, but none can be provided: $it")
}): Flow<FirmwareUpgradeState<SUITUpgradeManager.State>>
Upgrades the firmware using the given SUIT envelope.