upload

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

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 InsufficientMtuException error will be thrown. Use getMtu to get the current MTU and pass it to setUploadMtu and try again.

Use fileUpload to upload the whole file asynchronously using one command.

Parameters

name

the file name.

data

the file data.

offset

the offset, from which the chunk will be sent.

callback

the asynchronous callback.

See also


@NotNull
open fun upload(@NotNull name: @NotNull String, data: @NotNull Array<Byte>, offset: Int): @NotNull McuMgrFsUploadResponse
@NotNull
open fun upload(@NotNull name: @NotNull String, @NotNull data: @NotNull InputStream, offset: Int, totalBytes: Int): @NotNull McuMgrFsUploadResponse

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

Return

The upload response.

Parameters

name

the file name.

data

the file data.

offset

the offset, from which the chunk will be sent.

See also


open fun upload(@NotNull name: @NotNull String, data: @NotNull Array<Byte>, @NotNull callback: @NotNull FsManager.FileUploadCallback)

Deprecated

Use fileUpload instead.

Begin a file upload.

Only one upload can occur per FsManager.

Parameters

name

the file name.

data

the file data to upload.

callback

the file upload callback.