FsManager

Constructors

Link copied to clipboard
constructor(@NotNull transporter: @NotNull McuMgrTransport)
Construct a McuManager instance.

Types

Link copied to clipboard
open inner class FileDownload : Download
File Download Implementation
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open inner class FileStreamUpload : StreamUpload
File Upload Implementation.
Link copied to clipboard
open inner class FileUpload : Upload
File Upload Implementation.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
val STATE_NONE: Int = 0
Link copied to clipboard
val STATE_PAUSED: Int = 3
Link copied to clipboard

Functions

Link copied to clipboard
open fun buildPacket(@NotNull scheme: @NotNull McuMgrScheme, op: Int, flags: Int, groupId: Int, sequenceNum: Int, commandId: Int, @Nullable payloadMap: @Nullable Map<String, Any>): @NotNull Array<Byte>
Build a Mcu Manager packet based on the transport scheme.
Link copied to clipboard
open fun cancelTransfer()
Cancel an undergoing file transfer.
Link copied to clipboard
Command allows closing any open file handles held by fs_mgmt upload/download requests that might have stalled or be incomplete (synchronous).
open fun closeAll(@NotNull callback: @NotNull McuMgrCallback<McuMgrResponse>)
Command allows closing any open file handles held by fs_mgmt upload/download requests that might have stalled or be incomplete (asynchronous).
Link copied to clipboard
open fun continueTransfer()
Continue a paused file transfer.
Link copied to clipboard
open fun crc32(@NotNull name: @NotNull String): McuMgrFsStatusResponse
open fun crc32(@NotNull name: @NotNull String, offset: Int, length: Int): McuMgrFsStatusResponse
Command allows to generate a checksum of an existing file at a specified path on a target device (synchronous).
open fun crc32(@NotNull name: @NotNull String, @NotNull callback: @NotNull McuMgrCallback<McuMgrFsCrc32Response>)
open fun crc32(@NotNull name: @NotNull String, offset: Int, length: Int, @NotNull callback: @NotNull McuMgrCallback<McuMgrFsCrc32Response>)
Command allows to generate a checksum of an existing file at a specified path on a target device (asynchronous).
Link copied to clipboard
@NotNull
open fun dateToString(@Nullable date: @Nullable Date, @Nullable timeZone: @Nullable TimeZone): @NotNull String
Format a Date and a TimeZone into a String which McuManager will accept.
Link copied to clipboard
@NotNull
open fun download(@NotNull name: @NotNull String, offset: Int): @NotNull McuMgrFsDownloadResponse
Read a packet of a file with given name from the specified offset from the device (synchronous).
open fun download(@NotNull name: @NotNull String, @NotNull callback: @NotNull FsManager.FileDownloadCallback)
Begin a file download.
open fun download(@NotNull name: @NotNull String, offset: Int, @NotNull callback: @NotNull McuMgrCallback<McuMgrFsDownloadResponse>)
Read a packet of a file with given name from the specified offset from the device (asynchronous).
Link copied to clipboard
@NotNull
open fun fileDownload(@NotNull name: @NotNull String, @NotNull callback: @NotNull DownloadCallback): @NotNull TransferController
@NotNull
open fun fileDownload(@NotNull name: @NotNull String, @NotNull dataOutput: @NotNull OutputStream, @NotNull callback: @NotNull StreamDownloadCallback): @NotNull TransferController
Start image upload.
Link copied to clipboard
@NotNull
open fun fileUpload(@NotNull name: @NotNull String, data: @NotNull Array<Byte>, @NotNull callback: @NotNull UploadCallback): @NotNull TransferController
@NotNull
open fun fileUpload(@NotNull name: @NotNull String, @NotNull data: @NotNull InputStream, totalBytes: Int, @NotNull callback: @NotNull UploadCallback): @NotNull TransferController
Start image upload.
Link copied to clipboard
open fun getGroupId(): Int
Get the group ID for this manager.
Link copied to clipboard
open fun getMtu(): Int
Returns the upload MTU.
Link copied to clipboard
@NotNull
open fun getScheme(): @NotNull McuMgrScheme
Get the transporter's scheme.
Link copied to clipboard
open fun getState(): Int
Get the current upload state (STATE_NONE, STATE_UPLOADING, STATE_DOWNLOADING, STATE_PAUSED).
Link copied to clipboard
@NotNull
open fun getTransporter(): @NotNull McuMgrTransport
Get the transporter.
Link copied to clipboard
open fun pauseTransfer()
Pause an in progress transfer.
Link copied to clipboard
@NotNull
open fun <T : McuMgrResponse?> send(data: @NotNull Array<Byte>, @NotNull respType: @NotNull Class<T>): @NotNull T
@NotNull
open fun <T : McuMgrResponse?> send(data: @NotNull Array<Byte>, timeout: Long, @NotNull respType: @NotNull Class<T>): @NotNull T
Send data synchronously using the transporter.
open fun <T : McuMgrResponse?> send(data: @NotNull Array<Byte>, @NotNull respType: @NotNull Class<T>, @NotNull callback: @NotNull McuMgrCallback<T>)
open fun <T : McuMgrResponse?> send(data: @NotNull Array<Byte>, timeout: Long, @NotNull respType: @NotNull Class<T>, @NotNull callback: @NotNull McuMgrCallback<T>)
Send data asynchronously using the transporter.
@NotNull
open fun <T : McuMgrResponse?> send(op: Int, commandId: Int, @Nullable payloadMap: @Nullable Map<String, Any>, @NotNull respType: @NotNull Class<T>): @NotNull T
@NotNull
open fun <T : McuMgrResponse?> send(op: Int, commandId: Int, @Nullable payloadMap: @Nullable Map<String, Any>, timeout: Long, @NotNull respType: @NotNull Class<T>): @NotNull T
@NotNull
open fun <T : McuMgrResponse?> send(op: Int, flags: Int, sequenceNum: Int, commandId: Int, @NotNull respType: @NotNull Class<T>, @Nullable payloadMap: @Nullable Map<String, Any>): @NotNull T
@NotNull
open fun <T : McuMgrResponse?> send(op: Int, flags: Int, sequenceNum: Int, commandId: Int, @Nullable payloadMap: @Nullable Map<String, Any>, timeout: Long, @NotNull respType: @NotNull Class<T>): @NotNull T
Send synchronous Mcu Manager command.
open fun <T : McuMgrResponse?> send(op: Int, commandId: Int, @Nullable payloadMap: @Nullable Map<String, Any>, @NotNull respType: @NotNull Class<T>, @NotNull callback: @NotNull McuMgrCallback<T>)
open fun <T : McuMgrResponse?> send(op: Int, commandId: Int, @Nullable payloadMap: @Nullable Map<String, Any>, timeout: Long, @NotNull respType: @NotNull Class<T>, @NotNull callback: @NotNull McuMgrCallback<T>)
open fun <T : McuMgrResponse?> send(op: Int, flags: Int, sequenceNum: Int, commandId: Int, @Nullable payloadMap: @Nullable Map<String, Any>, @NotNull respType: @NotNull Class<T>, @NotNull callback: @NotNull McuMgrCallback<T>)
open fun <T : McuMgrResponse?> send(op: Int, flags: Int, sequenceNum: Int, commandId: Int, @Nullable payloadMap: @Nullable Map<String, Any>, timeout: Long, @NotNull respType: @NotNull Class<T>, @NotNull callback: @NotNull McuMgrCallback<T>)
Send an asynchronous Mcu Manager command.
Link copied to clipboard
open fun setUploadMtu(mtu: Int): Boolean
Sets the upload MTU.
Link copied to clipboard
open fun sha256(@NotNull name: @NotNull String): McuMgrFsSha256Response
open fun sha256(@NotNull name: @NotNull String, offset: Int, length: Int): McuMgrFsSha256Response
Command allows to generate a hash of an existing file at a specified path on a target device (synchronous).
open fun sha256(@NotNull name: @NotNull String, @NotNull callback: @NotNull McuMgrCallback<McuMgrFsSha256Response>)
open fun sha256(@NotNull name: @NotNull String, offset: Int, length: Int, @NotNull callback: @NotNull McuMgrCallback<McuMgrFsSha256Response>)
Command allows to generate a hash of an existing file at a specified path on a target device (asynchronous).
Link copied to clipboard
@NotNull
open fun startDownload(@NotNull download: @NotNull Download): @NotNull TransferController
@NotNull
open fun startDownload(@NotNull download: @NotNull StreamDownload): @NotNull TransferController
Start an download.
Link copied to clipboard
@NotNull
open fun startUpload(@NotNull upload: @NotNull StreamUpload): @NotNull TransferController
@NotNull
open fun startUpload(@NotNull upload: @NotNull Upload): @NotNull TransferController
Start an upload.
Link copied to clipboard
open fun status(@NotNull name: @NotNull String): McuMgrFsStatusResponse
Command allows to retrieve status of an existing file from specified path of a target device (synchronous).
open fun status(@NotNull name: @NotNull String, @NotNull callback: @NotNull McuMgrCallback<McuMgrFsStatusResponse>)
Command allows to retrieve status of an existing file from specified path of a target device (asynchronous).
Link copied to clipboard
@Nullable
open fun stringToDate(@Nullable dateString: @Nullable String): @Nullable Date
Parse a date string returned by a McuMgr response.
Link copied to clipboard
@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).
open fun upload(@NotNull name: @NotNull String, data: @NotNull Array<Byte>, @NotNull callback: @NotNull FsManager.FileUploadCallback)
Begin a file 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).