DefaultManager

Default command group manager.

Constructors

Link copied to clipboard
constructor(@NotNull transport: @NotNull McuMgrTransport)
Construct an default manager.

Types

Link copied to clipboard
annotation class BootMode
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
On supported devices this mode reboots the device into a bootloader or firmware loader mode.
Link copied to clipboard
This mode (default) reboots the device to the application.
Link copied to clipboard
For bootloader with name "MCUboot" returns the bootloader mode.
Link copied to clipboard
For bootloader with name "MCUboot" returns the id of a b0 slot with higher version.
Link copied to clipboard
When used as query in bootloaderInfo command, returns string representing bootloader name.

Functions

Link copied to clipboard
@NotNull
open fun appInfo(@Nullable format: @Nullable String): @NotNull McuMgrAppInfoResponse
Reads OS/Application Info (synchronous).
open fun appInfo(@Nullable format: @Nullable String, @NotNull callback: @NotNull McuMgrCallback<McuMgrAppInfoResponse>)
Reads OS/Application Info (asynchronous).
Link copied to clipboard
@NotNull
open fun bootloaderInfo(@Nullable query: @Nullable String): @NotNull McuMgrBootloaderInfoResponse
Reads the Bootloader info (synchronous).
open fun bootloaderInfo(@Nullable query: @Nullable String, @NotNull callback: @NotNull McuMgrCallback<McuMgrBootloaderInfoResponse>)
Reads the Bootloader info (asynchronous).
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
@NotNull
open fun consoleEcho(echo: Boolean): @NotNull McuMgrOsResponse
open fun consoleEcho(echo: Boolean, @NotNull callback: @NotNull McuMgrCallback<McuMgrOsResponse>)
Set the console echo on the device (synchronous).
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 echo(@Nullable echo: @Nullable String): @NotNull McuMgrEchoResponse
Echo a string (synchronous).
open fun echo(@Nullable echo: @Nullable String, @NotNull callback: @NotNull McuMgrCallback<McuMgrEchoResponse>)
Echo a string (asynchronous).
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
@NotNull
open fun getTransporter(): @NotNull McuMgrTransport
Get the transporter.
Link copied to clipboard
@NotNull
open fun mpstat(): @NotNull McuMgrMpStatResponse
Get memory pool statistics from the device (synchronous).
open fun mpstat(@NotNull callback: @NotNull McuMgrCallback<McuMgrMpStatResponse>)
Get memory pool statistics from the device (asynchronous).
Link copied to clipboard
@NotNull
open fun params(): @NotNull McuMgrParamsResponse
Reads McuMgr parameters (synchronous).
open fun params(@NotNull callback: @NotNull McuMgrCallback<McuMgrParamsResponse>)
Reads McuMgr parameters (asynchronous).
Link copied to clipboard
@NotNull
open fun readDatetime(): @NotNull McuMgrReadDateTimeResponse
Read the date and time on the device (synchronous).
open fun readDatetime(@NotNull callback: @NotNull McuMgrCallback<McuMgrReadDateTimeResponse>)
Read the date and time on the device (asynchronous).
Link copied to clipboard
@NotNull
open fun reset(): @NotNull McuMgrOsResponse
@NotNull
open fun reset(bootMode: Int, force: Boolean): @NotNull McuMgrOsResponse
Reset the device (synchronous).
open fun reset(@NotNull callback: @NotNull McuMgrCallback<McuMgrOsResponse>)
open fun reset(bootMode: Int, force: Boolean, @NotNull callback: @NotNull McuMgrCallback<McuMgrOsResponse>)
Reset the device (asynchronous).
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
@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 taskstats(): @NotNull McuMgrTaskStatResponse
Get task statistics from the device (synchronous).
open fun taskstats(@NotNull callback: @NotNull McuMgrCallback<McuMgrTaskStatResponse>)
Get task statistics from the device (asynchronous).
Link copied to clipboard
@NotNull
open fun writeDatetime(@Nullable date: @Nullable Date, @Nullable timeZone: @Nullable TimeZone): @NotNull McuMgrOsResponse
Write the date and time on the device (synchronous).
open fun writeDatetime(@Nullable date: @Nullable Date, @Nullable timeZone: @Nullable TimeZone, @NotNull callback: @NotNull McuMgrCallback<McuMgrOsResponse>)
Write the date and time on the device (asynchronous).