diff --git a/src/lib/core/CHIPError.cpp b/src/lib/core/CHIPError.cpp index b942db6f52a29e..785ee0b7af07e9 100644 --- a/src/lib/core/CHIPError.cpp +++ b/src/lib/core/CHIPError.cpp @@ -62,9 +62,6 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) #if !CHIP_CONFIG_SHORT_ERROR_STR switch (err.AsInteger()) { - case CHIP_ERROR_TOO_MANY_CONNECTIONS.AsInteger(): - desc = "Too many connections"; - break; case CHIP_ERROR_SENDING_BLOCKED.AsInteger(): desc = "Sending blocked"; break; @@ -407,6 +404,15 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_INVALID_FABRIC_ID.AsInteger(): desc = "Invalid Fabric Id"; break; + case CHIP_ERROR_TOO_MANY_CONNECTIONS.AsInteger(): + desc = "Too many connections"; + break; + case CHIP_ERROR_SHUT_DOWN.AsInteger(): + desc = "The operation was cancelled because a shut down was initiated"; + break; + case CHIP_ERROR_CANCELLED.AsInteger(): + desc = "The operation has been cancelled"; + break; case CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED.AsInteger(): desc = "DRBG entropy source failed to generate entropy data"; break; @@ -620,12 +626,21 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED.AsInteger(): desc = "Duplicate message received"; break; + case CHIP_ERROR_INVALID_PUBLIC_KEY.AsInteger(): + desc = "Invalid public key"; + break; + case CHIP_ERROR_FABRIC_MISMATCH_ON_ICA.AsInteger(): + desc = "Fabric mismatch on ICA"; + break; case CHIP_ERROR_MESSAGE_COUNTER_OUT_OF_WINDOW.AsInteger(): desc = "Message id out of window"; break; case CHIP_ERROR_REBOOT_SIGNAL_RECEIVED.AsInteger(): desc = "Termination signal is received"; break; + case CHIP_ERROR_NO_SHARED_TRUSTED_ROOT.AsInteger(): + desc = "No shared trusted root"; + break; case CHIP_ERROR_IM_STATUS_CODE_RECEIVED.AsInteger(): desc = "Interaction Model Error"; break; @@ -668,12 +683,15 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB.AsInteger(): desc = "Malformed Interaction Model Data Version Filter IB"; break; - case CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE.AsInteger(): - desc = "Malformed Interaction Model Status Response Message"; + case CHIP_ERROR_NOT_FOUND.AsInteger(): + desc = "The item referenced in the function call was not found"; break; case CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE.AsInteger(): desc = "Malformed Interaction Model Timed Request Message"; break; + case CHIP_ERROR_INVALID_FILE_IDENTIFIER.AsInteger(): + desc = "The file identifier, encoded in the first few bytes of a processed file, has unexpected value"; + break; case CHIP_ERROR_BUSY.AsInteger(): desc = "The Resource is busy and cannot process the request"; break; @@ -683,6 +701,18 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_PROVIDER_LIST_EXHAUSTED.AsInteger(): desc = "The provider list has been exhausted"; break; + case CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS.AsInteger(): + desc = "Another commissioning in progress"; + break; + case CHIP_ERROR_INVALID_SCHEME_PREFIX.AsInteger(): + desc = "The scheme field contains an invalid prefix"; + break; + case CHIP_ERROR_MISSING_URI_SEPARATOR.AsInteger(): + desc = "The URI separator is missing"; + break; + case CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE.AsInteger(): + desc = "Malformed Interaction Model Status Response Message"; + break; } #endif // !CHIP_CONFIG_SHORT_ERROR_STR diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index b952609ad46ad3..732d1f60d4241d 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -1472,15 +1472,15 @@ using CHIP_ERROR = ::chip::ChipError; * @brief * The operation cancelled because a shut down was initiated */ -#define CHIP_ERROR_SHUT_DOWN CHIP_CORE_ERROR(0x73) +#define CHIP_ERROR_SHUT_DOWN CHIP_CORE_ERROR(0x73) /** - * @def CHIP_ERROR_SHUT_DOWN + * @def CHIP_ERROR_CANCELLED * * @brief * The operation has been cancelled, generally by calling a cancel/abort request. */ -#define CHIP_ERROR_CANCELLED CHIP_CORE_ERROR(0x74) +#define CHIP_ERROR_CANCELLED CHIP_CORE_ERROR(0x74) /** * @def CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED @@ -2206,7 +2206,7 @@ using CHIP_ERROR = ::chip::ChipError; #define CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB CHIP_CORE_ERROR(0xcc) /** - * @def CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE + * @def CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE * * @brief * The InvokeResponseMessage is malformed: it either does not contain @@ -2286,15 +2286,6 @@ using CHIP_ERROR = ::chip::ChipError; */ #define CHIP_ERROR_IM_MALFORMED_EVENT_REPORT_IB CHIP_CORE_ERROR(0xd5) -/* - * @def CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS - * - * @brief - * Indicates that the commissioning window on the device is already open, and another - * commissioning is in progress - */ -#define CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS CHIP_CORE_ERROR(0xd6) - /** * @def CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB * @@ -2302,7 +2293,7 @@ using CHIP_ERROR = ::chip::ChipError; * The ClusterPathIB is malformed: it either does not contain * the required elements */ -#define CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB CHIP_CORE_ERROR(0xd6) +#define CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB CHIP_CORE_ERROR(0xd6) /** * @def CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB @@ -2322,71 +2313,80 @@ using CHIP_ERROR = ::chip::ChipError; #define CHIP_ERROR_NOT_FOUND CHIP_CORE_ERROR(0xd8) /** - * @def CHIP_ERROR_INVALID_SCHEME_PREFIX + * @def CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE * * @brief - * The scheme field contains an invalid prefix + * The Attribute DataElement is malformed: it either does not contain + * the required elements */ -#define CHIP_ERROR_INVALID_SCHEME_PREFIX CHIP_CORE_ERROR(0xd6) +#define CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE CHIP_CORE_ERROR(0xd9) /** - * @def CHIP_ERROR_MISSING_URI_SEPARATOR + * @def CHIP_ERROR_INVALID_FILE_IDENTIFIER * * @brief - * The URI separator is missing + * The file identifier, encoded in the first few bytes of a processed file, + * has unexpected value. */ -#define CHIP_ERROR_MISSING_URI_SEPARATOR CHIP_CORE_ERROR(0xd7) +#define CHIP_ERROR_INVALID_FILE_IDENTIFIER CHIP_CORE_ERROR(0xda) /** - * @def CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE + * @def CHIP_ERROR_BUSY * * @brief - * The Attribute DataElement is malformed: it either does not contain - * the required elements + * The Resource is busy and cannot process the request. Trying again might work. */ -#define CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE CHIP_CORE_ERROR(0xd8) +#define CHIP_ERROR_BUSY CHIP_CORE_ERROR(0xdb) /** - * @def CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE - * - * @brief - * The Attribute DataElement is malformed: it either does not contain - * the required elements - */ -#define CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE CHIP_CORE_ERROR(0xd9) + * @def CHIP_ERROR_MAX_RETRY_EXCEEDED + * + * @brief + * The maximum retry limit has been exceeded. + */ + #define CHIP_ERROR_MAX_RETRY_EXCEEDED CHIP_CORE_ERROR(0xdc) -/** - * @def CHIP_ERROR_INVALID_FILE_IDENTIFIER + /** + * @def CHIP_ERROR_PROVIDER_LIST_EXHAUSTED + * + * @brief + * The provider list has been exhausted. + */ + #define CHIP_ERROR_PROVIDER_LIST_EXHAUSTED CHIP_CORE_ERROR(0xdd) + +/* + * @def CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS * * @brief - * The file identifier, encoded in the first few bytes of a processed file, - * has unexpected value. + * Indicates that the commissioning window on the device is already open, and another + * commissioning is in progress */ -#define CHIP_ERROR_INVALID_FILE_IDENTIFIER CHIP_CORE_ERROR(0xda) +#define CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS CHIP_CORE_ERROR(0xde) /** - * @def CHIP_ERROR_BUSY + * @def CHIP_ERROR_INVALID_SCHEME_PREFIX * * @brief - * The Resource is busy and cannot process the request. Trying again might work. + * The scheme field contains an invalid prefix */ -#define CHIP_ERROR_BUSY CHIP_CORE_ERROR(0xdb) +#define CHIP_ERROR_INVALID_SCHEME_PREFIX CHIP_CORE_ERROR(0xdf) /** - * @def CHIP_ERROR_MAX_RETRY_EXCEEDED + * @def CHIP_ERROR_MISSING_URI_SEPARATOR * * @brief - * The maximum retry limit has been exceeded. + * The URI separator is missing */ -#define CHIP_ERROR_MAX_RETRY_EXCEEDED CHIP_CORE_ERROR(0xdc) +#define CHIP_ERROR_MISSING_URI_SEPARATOR CHIP_CORE_ERROR(0xe0) /** - * @def CHIP_ERROR_PROVIDER_LIST_EXHAUSTED + * @def CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE * * @brief - * The provider list has been exhausted. + * The Attribute DataElement is malformed: it either does not contain + * the required elements */ -#define CHIP_ERROR_PROVIDER_LIST_EXHAUSTED CHIP_CORE_ERROR(0xdd) +#define CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE CHIP_CORE_ERROR(0xe1) /** * @} diff --git a/src/lib/core/tests/TestCHIPErrorStr.cpp b/src/lib/core/tests/TestCHIPErrorStr.cpp index 7a36e02f9488dc..5880f594d761aa 100644 --- a/src/lib/core/tests/TestCHIPErrorStr.cpp +++ b/src/lib/core/tests/TestCHIPErrorStr.cpp @@ -49,7 +49,6 @@ using namespace chip; // clang-format off static const CHIP_ERROR kTestElements[] = { - CHIP_ERROR_TOO_MANY_CONNECTIONS, CHIP_ERROR_SENDING_BLOCKED, CHIP_ERROR_CONNECTION_ABORTED, CHIP_ERROR_INCORRECT_STATE, @@ -59,6 +58,7 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER, CHIP_ERROR_NO_CONNECTION_HANDLER, CHIP_ERROR_TOO_MANY_PEER_NODES, + CHIP_ERROR_SENTINEL, CHIP_ERROR_NO_MEMORY, CHIP_ERROR_NO_MESSAGE_HANDLER, CHIP_ERROR_MESSAGE_INCOMPLETE, @@ -162,6 +162,9 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_NO_COMMON_PASE_CONFIGURATIONS, CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR, CHIP_ERROR_INVALID_FABRIC_ID, + CHIP_ERROR_TOO_MANY_CONNECTIONS, + CHIP_ERROR_SHUT_DOWN, + CHIP_ERROR_CANCELLED, CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED, CHIP_ERROR_TLV_TAG_NOT_FOUND, CHIP_ERROR_FABRIC_EXISTS, @@ -209,6 +212,15 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_INCONSISTENT_CONDITIONALITY, CHIP_ERROR_LOCAL_DATA_INCONSISTENT, CHIP_EVENT_ID_FOUND, + CHIP_ERROR_INTERNAL, + CHIP_ERROR_OPEN_FAILED, + CHIP_ERROR_READ_FAILED, + CHIP_ERROR_WRITE_FAILED, + CHIP_ERROR_DECODE_FAILED, + CHIP_ERROR_SESSION_KEY_SUSPENDED, + CHIP_ERROR_UNSUPPORTED_WIRELESS_REGULATORY_DOMAIN, + CHIP_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION, + CHIP_ERROR_MDNS_COLLISION, CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH, CHIP_ERROR_IM_MALFORMED_EVENT_PATH, CHIP_ERROR_IM_MALFORMED_COMMAND_PATH, @@ -217,9 +229,34 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT, CHIP_ERROR_IM_MALFORMED_STATUS_CODE, CHIP_ERROR_PEER_NODE_NOT_FOUND, + CHIP_ERROR_HSM, CHIP_ERROR_IM_STATUS_CODE_RECEIVED, + CHIP_ERROR_IM_MALFORMED_COMMAND_STATUS_IB, + CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB, + CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE, + CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE, + CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_MESSAGE, + CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE, + CHIP_ERROR_IM_MALFORMED_WRITE_RESPONSE_MESSAGE, + CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE, + CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE, + CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE, + CHIP_ERROR_IM_MALFORMED_EVENT_REPORT_IB, + CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB, + CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB, + CHIP_ERROR_NOT_FOUND, + CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE, + CHIP_ERROR_INVALID_FILE_IDENTIFIER, + CHIP_ERROR_BUSY, CHIP_ERROR_MAX_RETRY_EXCEEDED, CHIP_ERROR_PROVIDER_LIST_EXHAUSTED, + CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS, + CHIP_ERROR_INVALID_SCHEME_PREFIX, + CHIP_ERROR_MISSING_URI_SEPARATOR, + CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE, + CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE, + CHIP_ERROR_INVALID_FILE_IDENTIFIER, + CHIP_ERROR_BUSY }; // clang-format on