blob: 6ea5ff10f1b5552ee5d61a20c9eb1533e908829c [file] [log] [blame]
.. _mcumgr_smp_group_9:
Shell management
################
Shell management allows to pass commands to shell subsystem with use of SMP
protocol.
Shell management group defines following commands:
.. table::
:align: center
+-------------------+-----------------------------------------------+
| ``Command ID`` | Command description |
+===================+===============================================+
| ``0`` | Shell command line execute |
+-------------------+-----------------------------------------------+
Shell command line execute
**************************
The command allows to execute command line in a similar way to typing it into
a shell, but both a request and a response are transported with use of SMP.
Shell command line execute request
==================================
Execute command request header:
.. table::
:align: center
+--------+--------------+----------------+
| ``OP`` | ``Group ID`` | ``Command ID`` |
+========+==============+================+
| ``2`` | ``9`` | ``0`` |
+--------+--------------+----------------+
CBOR data of request:
.. code-block:: none
{
(str)"argv" : [
(str)<cmd>
(str,opt)<arg>
...
]
}
where:
.. table::
:align: center
+-----------------------+---------------------------------------------------+
| "argv" | is array consisting of strings representing |
| | command and its arguments |
+-----------------------+---------------------------------------------------+
| <cmd> | command to be executed |
+-----------------------+---------------------------------------------------+
| <arg> | optional arguments to command |
+-----------------------+---------------------------------------------------+
Shell command line execute response
===================================
Command line execute response header fields:
.. table::
:align: center
+--------+--------------+----------------+
| ``OP`` | ``Group ID`` | ``Command ID`` |
+========+==============+================+
| ``3`` | ``9`` | ``0`` |
+--------+--------------+----------------+
CBOR data of response:
.. code-block:: none
{
(str)"o" : (str)
(str)"rc" : (int)
}
where:
.. table::
:align: center
+-----------------------+---------------------------------------------------+
| "o" | command output |
+-----------------------+---------------------------------------------------+
| "rc" | either return code from shell command execution |
| | or :ref:`mcumgr_smp_protocol_status_codes` |
+-----------------------+---------------------------------------------------+