-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc/guides/device_mgmt: SMP protocol documentation #40894
doc/guides/device_mgmt: SMP protocol documentation #40894
Conversation
@lairdjm @carlescufi FYI for preview. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding myself as reviewer
Frame is encoded in "Big Endian" (Network endianess), where field is more than | ||
one byte lone, and takes the following form: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frame is encoded in "Big Endian" (Network endianess), where field is more than | |
one byte lone, and takes the following form: | |
Frame is encoded in "Big Endian" (Network endianess) and takes the following form: |
This sentence was incomplete. I think the explanation of endianess should be longer than a single line, if required at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the sentence, with the exception of "lone" that should be "long" tried to clarify that you should not change bit order, only byte order for types longer than one byte.
``` | ||
{ | ||
(str)"argv" : [ | ||
(str)<cmd> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it correct that the cmd
in in the array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The decoding in mcumgr says so: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/mgmt/mcumgr/lib/cmd/shell_mgmt/src/shell_mgmt.c#L29-L54
@caspermeijn Thanks for starting the review. Mind that this is still draft, so depending on my further work and suggestions from reviewers it may change a lot. |
35f8eb4
to
2cbe3fe
Compare
| "rc" | :ref:`mcumgr_smp_protocol_status_codes` | | ||
+-----------------------+---------------------------------------------------+ | ||
| "rsn" | :ref:`mcumgr_smp_protocol_status_codes` | | ||
+-----------------------+---------------------------------------------------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't see the rsn
entry here https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/mgmt/mcumgr/lib/cmd/os_mgmt/src/os_mgmt.c#L48 can only see rsn in the img mgmt module https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src/img_mgmt.c#L247 - is it planned to be expanded in a future commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
(str)"rc" : (int) | ||
(str,opt)"rsn" : (str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rsn here also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
============== | ||
|
||
The command lacks formal definition except for being assigned ID. It is not really | ||
know what the request should look like or what the response should contain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*known
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
The command lacks formal definition except for being assigned ID. It is not really | ||
know what the request should look like or what the response should contain. | ||
It is also not know whether this is ``write request`` or ``read reqest`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*known
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
+===============+===============================================+ | ||
| ``0`` | write request | | ||
+---------------+-----------------------------------------------+ | ||
| ``1`` | write response | | ||
+---------------+-----------------------------------------------+ | ||
| ``2`` | read request | | ||
+---------------+-----------------------------------------------+ | ||
| ``3`` | read response | | ||
+---------------+-----------------------------------------------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong way around, read request is 0, read response is 1, write request is 2, write response is 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| ``5`` | Designated for test crashing application | | ||
| | (unused by Zephyr) | | ||
+---------------+-----------------------------------------------+ | ||
| ``6`` | Designated for run tests | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 is split image management and 7 is run https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/mgmt/mcumgr/lib/mgmt/include/mgmt/mgmt.h#L36
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| | when there is not enough memory to complete | | ||
| | response. | | ||
+---------------+-----------------------------------------------+ | ||
| ``3`` | Invalid value; a request contains invalid | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*contains an invalid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
2cbe3fe
to
4655339
Compare
9be2f9f
to
bfdf364
Compare
bfdf364
to
ff7a165
Compare
@caspermeijn @lairdjm @philips77 Somehow I can not re-request review for this PR, so I am mentioning you here to drag you back to review. |
+========+==============+================+==================================+ | ||
| ``1`` | ``0`` | ``0`` | When request ``OP`` was ``0`` | | ||
+--------+--------------+----------------+----------------------------------+ | ||
| ``3`` | ``0`` | ``0`` | When request ``OP`` was ``1`` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*was 2
(str)"tid" : (uint) | ||
(str)"state" : (uint) | ||
(str)"stkuse" : (uint) | ||
(str)"stksize" : (uint) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*stksiz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
+-----------------------+---------------------------------------------------+ | ||
| "stkuse" | task's/thread's stack usage | | ||
+-----------------------+---------------------------------------------------+ | ||
| "stksize" | task's/thread's stack size | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*stksiz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| "rc" | :ref:`mcumgr_smp_protocol_status_codes` | | ||
+-----------------------+---------------------------------------------------+ | ||
|
||
Task statistics command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth adding the 'not known' text here about the terminal/echo command also?
(str,opt)"len" : (uint) | ||
(str)"off" : (uint) | ||
(str,opt)"sha" : (str) | ||
(str,opt)"data" : (str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-querying this
|
||
Mcumgr server side re-opens a file for each subsequent request, and current | ||
specification does not provide means to identify subsequent requests as | ||
belonging to specified download session. This means that the file is not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unresolved
{ | ||
(str)"off" : (uint) | ||
(str)"data" : (str) | ||
(str)"rc" : (int)0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unresolved
************* | ||
|
||
Command allows to download contents of an existing file from specified path | ||
at a target device. The command is stateless and mcumgr does not hold file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unresolved
Statistics: group data request | ||
============================== | ||
|
||
Statistics group date request header |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unresolved
|
||
+-----------------------+---------------------------------------------------+ | ||
| "stat_list" | array of strings representing group names; this | | ||
| | array may be empty if there are not groups | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unresolved
c08f1aa
to
43540c3
Compare
@carlescufi @caspermeijn @philips77 I have changed, in entire documentation, sentences:
to
as the former was not really accurate. |
.. code-block:: none | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. code-block:: none | |
{ | |
.. code-block:: none | |
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
43540c3
to
654ebdf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how the tables are rendered. Overall, I think the text is clear and understandable. LGTM
|
||
.. note:: | ||
Response from Zephyr running device may have "rc" value of 6, bad state, | ||
(:ref:mcumgr_smp_protocol_status_codes) which means that the secondary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reference is not rendered correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
d69a538
to
eca385a
Compare
eca385a
@dleach02 @caspermeijn @gmarull @carlescufi @philips77 The review is in some strange state: I have this "comment" icons on the right-side of reviewers nicks but there are not changes requested and the request review button works only for some reviewers. |
| | an application specific management groups | | ||
+---------------+-----------------------------------------------+ | ||
|
||
The payload for above groups, except for ``64`` which is not defined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it not groups 64 and above? Would add a note here about that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
The commit adds guide that describes format of SMP reqests/responses as issued by Zephyr implementation within mcumgr. Signed-off-by: Dominik Ermel <[email protected]>
eca385a
to
e1a229a
Compare
(str)"name" : (str) | ||
(str)"fields" : { | ||
(str)<entry_name> : (uint) | ||
... | ||
} | ||
(str)"rc" : (int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was unaware of this restriction with zcbor/cddl-gen: NordicSemiconductor/zcbor#176
If the plan is to move to zcbor, should these entries show the current layout or the layout that things would go with? At present, the layout is rc before name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit adds guide that describes format of SMP reqests/responses
as issued by Zephyr implementation within mcumgr.
Signed-off-by: Dominik Ermel [email protected]