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 <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2024-12-30 08:40:01 +00:00 committed by Benjamin Cabé
parent c595e6c00a
commit 5871037426
2 changed files with 4 additions and 0 deletions

View file

@ -47,6 +47,9 @@ enum os_mgmt_err_code_t {
/** RTC command failed */ /** RTC command failed */
OS_MGMT_ERR_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 /* Bitmask values used by the os info command handler. Note that the width of this variable is

View file

@ -1053,6 +1053,7 @@ static int os_mgmt_translate_error_code(uint16_t err)
case OS_MGMT_ERR_QUERY_YIELDS_NO_ANSWER: case OS_MGMT_ERR_QUERY_YIELDS_NO_ANSWER:
case OS_MGMT_ERR_RTC_NOT_SET: case OS_MGMT_ERR_RTC_NOT_SET:
case OS_MGMT_ERR_QUERY_RESPONSE_VALUE_NOT_VALID:
rc = MGMT_ERR_ENOENT; rc = MGMT_ERR_ENOENT;
break; break;