1.. _mcumgr_smp_group_63:
2
3Zephyr Management Group
4#######################
5
6Zephyr management group defines the following commands:
7
8.. table::
9    :align: center
10
11    +----------------+------------------------------+
12    | ``Command ID`` | Command description          |
13    +================+==============================+
14    | ``0``          | Erase storage                |
15    +----------------+------------------------------+
16
17Erase storage command
18*********************
19
20Erase storage command allows clearing the ``storage_partition`` flash partition on a device,
21generally this is used when switching to a new application build if the application uses storage
22that should be cleared (application dependent).
23
24Erase storage request
25=====================
26
27Erase storage request header fields:
28
29.. table::
30    :align: center
31
32    +--------+--------------+----------------+
33    | ``OP`` | ``Group ID`` | ``Command ID`` |
34    +========+==============+================+
35    | ``2``  | ``63``       | ``0``          |
36    +--------+--------------+----------------+
37
38The command sends sends empty CBOR map as data.
39
40Erase storage response
41======================
42
43Read setting response header fields:
44
45.. table::
46    :align: center
47
48    +--------+--------------+----------------+
49    | ``OP`` | ``Group ID`` | ``Command ID`` |
50    +========+==============+================+
51    | ``3``  | ``63``       | ``0``          |
52    +--------+--------------+----------------+
53
54The command sends an empty CBOR map as data if successful. In case of error the CBOR data takes
55the form:
56
57.. tabs::
58
59   .. group-tab:: SMP version 2
60
61      .. code-block:: none
62
63          {
64              (str)"err" : {
65                  (str)"group"    : (uint)
66                  (str)"rc"       : (uint)
67              }
68          }
69
70   .. group-tab:: SMP version 1
71
72      .. code-block:: none
73
74          {
75              (str)"rc"       : (int)
76          }
77
78where:
79
80.. table::
81    :align: center
82
83    +------------------+-------------------------------------------------------------------------+
84    | "err" -> "group" | :c:enum:`mcumgr_group_t` group of the group-based error code. Only      |
85    |                  | appears if an error is returned when using SMP version 2.               |
86    +------------------+-------------------------------------------------------------------------+
87    | "err" -> "rc"    | contains the index of the group-based error code. Only appears if       |
88    |                  | non-zero (error condition) when using SMP version 2.                    |
89    +------------------+-------------------------------------------------------------------------+
90    | "rc"             | :c:enum:`mcumgr_err_t` only appears if non-zero (error condition) when  |
91    |                  | using SMP version 1 or for SMP errors when using SMP version 2.         |
92    +------------------+-------------------------------------------------------------------------+
93