You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The byte offsets of the SMP header are displayed in an confusing way which strikes me as incorrect.
The first row of the header table "3, 2, 1, 0" should be in the opposite order "0, 1, 2, 3".
According to the description further below and the actual implementation of struct smp_hdr the first byte (#0) contains Res, Version and OP, but the table shows that as byte #3 in the first row / table header. Flags is the second byte (#1) but shown as the third (#2), etc.
The fix would be to swap the order of the first row. Also the description table could also include byte offsets for clarity.
+---------------+-------------------+---------------------+--------------------------+----------------------------------------------------+
| **Byte Offset** | **Field** | **Type** | **Bit-Field Size** | **Description** |
+===============+===================+=====================+==========================+====================================================+
| 0 | `_res1` | `uint8_t` | 3 bits | Reserved field, not currently used. |
+---------------+-------------------+---------------------+--------------------------+----------------------------------------------------+
| 0 | `nh_version` | `uint8_t` | 2 bits | Protocol version (e.g., version number). |
+---------------+-------------------+---------------------+--------------------------+----------------------------------------------------+
| 0 | `nh_op` | `uint8_t` | 3 bits | Operation code (e.g., MGMT_OP_[...]). |
+---------------+-------------------+---------------------+--------------------------+----------------------------------------------------+
| 1 | `nh_flags` | `uint8_t` | Full byte | Reserved for future flags. |
+---------------+-------------------+---------------------+--------------------------+----------------------------------------------------+
| 2 | `nh_len` | `uint16_t` | Full size | Length of the payload. |
+---------------+-------------------+---------------------+--------------------------+----------------------------------------------------+
| 4 | `nh_group` | `uint16_t` | Full size | Group ID (e.g., MGMT_GROUP_ID_[...]). |
+---------------+-------------------+---------------------+--------------------------+----------------------------------------------------+
| 6 | `nh_seq` | `uint8_t` | Full byte | Sequence number for tracking requests. |
+---------------+-------------------+---------------------+--------------------------+----------------------------------------------------+
| 7 | `nh_id` | `uint8_t` | Full byte | Message ID within the group. |
+---------------+-------------------+---------------------+--------------------------+----------------------------------------------------+
Describe the bug
The byte offsets of the SMP header are displayed in an confusing way which strikes me as incorrect.
The first row of the header table "3, 2, 1, 0" should be in the opposite order "0, 1, 2, 3".
According to the description further below and the actual implementation of struct smp_hdr the first byte (
#0
) contains Res, Version and OP, but the table shows that as byte#3
in the first row / table header. Flags is the second byte (#1
) but shown as the third (#2
), etc.The fix would be to swap the order of the first row. Also the description table could also include byte offsets for clarity.
Environment
services/device_mgmt/smp_protocol
The text was updated successfully, but these errors were encountered: