EnvelopeUploader

open class EnvelopeUploader(suitManager: SUITManager, envelope: ByteArray, windowCapacity: Int = 1, memoryAlignment: Int = 1, deferInstall: Boolean = false) : Uploader

This uploader is using a SUITManager to upload the SUIT Envelope.

The SUIT Envelope is a CBOR-encoded data structure that contains the manifest and, optionally, the firmware. The SUIT Envelope is sent to the device to start the firmware update process. If the device decides, during the processing, that additional resources are required, it will notify the polling client using the SUITManager.poll method.

The response the the poll operation contains a resource URI and session ID. The resource should be sent using ResourceUploader.

Parameters

envelope

The candidate SUIT Envelope to be sent, as bytes.

windowCapacity

Number of buffers available for sending data, defaults to 1. The more buffers are available, the more packets can be sent without awaiting notification with response, thus accelerating upload process.

memoryAlignment

The memory alignment of the device, defaults to 1. Some memory implementations may require bytes to be aligned to a certain value before saving them.

Constructors

Link copied to clipboard
constructor(suitManager: SUITManager, envelope: ByteArray, windowCapacity: Int = 1, memoryAlignment: Int = 1, deferInstall: Boolean = false)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun pause()

Pauses upload.

Link copied to clipboard
fun resume()

Resumes upload.

Link copied to clipboard
suspend fun upload()

Uploads the data.

Link copied to clipboard
fun uploadAsync(callback: UploadCallback, scope: CoroutineScope = GlobalScope): TransferController

Uploads the data asynchronously.