mgmt/mcumgr/lib: RFC: Allow leaving out "rc" in successful respones and use "rc" only for SMP processing errors. #42590
Labels
area: mcumgr
Enhancement
Changes/Updates/Additions to existing features
RFC
Request For Comments: want input from the community
Is your enhancement proposal related to a problem? Please describe.
There is inconsistency on how mcumgr responds to commands regarding usage of "rc" field.
When there are simple error responses, it is quite consistent and error responses usually consist only of map containing "rc" as a key and error code (int) as value.
Successful responses are not that consistent for example:
Additional problem is that some commands may use non-0 "rc" in successful responses; shell is an example when successful response, where SMP request has been properly decoded executed and response encoded, can have "rc" error because even though SMP processing went fine the executed command returned error that is returned as "rc" - which is not correct usage!
Describe the solution you'd like
Consistency: allow to leave out "rc" if it is 0 (success), and if "rc" is only response allow to send no payload at all, header should be enough. Only SMP processing errors should trigger addition of "rc" field to response.
Describe alternatives you've considered
Leaving current state.
Additional context
TBD
The text was updated successfully, but these errors were encountered: