Skip to content

Commit 763e6a8

Browse files
committed
[nrf fromtree] mgmt: mcumgr: grp: os_mgmt: Add error code for invalid 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)
1 parent 76a46cb commit 763e6a8

File tree

2 files changed

+4
-0
lines changed
  • include/zephyr/mgmt/mcumgr/grp/os_mgmt
  • subsys/mgmt/mcumgr/grp/os_mgmt/src

2 files changed

+4
-0
lines changed

include/zephyr/mgmt/mcumgr/grp/os_mgmt/os_mgmt.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ enum os_mgmt_err_code_t {
4747

4848
/** RTC command failed */
4949
OS_MGMT_ERR_RTC_COMMAND_FAILED,
50+
51+
/** Query was recognized but there is no valid value for the response. */
52+
OS_MGMT_ERR_QUERY_RESPONSE_VALUE_NOT_VALID,
5053
};
5154

5255
/* Bitmask values used by the os info command handler. Note that the width of this variable is

subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,7 @@ static int os_mgmt_translate_error_code(uint16_t err)
10461046

10471047
case OS_MGMT_ERR_QUERY_YIELDS_NO_ANSWER:
10481048
case OS_MGMT_ERR_RTC_NOT_SET:
1049+
case OS_MGMT_ERR_QUERY_RESPONSE_VALUE_NOT_VALID:
10491050
rc = MGMT_ERR_ENOENT;
10501051
break;
10511052

0 commit comments

Comments
 (0)