From 7f56c06ea8a1ce9be62dfc7db2a77965bb6830db Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 15 Sep 2022 14:53:37 +0100 Subject: [PATCH] doc: guides: device_mgmt: smp: fs: Add supported hash/checksum info Adds information on the supported hash/checksum mcumgr command. Signed-off-by: Jamie McCrae --- .../device_mgmt/smp_groups/smp_group_8.rst | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/doc/services/device_mgmt/smp_groups/smp_group_8.rst b/doc/services/device_mgmt/smp_groups/smp_group_8.rst index 4c099f7f84c..e7c9af10810 100644 --- a/doc/services/device_mgmt/smp_groups/smp_group_8.rst +++ b/doc/services/device_mgmt/smp_groups/smp_group_8.rst @@ -20,6 +20,8 @@ File management group defines following commands: +-------------------+-----------------------------------------------+ | ``2`` | File hash/checksum | +-------------------+-----------------------------------------------+ + | ``3`` | Supported file hash/checksum types | + +-------------------+-----------------------------------------------+ File download ************* @@ -445,3 +447,80 @@ where: +-----------------------+---------------------------------------------------+ In case when "rc" is not 0, success, the other fields will not appear. + +Supported file hash/checksum types +********************************** + +Command allows listing which hash and checksum types are available on a device. +Requires Kconfig :kconfig:option:`CONFIG_MCUMGR_GRP_FS_CHECKSUM_HASH_SUPPORTED_CMD` +to be enabled. + +Supported file hash/checksum types request +========================================== + +Supported file hash/checksum types request header: + +.. table:: + :align: center + + +--------+--------------+----------------+ + | ``OP`` | ``Group ID`` | ``Command ID`` | + +========+==============+================+ + | ``0`` | ``8`` | ``3`` | + +--------+--------------+----------------+ + +The command sends empty CBOR map as data. + +Supported file hash/checksum types response +=========================================== + +Supported file hash/checksum types response header: + +.. table:: + :align: center + + +--------+--------------+----------------+ + | ``OP`` | ``Group ID`` | ``Command ID`` | + +========+==============+================+ + | ``1`` | ``8`` | ``3`` | + +--------+--------------+----------------+ + +CBOR data of successful response: + +.. code-block:: none + + format (0 = int, 1 = byte array) + { + (str)"types" : { + (str) : { + (str)"format" : (uint) + (str)"size" : (uint) + } + ... + } + } + +In case of error the CBOR data takes form: + +.. code-block:: none + + { + (str)"rc" : (int) + } + +where: + +.. table:: + :align: center + + +-----------------------+---------------------------------------------------+ + | | name of the hash/checksum type | + | | :ref:`mcumgr_group_8_hash_checksum_types` | + +-----------------------+---------------------------------------------------+ + | "format" | format that the hash/checksum returns where 0 is | + | | for numerical and 1 is for byte array. | + +-----------------------+---------------------------------------------------+ + | "size" | size (in bytes) of output hash/checksum response. | + +-----------------------+---------------------------------------------------+ + +In case when "rc" is not 0, success, the other fields will not appear.