From 129576081ab33c1030301564b53d70b01f828230 Mon Sep 17 00:00:00 2001 From: Timothy Maes Date: Thu, 27 Apr 2023 22:10:54 +0200 Subject: [PATCH] Use SOFTWARE_UDPATE_IGNORED error iso UNSUPPORTED_EXCHANGE_VERSION (#26261) --- docs/ERROR_CODES.md | 1 - src/lib/core/CHIPError.cpp | 3 --- src/lib/core/CHIPError.h | 9 +-------- src/lib/core/tests/TestCHIPErrorStr.cpp | 1 - src/platform/qpg/OTAImageProcessorImpl.cpp | 3 ++- 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/docs/ERROR_CODES.md b/docs/ERROR_CODES.md index 03bf49fe4b3ccb..d4fd79ed0466c7 100644 --- a/docs/ERROR_CODES.md +++ b/docs/ERROR_CODES.md @@ -21,7 +21,6 @@ This file was **AUTOMATICALLY** generated by | 2 | 0x02 | `CHIP_ERROR_CONNECTION_ABORTED` | | 3 | 0x03 | `CHIP_ERROR_INCORRECT_STATE` | | 4 | 0x04 | `CHIP_ERROR_MESSAGE_TOO_LONG` | -| 5 | 0x05 | `CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION` | | 6 | 0x06 | `CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS` | | 7 | 0x07 | `CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER` | | 8 | 0x08 | `CHIP_ERROR_NO_CONNECTION_HANDLER` | diff --git a/src/lib/core/CHIPError.cpp b/src/lib/core/CHIPError.cpp index e6985efc890146..53f9b7260f530f 100644 --- a/src/lib/core/CHIPError.cpp +++ b/src/lib/core/CHIPError.cpp @@ -74,9 +74,6 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_MESSAGE_TOO_LONG.AsInteger(): desc = "Message too long"; break; - case CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION.AsInteger(): - desc = "Unsupported exchange version"; - break; case CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS.AsInteger(): desc = "Too many unsolicited message handlers"; break; diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index fbc6ba4e88d8c1..e91229e4b3f799 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -466,14 +466,7 @@ using CHIP_ERROR = ::chip::ChipError; */ #define CHIP_ERROR_MESSAGE_TOO_LONG CHIP_CORE_ERROR(0x04) -/** - * @def CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION - * - * @brief - * An exchange version is not supported. - * - */ -#define CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION CHIP_CORE_ERROR(0x05) +// AVAILABLE: 0x05 /** * @def CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS diff --git a/src/lib/core/tests/TestCHIPErrorStr.cpp b/src/lib/core/tests/TestCHIPErrorStr.cpp index b5fabd64afe145..bb7d368b9e63cd 100644 --- a/src/lib/core/tests/TestCHIPErrorStr.cpp +++ b/src/lib/core/tests/TestCHIPErrorStr.cpp @@ -53,7 +53,6 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_CONNECTION_ABORTED, CHIP_ERROR_INCORRECT_STATE, CHIP_ERROR_MESSAGE_TOO_LONG, - CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION, CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS, CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER, CHIP_ERROR_NO_CONNECTION_HANDLER, diff --git a/src/platform/qpg/OTAImageProcessorImpl.cpp b/src/platform/qpg/OTAImageProcessorImpl.cpp index 3a1191b930313c..dea726280dc9b1 100644 --- a/src/platform/qpg/OTAImageProcessorImpl.cpp +++ b/src/platform/qpg/OTAImageProcessorImpl.cpp @@ -94,7 +94,8 @@ CHIP_ERROR OTAImageProcessorImpl::ProcessHeader(ByteSpan & block) if (true != qvCHIP_OtaValidateImage(qvCHIP_OtaImgHeader)) { - return CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION; + // Dropping image due to invalid header + return CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_IGNORED; } }