upload

open fun upload(data: @NotNull Array<Byte>, offset: Int, @NotNull callback: @NotNull McuMgrCallback<McuMgrUploadResponse>)

Command delivers a part of SUIT envelope to the device (asynchronous).

Once upload is completed the device validates delivered envelope and starts SUIT processing.

The chunk size is limited by the current MTU. If the current MTU set by setUploadMtu is too large, the onError with InsufficientMtuException error will be returned. Use getMtu to get the current MTU and pass it to setUploadMtu and try again.

Use uploadAsync to upload the whole envelope.

Parameters

data

image data.

offset

the offset, from which the chunk will be sent.

callback

the asynchronous callback.


@NotNull
open fun upload(data: @NotNull Array<Byte>, offset: Int): @NotNull McuMgrUploadResponse

Command delivers a part of SUIT envelope to the device (synchronous).

Once upload is completed the device validates delivered envelope and starts SUIT processing.

The chunk size is limited by the current MTU. If the current MTU set by setUploadMtu is too large, the InsufficientMtuException error will be thrown. Use getMtu to get the current MTU and pass it to setUploadMtu and try again.

Use uploadAsync to upload the whole envelope.

Return

The upload response.

Parameters

data

image data.

offset

the offset, from which the chunk will be sent.


open fun upload(data: @NotNull Array<Byte>, offset: Int, deferInstall: Boolean, @NotNull callback: @NotNull McuMgrCallback<McuMgrUploadResponse>)

Command delivers a part of SUIT envelope to the device (asynchronous).

When using deferred install, the device will not start the update process after the last chunk and will await the beginDeferredInstall command. This allows to send cache images using uploadCache before the actual update.

The chunk size is limited by the current MTU. If the current MTU set by setUploadMtu is too large, the onError with InsufficientMtuException error will be returned. Use getMtu to get the current MTU and pass it to setUploadMtu and try again.

Use uploadAsync to upload the whole envelope.

Parameters

data

image data.

offset

the offset, from which the chunk will be sent.

deferInstall

if true, the device will not start the update process after the last chunk and will await the beginDeferredInstall command.

callback

the asynchronous callback.


@NotNull
open fun upload(data: @NotNull Array<Byte>, offset: Int, deferInstall: Boolean): @NotNull McuMgrUploadResponse

Command delivers a part of SUIT envelope to the device (synchronous).

When using deferred install, the device will not start the update process after the last chunk and will await the beginDeferredInstall command. This allows to send cache images before the actual update.

The chunk size is limited by the current MTU. If the current MTU set by setUploadMtu is too large, the InsufficientMtuException error will be thrown. Use getMtu to get the current MTU and pass it to setUploadMtu and try again.

Use uploadAsync to upload the whole envelope.

Return

The upload response.

Parameters

data

image data.

offset

the offset, from which the chunk will be sent.

deferInstall

if true, the device will not start the update process after the last chunk and will await the beginDeferredInstall command.