Commit 5a5fd7c9 authored by Benjamin Cabé's avatar Benjamin Cabé Committed by Johan Hedberg
Browse files

doc: mcumgr: fix mixed up occurrences of :c:enum: and :c:enumerator:

While Breathe seems to not care and creates hyperlinks either way, the
proper role to mention a C enumerator is :c:enumerator:. :c:enum: is to
be used to refer to the enum itself.

Signed-off-by: default avatarBenjamin Cabé <benjamin@zephyrproject.org>
parent 62893328
Loading
Loading
Loading
Loading
+1 −2
Changes for doc/services/device_mgmt/mcumgr_callbacks.rst: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ the file should be allowed or not, note that this requires that
:kconfig:option:`CONFIG_MCUMGR_GRP_FS_FILE_ACCESS_HOOK` be enabled to receive
this callback.
Two types of errors can be returned, the ``rc`` parameter can be set to an
:c:enumerator:`mcumgr_err_t` error code and :c:enumerator:`MGMT_CB_ERROR_RC`
:c:enum:`mcumgr_err_t` error code and :c:enumerator:`MGMT_CB_ERROR_RC`
can be returned, or a group error code (introduced with version 2 of the MCUmgr
protocol) can be set by setting the ``group`` value to the group and ``rc``
value to the group error code and returning :c:enumerator:`MGMT_CB_ERROR_ERR`.
@@ -330,4 +330,3 @@ API Reference
*************

.. doxygengroup:: mcumgr_callback_api
    :inner:
+3 −3
Changes for doc/services/device_mgmt/mcumgr_handlers.rst: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -52,8 +52,8 @@ responses (which have unique error codes per group as opposed to the legacy SMP
responses that return a :c:enum:`mcumgr_err_t` - there should always be an OK error code with the
value 0 and an unknown error code with the value 1. The above example then adds an error code of
``not wanted`` with value 2. In addition, the group ID is set to be
:c:enum:`MGMT_GROUP_ID_PERUSER`, which is the start group ID for user-defined groups, note that
group IDs need to be unique so other custom groups should use different values, a central index
:c:enumerator:`MGMT_GROUP_ID_PERUSER`, which is the start group ID for user-defined groups, note
that group IDs need to be unique so other custom groups should use different values, a central index
header file (as upstream Zephyr has) can be used to distribute group IDs more easily.

Initial header <grp_name>_mgmt_callbacks.h
@@ -70,7 +70,7 @@ file would look similar to:
This sets up a single event which application (or module) code can register for to receive a
callback when the function handler is executed, which allows the flow of the handler to be
changed (i.e. to return an error instead of continuing). The event group ID is set to
:c:enum:`MGMT_EVT_GRP_USER_CUSTOM_START`, which is the start event ID for user-defined groups,
:c:enumerator:`MGMT_EVT_GRP_USER_CUSTOM_START`, which is the start event ID for user-defined groups,
note that event IDs need to be unique so other custom groups should use different values, a
central index header file (as upstream Zephyr has) can be used to distribute event IDs more
easily.
+1 −1
Changes for doc/services/device_mgmt/smp_groups/smp_group_0.rst: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -563,7 +563,7 @@ System reset request header fields:
    +--------+--------------+----------------+

Normally the command sends an empty CBOR map as data, but if a previous reset
attempt has responded with "rc" equal to :c:enum:`MGMT_ERR_EBUSY` then the
attempt has responded with "rc" equal to :c:enumerator:`MGMT_ERR_EBUSY` then the
following map may be sent to force a reset:

.. code-block:: none
+4 −4
Changes for doc/services/device_mgmt/smp_groups/smp_group_1.rst: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ where:
    |                  | using SMP version 1 or for SMP errors when using SMP version 2.         |
    +------------------+-------------------------------------------------------------------------+
    | "rsn"            | optional string that clarifies reason for an error; specifically useful |
    |                  | when ``rc`` is :c:enum:`MGMT_ERR_EUNKNOWN`.                             |
    |                  | when ``rc`` is :c:enumerator:`MGMT_ERR_EUNKNOWN`.                       |
    +------------------+-------------------------------------------------------------------------+

.. note::
@@ -407,7 +407,7 @@ where:
    |                  | using SMP version 1 or for SMP errors when using SMP version 2.         |
    +------------------+-------------------------------------------------------------------------+
    | "rsn"            | optional string that clarifies reason for an error; specifically useful |
    |                  | when ``rc`` is :c:enum:`MGMT_ERR_EUNKNOWN`.                             |
    |                  | when ``rc`` is :c:enumerator:`MGMT_ERR_EUNKNOWN`.                       |
    +------------------+-------------------------------------------------------------------------+

The "off" field is only included in responses to successfully processed requests;
@@ -509,10 +509,10 @@ where:
    |                  | using SMP version 1 or for SMP errors when using SMP version 2.         |
    +------------------+-------------------------------------------------------------------------+
    | "rsn"            | optional string that clarifies reason for an error; specifically useful |
    |                  | when ``rc`` is :c:enum:`MGMT_ERR_EUNKNOWN`.                             |
    |                  | when ``rc`` is :c:enumerator:`MGMT_ERR_EUNKNOWN`.                       |
    +------------------+-------------------------------------------------------------------------+

.. note::
    Response from Zephyr running device may have "rc" value of
    :c:enum:`MGMT_ERR_EBADSTATE`, which means that the secondary
    :c:enumerator:`MGMT_ERR_EBADSTATE`, which means that the secondary
    image has been marked for next boot already and may not be erased.
+2 −2
Changes for doc/services/device_mgmt/smp_groups/smp_group_3.rst: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -542,5 +542,5 @@ There is a settings access MCUmgr callback available (see :ref:`mcumgr_callbacks
callbacks) which allows for applications/modules to know when settings management commands are
used and, optionally, block access (for example through the use of a security mechanism). This
callback can be enabled with :kconfig:option:`CONFIG_MCUMGR_GRP_SETTINGS_ACCESS_HOOK`, registered
with the event :c:enum:`MGMT_EVT_OP_SETTINGS_MGMT_ACCESS`, whereby the supplied callback data is
:c:struct:`settings_mgmt_access`.
with the event :c:enumerator:`MGMT_EVT_OP_SETTINGS_MGMT_ACCESS`, whereby the supplied callback data
is :c:struct:`settings_mgmt_access`.
Loading