Default/OS Management Group¶
OS management group defines following commands:
|
Command description |
---|---|
|
Echo |
|
Console/Terminal echo control; unimplemented by Zephyr |
|
Statistics |
|
Memory pool statistics |
|
Date-time string; unimplemented by Zephyr |
|
System reset |
|
MCUMGR parameters |
|
OS/Application info |
Echo command¶
Echo command responses by sending back string that it has received.
Echo request¶
Echo request header fields:
|
|
|
---|---|---|
|
|
|
CBOR data of request:
{
(str)"d" : (str)
}
where:
“d” |
string to be replied by echo service |
Echo response¶
Echo response header fields:
|
|
|
Note |
---|---|---|---|
|
|
|
When request |
|
|
|
When request |
CBOR data of successful response:
{
(str)"r" : (str)
}
In case of error the CBOR data takes the form:
{
(str)"rc" : (int)
}
where:
“r” |
Replying echo string |
“rc” |
Status/error codes in responses only appears if non-zero (error condition). |
Task statistics command¶
The command responds with some system statistics.
Task statistics request¶
Task statistics request header fields:
|
|
|
---|---|---|
|
|
|
The command sends an empty CBOR map as data.
Task statistics response¶
Task statistics response header fields:
|
|
|
---|---|---|
|
|
|
CBOR data of successful response:
{
(str)"tasks" : {
(str)<task_name> : {
(str)"prio" : (uint)
(str)"tid" : (uint)
(str)"state" : (uint)
(str)"stkuse" : (uint)
(str)"stksiz" : (uint)
(str)"cswcnt" : (uint)
(str)"runtime" : (uint)
(str)"last_checkin" : (uint)
(str)"next_checkin" : (uint)
}
...
}
}
In case of error the CBOR data takes the form:
{
(str)"rc" : (int)
}
where:
<task_name> |
string identifying task |
“prio” |
task priority |
“tid” |
numeric task ID |
“state” |
numeric task state |
“stkuse” |
task’s/thread’s stack usage |
“stksiz” |
task’s/thread’s stack size |
“cswcnt” |
task’s/thread’s context switches |
“runtime” |
task’s/thread’s runtime in “ticks” |
“last_checkin” |
set to 0 by Zephyr |
“next_checkin” |
set to 0 by Zephyr |
“rc” |
Status/error codes in responses only appears if non-zero (error condition). |
Note
The unit for “stkuse” and “stksiz” is system dependent and in case of Zephyr this is number of 4 byte words.
Memory pool statistics¶
The command is used to obtain information on memory pools active in running system.
Memory pool statistic request¶
Memory pool statistics request header fields:
|
|
|
---|---|---|
|
|
|
The command sends an empty CBOR map as data.
Memory pool statistics response¶
Memory pool statistics response header fields:
|
|
|
---|---|---|
|
|
|
CBOR data of successful response:
{
(str)<pool_name> {
(str)"blksiz" : (int)
(str)"nblks" : (int)
(str)"nfree" : (int)
(str)"min' : (int)
}
...
}
In case of error the CBOR data takes the form:
{
(str)"rc" : (int)
}
where:
<pool_name> |
string representing the pool name, used as a key for dictionary with pool statistics data |
“blksiz” |
size of the memory block in the pool |
“nblks” |
number of blocks in the pool |
“nrfree” |
number of free blocks |
“min” |
lowest number of free blocks the pool reached during run-time |
“rc” |
Status/error codes in responses only appears if non-zero (error condition). |
Date-time command¶
The command allows to obtain string representing current time-date on a device or set a new time to a device. The time format used, by both set and get operations, is:
“yyyy-MM-dd’T’HH:mm:ss.SSSSSSZZZZZ”
Date-time get¶
The command allows to obtain date-time from a device.
Date-time get request¶
Date-time request header fields:
|
|
|
---|---|---|
|
|
|
The command sends an empty CBOR map as data.
Data-time get response¶
Date-time get response header fields:
|
|
|
---|---|---|
|
|
|
CBOR data of successful response:
{
(str)"datetime" : (str)
}
In case of error the CBOR data takes the form:
{
(str)"rc" : (int)
}
where:
“datetime” |
String in format yyyy-MM-dd’T’HH:mm:ss.SSSSSSZZZZZ |
“rc” |
Status/error codes in responses; only appears if non-zero (error condition). |
Date-time set¶
The command allows to set date-time to a device.
Date-time set request¶
Date-time set request header fields:
|
|
|
---|---|---|
|
|
|
CBOR data of response:
{
(str)"datetime" : (str)
}
where:
“datetime” |
String in format yyyy-MM-dd’T’HH:mm:ss.SSSSSSZZZZZ |
Data-time set response¶
Date-time set response header fields:
|
|
|
---|---|---|
|
|
|
The command sends an empty CBOR map as data if successful. In case of error the CBOR data takes the form:
{
(str)"rc" : (int)
}
where:
“rc” |
Status/error codes in responses only appears if non-zero (error condition). |
System reset¶
Performs reset of system. The device should issue response before resetting so
that the SMP client could receive information that the command has been
accepted. By default, this command is accepted in all conditions, however if
the CONFIG_MCUMGR_GRP_OS_RESET_HOOK
is enabled and an
application registers a callback, the callback will be called when this command
is issued and can be used to perform any necessary tidy operations prior to the
module rebooting, or to reject the reset request outright altogether with an
error response. For details on this functionality, see ref:`mcumgr_callbacks.
System reset request¶
System reset request header fields:
|
|
|
---|---|---|
|
|
|
Normally the command sends an empty CBOR map as data, but if previous
reset attempt has been responded with “rc” code equal 10
(busy),
then following map may be send to force the reset:
{
(opt)"force" : (int)
}
where:
“force” |
Force reset if value > 0, optional if 0. |
System reset response¶
System reset response header fields
|
|
|
---|---|---|
|
|
|
The command sends an empty CBOR map as data if successful. In case of error the CBOR data takes the form:
{
(str)"rc" : (int)
}
where:
“rc” |
Status/error codes in responses; only appears if non-zero (error condition). |
MCUMGR Parameters¶
Used to obtain parameters of mcumgr library.
MCUMGR Parameters Request¶
MCUMGR parameters request header fields:
|
|
|
---|---|---|
|
|
|
The command sends an empty CBOR map as data.
MCUMGR Parameters Response¶
MCUMGR parameters response header fields
|
|
|
---|---|---|
|
|
|
CBOR data of successful response:
{
(str)"buf_size" : (uint)
(str)"buf_count" : (uint)
}
In case of error the CBOR data takes the form:
{
(str)"rc" : (int)
}
where:
“buf_size” |
Single SMP buffer size, this includes SMP header and CBOR payload |
“buf_count” |
Number of SMP buffers supported |
“rc” |
Status/error codes in responses; only appears if non-zero (error condition). |
OS/Application Info¶
Used to obtain information on running image, similar functionality to the linux
uname command, allowing details such as kernel name, kernel version, build
date/time, processor type and application-defined details to be returned. This
functionality can be enabled with CONFIG_MCUMGR_GRP_OS_INFO
.
OS/Application Info Request¶
OS/Application info request header fields:
|
|
|
---|---|---|
|
|
|
CBOR data of request:
{
(str,opt)"format" : (str)
}
where:
“format” |
Format specifier of returned response, fields are appended in
their natural ascending index order, not the order of
characters that are received by the command. Format
specifiers: |
OS/Application Info Response¶
OS/Application info response header fields
|
|
|
---|---|---|
|
|
|
CBOR data of response:
{
(str)"output" : (str)
(opt,str)"rc" : (int)
}
where:
“output” |
Text response including requested parameters |
“rc” |
Status/error codes in responses; will not appear if 0 |