Skip to content

Commit

Permalink
[nrf fromtree] mgmt: mcumgr: grp: os_mgmt: Add error code for invalid…
Browse files Browse the repository at this point in the history
… responses

Adds a new error code that can be used to signify that a query was
valid but the response was not valid

Signed-off-by: Jamie McCrae <[email protected]>
(cherry picked from commit 5871037)
  • Loading branch information
nordicjm committed Jan 9, 2025
1 parent 1e841e3 commit 56c284a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/zephyr/mgmt/mcumgr/grp/os_mgmt/os_mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ enum os_mgmt_err_code_t {

/** RTC command failed */
OS_MGMT_ERR_RTC_COMMAND_FAILED,

/** Query was recognized but there is no valid value for the response. */
OS_MGMT_ERR_QUERY_RESPONSE_VALUE_NOT_VALID,
};

/* Bitmask values used by the os info command handler. Note that the width of this variable is
Expand Down
1 change: 1 addition & 0 deletions subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,7 @@ static int os_mgmt_translate_error_code(uint16_t err)

case OS_MGMT_ERR_QUERY_YIELDS_NO_ANSWER:
case OS_MGMT_ERR_RTC_NOT_SET:
case OS_MGMT_ERR_QUERY_RESPONSE_VALUE_NOT_VALID:
rc = MGMT_ERR_ENOENT;
break;

Expand Down

0 comments on commit 56c284a

Please sign in to comment.