upload

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

Send a packet of given data from the specified offset to the device (asynchronous).

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 imageUpload to send the whole file asynchronously using one command.

Parameters

data

image data.

offset

the offset, from which the chunk will be sent.

callback

the asynchronous callback.

See also


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

Send a packet of given data from the specified offset to the given core (image) on the device (asynchronous).

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 imageUpload to send the whole file asynchronously using one command.

Parameters

data

image data.

offset

the offset, from which the chunk will be sent.

image

the image number, default is 0. Use 0 for core0, 1 for core1, etc.

callback

the asynchronous callback.

See also


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

Send a packet of given data from the specified offset to the device (synchronous).

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 imageUpload to send the whole file asynchronously using one command.

Return

The upload response.

Parameters

data

image data.

offset

the offset, from which the chunk will be sent.

See also


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

Send a packet of given data from the specified offset to the given core (image) on the device (synchronous).

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 imageUpload to send the whole file asynchronously using one command.

Return

The upload response.

Parameters

data

image data.

offset

the offset, from which the chunk will be sent.

image

the image number, default is 0. Use 0 for core0, 1 for core1, etc.

See also


open fun upload(data: @NotNull Array<Byte>, @NotNull callback: @NotNull ImageManager.ImageUploadCallback): Boolean

Deprecated

Use the new transfer implementation's imageUpload(...) method

Begin an image upload.

Only one upload can occur per ImageManager.

Return

True, if the upload has stared, false otherwise.

Parameters

data

the image data to upload to slot 1.

callback

the image upload callback.