diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index ea5ee0068646b8..306cd854bc2489 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -302,7 +302,7 @@ CHIP_ERROR CommandHandler::ProcessCommandDataIB(CommandDataIB::Parser & aCommand return AddStatus(concretePath, Protocols::InteractionModel::Status::NeedsTimedInteraction); } - err = aCommandElement.GetData(&commandDataReader); + err = aCommandElement.GetFields(&commandDataReader); if (CHIP_END_OF_TLV == err) { ChipLogDetail(DataManagement, @@ -359,7 +359,7 @@ CHIP_ERROR CommandHandler::ProcessGroupCommandDataIB(CommandDataIB::Parser & aCo ChipLogDetail(DataManagement, "Received group command for Group=%u Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, groupId, ChipLogValueMEI(clusterId), ChipLogValueMEI(commandId)); - err = aCommandElement.GetData(&commandDataReader); + err = aCommandElement.GetFields(&commandDataReader); if (CHIP_END_OF_TLV == err) { ChipLogDetail(DataManagement, @@ -488,7 +488,7 @@ CHIP_ERROR CommandHandler::PrepareCommand(const ConcreteCommandPath & aCommandPa ReturnErrorOnFailure(path.Encode(aCommandPath)); if (aStartDataStruct) { - ReturnErrorOnFailure(commandData.GetWriter()->StartContainer(TLV::ContextTag(to_underlying(CommandDataIB::Tag::kData)), + ReturnErrorOnFailure(commandData.GetWriter()->StartContainer(TLV::ContextTag(to_underlying(CommandDataIB::Tag::kFields)), TLV::kTLVType_Structure, mDataElementContainerType)); } MoveToState(State::AddingCommand); diff --git a/src/app/CommandHandler.h b/src/app/CommandHandler.h index 3c5a4c45616c11..e983e15a2feee9 100644 --- a/src/app/CommandHandler.h +++ b/src/app/CommandHandler.h @@ -319,7 +319,7 @@ class CommandHandler ReturnErrorOnFailure(PrepareCommand(path, false)); TLV::TLVWriter * writer = GetCommandDataIBTLVWriter(); VerifyOrReturnError(writer != nullptr, CHIP_ERROR_INCORRECT_STATE); - ReturnErrorOnFailure(DataModel::Encode(*writer, TLV::ContextTag(to_underlying(CommandDataIB::Tag::kData)), aData)); + ReturnErrorOnFailure(DataModel::Encode(*writer, TLV::ContextTag(to_underlying(CommandDataIB::Tag::kFields)), aData)); return FinishCommand(/* aEndDataStruct = */ false); } diff --git a/src/app/CommandSender.cpp b/src/app/CommandSender.cpp index 94f1ac28e96b40..53cb5e8b1daab4 100644 --- a/src/app/CommandSender.cpp +++ b/src/app/CommandSender.cpp @@ -274,7 +274,7 @@ CHIP_ERROR CommandSender::ProcessInvokeResponseIB(InvokeResponseIB::Parser & aIn ReturnErrorOnFailure(commandPath.GetEndpointId(&endpointId)); ReturnErrorOnFailure(commandPath.GetClusterId(&clusterId)); ReturnErrorOnFailure(commandPath.GetCommandId(&commandId)); - commandData.GetData(&commandDataReader); + commandData.GetFields(&commandDataReader); err = CHIP_NO_ERROR; hasDataResponse = true; } @@ -336,7 +336,7 @@ CHIP_ERROR CommandSender::PrepareCommand(const CommandPathParams & aCommandPathP if (aStartDataStruct) { - ReturnErrorOnFailure(invokeRequest.GetWriter()->StartContainer(TLV::ContextTag(to_underlying(CommandDataIB::Tag::kData)), + ReturnErrorOnFailure(invokeRequest.GetWriter()->StartContainer(TLV::ContextTag(to_underlying(CommandDataIB::Tag::kFields)), TLV::kTLVType_Structure, mDataElementContainerType)); } diff --git a/src/app/CommandSender.h b/src/app/CommandSender.h index 1e9985eaf8338a..4f5ab9ac0a06de 100644 --- a/src/app/CommandSender.h +++ b/src/app/CommandSender.h @@ -196,7 +196,7 @@ class CommandSender final : public Messaging::ExchangeDelegate ReturnErrorOnFailure(PrepareCommand(aCommandPath, /* aStartDataStruct = */ false)); TLV::TLVWriter * writer = GetCommandDataIBTLVWriter(); VerifyOrReturnError(writer != nullptr, CHIP_ERROR_INCORRECT_STATE); - ReturnErrorOnFailure(DataModel::Encode(*writer, TLV::ContextTag(to_underlying(CommandDataIB::Tag::kData)), aData)); + ReturnErrorOnFailure(DataModel::Encode(*writer, TLV::ContextTag(to_underlying(CommandDataIB::Tag::kFields)), aData)); return FinishCommand(aTimedInvokeTimeoutMs); } diff --git a/src/app/MessageDef/ArrayParser.cpp b/src/app/MessageDef/ArrayParser.cpp index e7356c20a6eb02..8f5980afc43e34 100644 --- a/src/app/MessageDef/ArrayParser.cpp +++ b/src/app/MessageDef/ArrayParser.cpp @@ -24,8 +24,7 @@ CHIP_ERROR ArrayParser::Init(const TLV::TLVReader & aReader) { mReader.Init(aReader); VerifyOrReturnError(TLV::kTLVType_Array == mReader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(mReader.EnterContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return mReader.EnterContainer(mOuterContainerType); } } // namespace app } // namespace chip diff --git a/src/app/MessageDef/AttributeDataIB.cpp b/src/app/MessageDef/AttributeDataIB.cpp index 072b5671ad5059..9eb0ef7d03ee71 100644 --- a/src/app/MessageDef/AttributeDataIB.cpp +++ b/src/app/MessageDef/AttributeDataIB.cpp @@ -35,7 +35,7 @@ AttributeDataIB::Parser::ParseData(TLV::TLVReader & aReader, int aDepth) const if (aDepth == 0) { - PRETTY_PRINT("\tData = "); + PRETTY_PRINT("Data = "); } else { @@ -187,7 +187,7 @@ AttributeDataIB::Parser::ParseData(TLV::TLVReader & aReader, int aDepth) const CHIP_ERROR AttributeDataIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("AttributeDataIB ="); @@ -207,8 +207,8 @@ CHIP_ERROR AttributeDataIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kDataVersion): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kDataVersion))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kDataVersion)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kDataVersion))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kDataVersion)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING @@ -221,8 +221,8 @@ CHIP_ERROR AttributeDataIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kPath): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kPath)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kPath)); { AttributePathIB::Parser path; ReturnErrorOnFailure(path.Init(reader)); @@ -234,8 +234,8 @@ CHIP_ERROR AttributeDataIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kData): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kData))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kData)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kData))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kData)); PRETTY_PRINT_INCDEPTH(); ReturnErrorOnFailure(ParseData(reader, 0)); @@ -253,20 +253,12 @@ CHIP_ERROR AttributeDataIB::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { // check for required fields: - const int RequiredFields = (1 << to_underlying(Tag::kPath)) | (1 << to_underlying(Tag::kData)); + const int requiredFields = (1 << to_underlying(Tag::kPath)) | (1 << to_underlying(Tag::kData)); - if ((TagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT; - } + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_IB; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -274,8 +266,7 @@ CHIP_ERROR AttributeDataIB::Parser::GetPath(AttributePathIB::Parser * const apPa { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kPath)), reader)); - ReturnErrorOnFailure(apPath->Init(reader)); - return CHIP_NO_ERROR; + return apPath->Init(reader); } CHIP_ERROR AttributeDataIB::Parser::GetDataVersion(chip::DataVersion * const apVersion) const diff --git a/src/app/MessageDef/AttributeDataIBs.cpp b/src/app/MessageDef/AttributeDataIBs.cpp index 53dba2d517a38b..412e5e64311b93 100644 --- a/src/app/MessageDef/AttributeDataIBs.cpp +++ b/src/app/MessageDef/AttributeDataIBs.cpp @@ -40,7 +40,7 @@ namespace app { CHIP_ERROR AttributeDataIBs::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - size_t NumDataElement = 0; + size_t numDataElement = 0; chip::TLV::TLVReader reader; PRETTY_PRINT("AttributeDataIBs ="); @@ -51,21 +51,19 @@ CHIP_ERROR AttributeDataIBs::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrExit(chip::TLV::AnonymousTag() == reader.GetTag(), err = CHIP_ERROR_INVALID_TLV_TAG); - VerifyOrExit(chip::TLV::kTLVType_Structure == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); { AttributeDataIB::Parser data; - err = data.Init(reader); - SuccessOrExit(err); + ReturnErrorOnFailure(data.Init(reader)); PRETTY_PRINT_INCDEPTH(); - err = data.CheckSchemaValidity(); - SuccessOrExit(err); + ReturnErrorOnFailure(data.CheckSchemaValidity()); PRETTY_PRINT_DECDEPTH(); } - ++NumDataElement; + ++numDataElement; } PRETTY_PRINT("],"); @@ -75,17 +73,13 @@ CHIP_ERROR AttributeDataIBs::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { // if we have at least one data element - if (NumDataElement > 0) + if (numDataElement > 0) { err = CHIP_NO_ERROR; } } - SuccessOrExit(err); - err = reader.ExitContainer(mOuterContainerType); - -exit: - - return err; + ReturnErrorOnFailure(err); + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK diff --git a/src/app/MessageDef/AttributePathIB.cpp b/src/app/MessageDef/AttributePathIB.cpp index c8fbb03e67a7a2..6750471d849a0e 100644 --- a/src/app/MessageDef/AttributePathIB.cpp +++ b/src/app/MessageDef/AttributePathIB.cpp @@ -33,7 +33,7 @@ namespace app { CHIP_ERROR AttributePathIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("AttributePathIB ="); @@ -53,8 +53,8 @@ CHIP_ERROR AttributePathIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kEnableTagCompression): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEnableTagCompression))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kEnableTagCompression)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kEnableTagCompression))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kEnableTagCompression)); #if CHIP_DETAIL_LOGGING { bool enableTagCompression; @@ -66,8 +66,8 @@ CHIP_ERROR AttributePathIB::Parser::CheckSchemaValidity() const case to_underlying(Tag::kNode): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kNode))), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kNode)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kNode))), err = CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kNode)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING @@ -80,8 +80,8 @@ CHIP_ERROR AttributePathIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kEndpoint): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEndpoint))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kEndpoint)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kEndpoint))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kEndpoint)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING { @@ -93,8 +93,8 @@ CHIP_ERROR AttributePathIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kCluster): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kCluster))), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kCluster)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kCluster))), err = CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kCluster)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING @@ -107,8 +107,8 @@ CHIP_ERROR AttributePathIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kAttribute): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kAttribute))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kAttribute)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kAttribute))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kAttribute)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING { @@ -120,8 +120,8 @@ CHIP_ERROR AttributePathIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kListIndex): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kListIndex))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kListIndex)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kListIndex))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kListIndex)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType() || TLV::kTLVType_Null == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING @@ -149,10 +149,10 @@ CHIP_ERROR AttributePathIB::Parser::CheckSchemaValidity() const // if we have exhausted this container if (CHIP_END_OF_TLV == err) { - if ((TagPresenceMask & (1 << to_underlying(Tag::kAttribute))) == 0 && - (TagPresenceMask & (1 << to_underlying(Tag::kListIndex))) != 0) + if ((tagPresenceMask & (1 << to_underlying(Tag::kAttribute))) == 0 && + (tagPresenceMask & (1 << to_underlying(Tag::kListIndex))) != 0) { - err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; } else { @@ -161,8 +161,7 @@ CHIP_ERROR AttributePathIB::Parser::CheckSchemaValidity() const } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -215,7 +214,7 @@ CHIP_ERROR AttributePathIB::Parser::GetListIndex(ConcreteDataAttributePath & aAt else { // TODO: Add ListOperation::ReplaceItem support. (Attribute path with valid list index) - err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; } } else if (CHIP_END_OF_TLV == err) diff --git a/src/app/MessageDef/AttributePathIBs.cpp b/src/app/MessageDef/AttributePathIBs.cpp index b3f824d6ca25c7..4a04dc0e47be0e 100644 --- a/src/app/MessageDef/AttributePathIBs.cpp +++ b/src/app/MessageDef/AttributePathIBs.cpp @@ -68,8 +68,7 @@ CHIP_ERROR AttributePathIBs::Parser::CheckSchemaValidity() const } } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK diff --git a/src/app/MessageDef/AttributeReportIB.cpp b/src/app/MessageDef/AttributeReportIB.cpp index 40add8b660cdea..7f4a5c5f6e8342 100644 --- a/src/app/MessageDef/AttributeReportIB.cpp +++ b/src/app/MessageDef/AttributeReportIB.cpp @@ -32,7 +32,7 @@ namespace app { CHIP_ERROR AttributeReportIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("AttributeReportIB ="); @@ -52,8 +52,8 @@ CHIP_ERROR AttributeReportIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kAttributeStatus): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kAttributeStatus))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kAttributeStatus)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kAttributeStatus))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kAttributeStatus)); { AttributeStatusIB::Parser attributeStatus; ReturnErrorOnFailure(attributeStatus.Init(reader)); @@ -65,8 +65,8 @@ CHIP_ERROR AttributeReportIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kAttributeData): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kAttributeData))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kAttributeData)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kAttributeData))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kAttributeData)); { AttributeDataIB::Parser attributeData; ReturnErrorOnFailure(attributeData.Init(reader)); @@ -91,15 +91,15 @@ CHIP_ERROR AttributeReportIB::Parser::CheckSchemaValidity() const const int CheckDataField = 1 << to_underlying(Tag::kAttributeData); const int CheckStatusField = (1 << to_underlying(Tag::kAttributeStatus)); - if ((TagPresenceMask & CheckDataField) == CheckDataField && (TagPresenceMask & CheckStatusField) == CheckStatusField) + if ((tagPresenceMask & CheckDataField) == CheckDataField && (tagPresenceMask & CheckStatusField) == CheckStatusField) { // kAttributeData and kAttributeStatus both exist - err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_MESSAGE; + err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_IB; } - else if ((TagPresenceMask & CheckDataField) != CheckDataField && (TagPresenceMask & CheckStatusField) != CheckStatusField) + else if ((tagPresenceMask & CheckDataField) != CheckDataField && (tagPresenceMask & CheckStatusField) != CheckStatusField) { // kPath and kErrorStatus not exist - err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_MESSAGE; + err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_IB; } else { @@ -108,8 +108,7 @@ CHIP_ERROR AttributeReportIB::Parser::CheckSchemaValidity() const } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -117,16 +116,14 @@ CHIP_ERROR AttributeReportIB::Parser::GetAttributeStatus(AttributeStatusIB::Pars { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kAttributeStatus)), reader)); - ReturnErrorOnFailure(apAttributeStatus->Init(reader)); - return CHIP_NO_ERROR; + return apAttributeStatus->Init(reader); } CHIP_ERROR AttributeReportIB::Parser::GetAttributeData(AttributeDataIB::Parser * const apAttributeData) const { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kAttributeData)), reader)); - ReturnErrorOnFailure(apAttributeData->Init(reader)); - return CHIP_NO_ERROR; + return apAttributeData->Init(reader); } AttributeStatusIB::Builder & AttributeReportIB::Builder::CreateAttributeStatus() diff --git a/src/app/MessageDef/AttributeReportIBs.cpp b/src/app/MessageDef/AttributeReportIBs.cpp index 2d231b8e004968..d80fbc42b6c1b4 100644 --- a/src/app/MessageDef/AttributeReportIBs.cpp +++ b/src/app/MessageDef/AttributeReportIBs.cpp @@ -65,8 +65,7 @@ CHIP_ERROR AttributeReportIBs::Parser::CheckSchemaValidity() const err = CHIP_NO_ERROR; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK diff --git a/src/app/MessageDef/AttributeStatusIB.cpp b/src/app/MessageDef/AttributeStatusIB.cpp index 9a3bf1ee980dc0..a77f514f488c90 100644 --- a/src/app/MessageDef/AttributeStatusIB.cpp +++ b/src/app/MessageDef/AttributeStatusIB.cpp @@ -31,7 +31,7 @@ namespace app { CHIP_ERROR AttributeStatusIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("AttributeStatusIB ="); @@ -51,8 +51,8 @@ CHIP_ERROR AttributeStatusIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kPath): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kPath)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kPath)); { AttributePathIB::Parser path; ReturnErrorOnFailure(path.Init(reader)); @@ -64,8 +64,8 @@ CHIP_ERROR AttributeStatusIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kErrorStatus): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kErrorStatus))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kErrorStatus)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kErrorStatus))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kErrorStatus)); { StatusIB::Parser errorStatus; ReturnErrorOnFailure(errorStatus.Init(reader)); @@ -86,17 +86,12 @@ CHIP_ERROR AttributeStatusIB::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const int RequiredFields = (1 << to_underlying(Tag::kPath)) | (1 << to_underlying(Tag::kErrorStatus)); - - if ((TagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } + const int requiredFields = (1 << to_underlying(Tag::kPath)) | (1 << to_underlying(Tag::kErrorStatus)); + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_IB; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -104,16 +99,14 @@ CHIP_ERROR AttributeStatusIB::Parser::GetPath(AttributePathIB::Parser * const ap { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kPath)), reader)); - ReturnErrorOnFailure(apPath->Init(reader)); - return CHIP_NO_ERROR; + return apPath->Init(reader); } CHIP_ERROR AttributeStatusIB::Parser::GetErrorStatus(StatusIB::Parser * const apErrorStatus) const { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kErrorStatus)), reader)); - ReturnErrorOnFailure(apErrorStatus->Init(reader)); - return CHIP_NO_ERROR; + return apErrorStatus->Init(reader); } AttributePathIB::Builder & AttributeStatusIB::Builder::CreatePath() diff --git a/src/app/MessageDef/AttributeStatusIBs.cpp b/src/app/MessageDef/AttributeStatusIBs.cpp index f9d4de4ed1b223..cb0bc14ee95558 100644 --- a/src/app/MessageDef/AttributeStatusIBs.cpp +++ b/src/app/MessageDef/AttributeStatusIBs.cpp @@ -77,21 +77,10 @@ CHIP_ERROR AttributeStatusIBs::Parser::CheckSchemaValidity() const // if we have exhausted this container if (CHIP_END_OF_TLV == err) { - // if we have at least one data element - if (NumAttributeStatus > 0) - { - err = CHIP_NO_ERROR; - } - // NOTE: temporarily disable this check, to allow test to continue - else - { - ChipLogError(DataManagement, "PROTOCOL ERROR: Empty attribute statuses"); - err = CHIP_NO_ERROR; - } + err = CHIP_NO_ERROR; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif }; // namespace app diff --git a/src/app/MessageDef/ClusterPathIB.cpp b/src/app/MessageDef/ClusterPathIB.cpp index a7105263dc5e9b..d92efbb7decce6 100644 --- a/src/app/MessageDef/ClusterPathIB.cpp +++ b/src/app/MessageDef/ClusterPathIB.cpp @@ -101,16 +101,9 @@ CHIP_ERROR ClusterPathIB::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { // check for required fields: - const int RequiredFields = (1 << to_underlying(Tag::kCluster)); + const int requiredFields = (1 << to_underlying(Tag::kCluster)); - if ((tagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB; - } + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB; } ReturnErrorOnFailure(err); diff --git a/src/app/MessageDef/CommandDataIB.cpp b/src/app/MessageDef/CommandDataIB.cpp index 5f24d1c828da2a..e0d3c6f777f8f9 100644 --- a/src/app/MessageDef/CommandDataIB.cpp +++ b/src/app/MessageDef/CommandDataIB.cpp @@ -29,13 +29,13 @@ namespace chip { namespace app { CHIP_ERROR -CommandDataIB::Parser::ParseData(TLV::TLVReader & aReader, int aDepth) const +CommandDataIB::Parser::ParseFields(TLV::TLVReader & aReader, int aDepth) const { CHIP_ERROR err = CHIP_NO_ERROR; if (aDepth == 0) { - PRETTY_PRINT("\tCommandData = "); + PRETTY_PRINT("\tCommandFields = "); } else { @@ -183,7 +183,7 @@ CommandDataIB::Parser::ParseData(TLV::TLVReader & aReader, int aDepth) const { PRETTY_PRINT_INCDEPTH(); - err = ParseData(aReader, aDepth + 1); + err = ParseFields(aReader, aDepth + 1); SuccessOrExit(err); PRETTY_PRINT_DECDEPTH(); @@ -203,7 +203,7 @@ CommandDataIB::Parser::ParseData(TLV::TLVReader & aReader, int aDepth) const CHIP_ERROR CommandDataIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("CommandDataIB ="); @@ -224,8 +224,8 @@ CHIP_ERROR CommandDataIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kPath): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kPath)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kPath)); { CommandPathIB::Parser path; ReturnErrorOnFailure(path.Init(reader)); @@ -235,11 +235,11 @@ CHIP_ERROR CommandDataIB::Parser::CheckSchemaValidity() const } break; - case to_underlying(Tag::kData): + case to_underlying(Tag::kFields): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kData))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kData)); - ReturnErrorOnFailure(ParseData(reader, 0)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kFields))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kFields)); + ReturnErrorOnFailure(ParseFields(reader, 0)); break; default: PRETTY_PRINT("Unknown tag num %" PRIu32, tagNum); @@ -252,21 +252,12 @@ CHIP_ERROR CommandDataIB::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const int RequiredFields = 1 << to_underlying(Tag::kPath); - - if ((TagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE; - } + const int requiredFields = 1 << to_underlying(Tag::kPath); + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -274,13 +265,12 @@ CHIP_ERROR CommandDataIB::Parser::GetPath(CommandPathIB::Parser * const apPath) { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kPath)), reader)); - ReturnErrorOnFailure(apPath->Init(reader)); - return CHIP_NO_ERROR; + return apPath->Init(reader); } -CHIP_ERROR CommandDataIB::Parser::GetData(TLV::TLVReader * const apReader) const +CHIP_ERROR CommandDataIB::Parser::GetFields(TLV::TLVReader * const apReader) const { - ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kData)), *apReader)); + ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kFields)), *apReader)); return CHIP_NO_ERROR; } diff --git a/src/app/MessageDef/CommandDataIB.h b/src/app/MessageDef/CommandDataIB.h index 3b1eca9f91e623..0ff0cc576fa9e0 100644 --- a/src/app/MessageDef/CommandDataIB.h +++ b/src/app/MessageDef/CommandDataIB.h @@ -35,8 +35,8 @@ namespace app { namespace CommandDataIB { enum class Tag : uint8_t { - kPath = 0, - kData = 1, + kPath = 0, + kFields = 1, }; class Parser : public StructParser @@ -71,18 +71,18 @@ class Parser : public StructParser CHIP_ERROR GetPath(CommandPathIB::Parser * const apPath) const; /** - * @brief Get a TLVReader for the Data. Next() must be called before accessing them. + * @brief Get a TLVReader for the Fields. Next() must be called before accessing them. * * @param [in] apReader A pointer to apReader * * @return #CHIP_NO_ERROR on success * #CHIP_END_OF_TLV if there is no such element */ - CHIP_ERROR GetData(TLV::TLVReader * const apReader) const; + CHIP_ERROR GetFields(TLV::TLVReader * const apReader) const; protected: // A recursively callable function to parse a data element and pretty-print it. - CHIP_ERROR ParseData(TLV::TLVReader & aReader, int aDepth) const; + CHIP_ERROR ParseFields(TLV::TLVReader & aReader, int aDepth) const; }; class Builder : public StructBuilder diff --git a/src/app/MessageDef/CommandPathIB.cpp b/src/app/MessageDef/CommandPathIB.cpp index f947b221083812..8d84cea05ada30 100644 --- a/src/app/MessageDef/CommandPathIB.cpp +++ b/src/app/MessageDef/CommandPathIB.cpp @@ -35,8 +35,8 @@ namespace app { CHIP_ERROR CommandPathIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; - chip::TLV::TLVReader reader; + int tagPresenceMask = 0; + TLV::TLVReader reader; PRETTY_PRINT("CommandPathIB ="); PRETTY_PRINT("{"); @@ -49,50 +49,52 @@ CHIP_ERROR CommandPathIB::Parser::CheckSchemaValidity() const { continue; } - switch (chip::TLV::TagNumFromTag(reader.GetTag())) + uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); + switch (tagNum) { - case kCsTag_EndpointId: + case to_underlying(Tag::kEndpointId): // check if this tag has appeared before - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_EndpointId)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_EndpointId); - VerifyOrExit(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kEndpointId))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kEndpointId)); + VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING { uint16_t endpointId; - reader.Get(endpointId); + ReturnErrorOnFailure(reader.Get(endpointId)); PRETTY_PRINT("\tEndpointId = 0x%x,", endpointId); } #endif // CHIP_DETAIL_LOGGING break; - case kCsTag_ClusterId: + case to_underlying(Tag::kClusterId): // check if this tag has appeared before - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_ClusterId)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_ClusterId); - VerifyOrExit(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kClusterId))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kClusterId)); + VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING { chip::ClusterId clusterId; - reader.Get(clusterId); + ReturnErrorOnFailure(reader.Get(clusterId)); PRETTY_PRINT("\tClusterId = 0x%" PRIx32 ",", clusterId); } #endif // CHIP_DETAIL_LOGGING break; - case kCsTag_CommandId: + case to_underlying(Tag::kCommandId): // check if this tag has appeared before - VerifyOrExit(!(TagPresenceMask & (1 << kCsTag_CommandId)), err = CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << kCsTag_CommandId); - VerifyOrExit(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kCommandId))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kCommandId)); + VerifyOrReturnError(chip::TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING { chip::CommandId commandId; - reader.Get(commandId); + ReturnErrorOnFailure(reader.Get(commandId)); PRETTY_PRINT("\tCommandId = 0x%x,", commandId); } #endif // CHIP_DETAIL_LOGGING break; default: - ExitNow(err = CHIP_ERROR_INVALID_TLV_TAG); + PRETTY_PRINT("Unknown tag num %" PRIu32, tagNum); + break; } } PRETTY_PRINT("},"); @@ -101,39 +103,29 @@ CHIP_ERROR CommandPathIB::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { // check for required fields: - const uint16_t RequiredFields = (1 << kCsTag_CommandId) | (1 << kCsTag_ClusterId); + const uint16_t requiredFields = + (1 << to_underlying(Tag::kEndpointId)) | (1 << to_underlying(Tag::kCommandId)) | (1 << to_underlying(Tag::kClusterId)); - if ((TagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_COMMAND_PATH; - } + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_COMMAND_PATH_IB; } - SuccessOrExit(err); - err = reader.ExitContainer(mOuterContainerType); - -exit: - - return err; + ReturnErrorOnFailure(err); + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK CHIP_ERROR CommandPathIB::Parser::GetEndpointId(chip::EndpointId * const apEndpointID) const { - return GetUnsignedInteger(kCsTag_EndpointId, apEndpointID); + return GetUnsignedInteger(to_underlying(Tag::kEndpointId), apEndpointID); } CHIP_ERROR CommandPathIB::Parser::GetClusterId(chip::ClusterId * const apClusterId) const { - return GetUnsignedInteger(kCsTag_ClusterId, apClusterId); + return GetUnsignedInteger(to_underlying(Tag::kClusterId), apClusterId); } CHIP_ERROR CommandPathIB::Parser::GetCommandId(chip::CommandId * const apCommandId) const { - return GetUnsignedInteger(kCsTag_CommandId, apCommandId); + return GetUnsignedInteger(to_underlying(Tag::kCommandId), apCommandId); } CommandPathIB::Builder & CommandPathIB::Builder::EndpointId(const chip::EndpointId aEndpointId) @@ -141,7 +133,7 @@ CommandPathIB::Builder & CommandPathIB::Builder::EndpointId(const chip::Endpoint // skip if error has already been set if (mError == CHIP_NO_ERROR) { - mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_EndpointId), aEndpointId); + mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kEndpointId)), aEndpointId); } return *this; } @@ -151,7 +143,7 @@ CommandPathIB::Builder & CommandPathIB::Builder::ClusterId(const chip::ClusterId // skip if error has already been set if (mError == CHIP_NO_ERROR) { - mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_ClusterId), aClusterId); + mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kClusterId)), aClusterId); } return *this; } @@ -161,7 +153,7 @@ CommandPathIB::Builder & CommandPathIB::Builder::CommandId(const chip::CommandId // skip if error has already been set if (mError == CHIP_NO_ERROR) { - mError = mpWriter->Put(chip::TLV::ContextTag(kCsTag_CommandId), aCommandId); + mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kCommandId)), aCommandId); } return *this; } diff --git a/src/app/MessageDef/CommandPathIB.h b/src/app/MessageDef/CommandPathIB.h index 35d0bad6f94451..1b823efb65e67b 100644 --- a/src/app/MessageDef/CommandPathIB.h +++ b/src/app/MessageDef/CommandPathIB.h @@ -33,11 +33,11 @@ namespace chip { namespace app { namespace CommandPathIB { -enum +enum class Tag : uint8_t { - kCsTag_EndpointId = 0, - kCsTag_ClusterId = 1, - kCsTag_CommandId = 2, + kEndpointId = 0, + kClusterId = 1, + kCommandId = 2, }; class Parser : public ListParser diff --git a/src/app/MessageDef/CommandStatusIB.cpp b/src/app/MessageDef/CommandStatusIB.cpp index 8be31797735ef6..4bdda7a95ef94e 100644 --- a/src/app/MessageDef/CommandStatusIB.cpp +++ b/src/app/MessageDef/CommandStatusIB.cpp @@ -31,7 +31,7 @@ namespace app { CHIP_ERROR CommandStatusIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("CommandStatusIB ="); @@ -51,8 +51,8 @@ CHIP_ERROR CommandStatusIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kPath): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kPath)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kPath)); { CommandPathIB::Parser path; ReturnErrorOnFailure(path.Init(reader)); @@ -64,8 +64,8 @@ CHIP_ERROR CommandStatusIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kErrorStatus): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kErrorStatus))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kErrorStatus)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kErrorStatus))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kErrorStatus)); { StatusIB::Parser errorStatus; ReturnErrorOnFailure(errorStatus.Init(reader)); @@ -86,21 +86,12 @@ CHIP_ERROR CommandStatusIB::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const int RequiredFields = (1 << to_underlying(Tag::kPath)) | (1 << to_underlying(Tag::kErrorStatus)); - - if ((TagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_COMMAND_STATUS_IB; - } + const int requiredFields = (1 << to_underlying(Tag::kPath)) | (1 << to_underlying(Tag::kErrorStatus)); + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_COMMAND_STATUS_IB; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -108,16 +99,14 @@ CHIP_ERROR CommandStatusIB::Parser::GetPath(CommandPathIB::Parser * const apPath { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kPath)), reader)); - ReturnErrorOnFailure(apPath->Init(reader)); - return CHIP_NO_ERROR; + return apPath->Init(reader); } CHIP_ERROR CommandStatusIB::Parser::GetErrorStatus(StatusIB::Parser * const apErrorStatus) const { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kErrorStatus)), reader)); - ReturnErrorOnFailure(apErrorStatus->Init(reader)); - return CHIP_NO_ERROR; + return apErrorStatus->Init(reader); } CommandPathIB::Builder & CommandStatusIB::Builder::CreatePath() diff --git a/src/app/MessageDef/DataVersionFilterIB.cpp b/src/app/MessageDef/DataVersionFilterIB.cpp index c68db041297d8e..fd041467d8f953 100644 --- a/src/app/MessageDef/DataVersionFilterIB.cpp +++ b/src/app/MessageDef/DataVersionFilterIB.cpp @@ -80,6 +80,9 @@ CHIP_ERROR DataVersionFilterIB::Parser::CheckSchemaValidity() const } #endif // CHIP_DETAIL_LOGGING break; + default: + PRETTY_PRINT("Unknown tag num %" PRIu32, tagNum); + break; } } PRETTY_PRINT("},"); @@ -89,16 +92,8 @@ CHIP_ERROR DataVersionFilterIB::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { // check for required fields: - const int RequiredFields = (1 << to_underlying(Tag::kPath)) | (1 << to_underlying(Tag::kDataVersion)); - - if ((tagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB; - } + const int requiredFields = (1 << to_underlying(Tag::kPath)) | (1 << to_underlying(Tag::kDataVersion)); + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB; } ReturnErrorOnFailure(err); return reader.ExitContainer(mOuterContainerType); diff --git a/src/app/MessageDef/DataVersionFilterIBs.cpp b/src/app/MessageDef/DataVersionFilterIBs.cpp index efbc00e29e6cc8..cd1251bc420790 100644 --- a/src/app/MessageDef/DataVersionFilterIBs.cpp +++ b/src/app/MessageDef/DataVersionFilterIBs.cpp @@ -29,8 +29,7 @@ namespace app { #if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK CHIP_ERROR DataVersionFilterIBs::Parser::CheckSchemaValidity() const { - CHIP_ERROR err = CHIP_NO_ERROR; - size_t numDataVersionFilters = 0; + CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVReader reader; PRETTY_PRINT("DataVersionFilterIBs ="); @@ -49,8 +48,6 @@ CHIP_ERROR DataVersionFilterIBs::Parser::CheckSchemaValidity() const ReturnErrorOnFailure(DataVersionFilter.CheckSchemaValidity()); PRETTY_PRINT_DECDEPTH(); } - - ++numDataVersionFilters; } PRETTY_PRINT("],"); @@ -59,11 +56,7 @@ CHIP_ERROR DataVersionFilterIBs::Parser::CheckSchemaValidity() const // if we have exhausted this container if (CHIP_END_OF_TLV == err) { - // if we have at least one event filter - if (numDataVersionFilters > 0) - { - err = CHIP_NO_ERROR; - } + err = CHIP_NO_ERROR; } ReturnErrorOnFailure(err); return reader.ExitContainer(mOuterContainerType); diff --git a/src/app/MessageDef/EventDataIB.cpp b/src/app/MessageDef/EventDataIB.cpp index 5e8a076b69b4e0..3f426a2f93d8be 100644 --- a/src/app/MessageDef/EventDataIB.cpp +++ b/src/app/MessageDef/EventDataIB.cpp @@ -182,7 +182,7 @@ EventDataIB::Parser::ParseData(TLV::TLVReader & aReader, int aDepth) const CHIP_ERROR EventDataIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("EventDataIB ="); @@ -202,8 +202,8 @@ CHIP_ERROR EventDataIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kPath): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kPath)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kPath)); { EventPathIB::Parser path; ReturnErrorOnFailure(path.Init(reader)); @@ -215,8 +215,8 @@ CHIP_ERROR EventDataIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kEventNumber): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEventNumber))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kEventNumber)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kEventNumber))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kEventNumber)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING @@ -229,8 +229,8 @@ CHIP_ERROR EventDataIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kPriority): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kPriority))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kPriority)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kPriority))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kPriority)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING @@ -243,8 +243,8 @@ CHIP_ERROR EventDataIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kEpochTimestamp): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEpochTimestamp))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kEpochTimestamp)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kEpochTimestamp))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kEpochTimestamp)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); @@ -259,8 +259,8 @@ CHIP_ERROR EventDataIB::Parser::CheckSchemaValidity() const case to_underlying(Tag::kSystemTimestamp): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kSystemTimestamp))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kSystemTimestamp)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kSystemTimestamp))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kSystemTimestamp)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); @@ -274,8 +274,8 @@ CHIP_ERROR EventDataIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kDeltaEpochTimestamp): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kDeltaEpochTimestamp))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kDeltaEpochTimestamp)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kDeltaEpochTimestamp))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kDeltaEpochTimestamp)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING @@ -288,8 +288,8 @@ CHIP_ERROR EventDataIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kDeltaSystemTimestamp): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kDeltaSystemTimestamp))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kDeltaSystemTimestamp)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kDeltaSystemTimestamp))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kDeltaSystemTimestamp)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); @@ -303,8 +303,8 @@ CHIP_ERROR EventDataIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kData): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kData))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kData)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kData))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kData)); PRETTY_PRINT_INCDEPTH(); ReturnErrorOnFailure(ParseData(reader, 0)); @@ -322,21 +322,12 @@ CHIP_ERROR EventDataIB::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { // check for required fields: - const int RequiredFields = + const int requiredFields = (1 << to_underlying(Tag::kPath)) | (1 << to_underlying(Tag::kPriority)) | (1 << to_underlying(Tag::kData)); - - if ((TagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT; - } + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -387,13 +378,13 @@ CHIP_ERROR EventDataIB::Parser::ProcessEventPath(EventPathIB::Parser & aEventPat { // The ReportData must contain a concrete event path CHIP_ERROR err = aEventPath.GetEndpoint(&(aConcreteEventPath.mEndpointId)); - VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH); + VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB); err = aEventPath.GetCluster(&(aConcreteEventPath.mClusterId)); - VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH); + VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB); err = aEventPath.GetEvent(&(aConcreteEventPath.mEventId)); - VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH); + VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB); return CHIP_NO_ERROR; } @@ -414,7 +405,7 @@ CHIP_ERROR EventDataIB::Parser::ProcessEventTimestamp(EventHeader & aEventHeader } else if (err == CHIP_NO_ERROR) { - VerifyOrReturnError(aEventHeader.mTimestamp.IsSystem(), CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT); + VerifyOrReturnError(aEventHeader.mTimestamp.IsSystem(), CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB); aEventHeader.mTimestamp.mValue += timeStampVal; hasDeltaSystemTimestamp = true; } @@ -427,7 +418,7 @@ CHIP_ERROR EventDataIB::Parser::ProcessEventTimestamp(EventHeader & aEventHeader } else if (err == CHIP_NO_ERROR) { - VerifyOrReturnError(aEventHeader.mTimestamp.IsEpoch(), CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT); + VerifyOrReturnError(aEventHeader.mTimestamp.IsEpoch(), CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB); aEventHeader.mTimestamp.mValue += timeStampVal; hasDeltaEpochTimestamp = true; } @@ -462,7 +453,7 @@ CHIP_ERROR EventDataIB::Parser::ProcessEventTimestamp(EventHeader & aEventHeader { return CHIP_NO_ERROR; } - return CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT; + return CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB; } CHIP_ERROR EventDataIB::Parser::DecodeEventHeader(EventHeader & aEventHeader) diff --git a/src/app/MessageDef/EventFilterIB.cpp b/src/app/MessageDef/EventFilterIB.cpp index 5fc1824d7a7d07..c0779e62c5aa15 100644 --- a/src/app/MessageDef/EventFilterIB.cpp +++ b/src/app/MessageDef/EventFilterIB.cpp @@ -35,7 +35,7 @@ namespace app { CHIP_ERROR EventFilterIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("EventFilterIB ="); @@ -55,8 +55,8 @@ CHIP_ERROR EventFilterIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kNode): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kNode))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kNode)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kNode))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kNode)); #if CHIP_DETAIL_LOGGING { NodeId node; @@ -67,8 +67,8 @@ CHIP_ERROR EventFilterIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kEventMin): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEventMin))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kEventMin)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kEventMin))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kEventMin)); #if CHIP_DETAIL_LOGGING { uint64_t eventMin; @@ -88,17 +88,12 @@ CHIP_ERROR EventFilterIB::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const int RequiredFields = (1 << to_underlying(Tag::kEventMin)); - - if ((TagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } + const int requiredFields = (1 << to_underlying(Tag::kEventMin)); + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_EVENT_FILTER_IB; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK diff --git a/src/app/MessageDef/EventFilterIBs.cpp b/src/app/MessageDef/EventFilterIBs.cpp index cff764eff356e9..b7cc412baa93da 100644 --- a/src/app/MessageDef/EventFilterIBs.cpp +++ b/src/app/MessageDef/EventFilterIBs.cpp @@ -29,8 +29,7 @@ namespace app { #if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK CHIP_ERROR EventFilterIBs::Parser::CheckSchemaValidity() const { - CHIP_ERROR err = CHIP_NO_ERROR; - size_t numEventFilters = 0; + CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVReader reader; PRETTY_PRINT("EventFilterIBs ="); @@ -49,8 +48,6 @@ CHIP_ERROR EventFilterIBs::Parser::CheckSchemaValidity() const ReturnErrorOnFailure(eventFilter.CheckSchemaValidity()); PRETTY_PRINT_DECDEPTH(); } - - ++numEventFilters; } PRETTY_PRINT("],"); @@ -59,15 +56,10 @@ CHIP_ERROR EventFilterIBs::Parser::CheckSchemaValidity() const // if we have exhausted this container if (CHIP_END_OF_TLV == err) { - // if we have at least one event filter - if (numEventFilters > 0) - { - err = CHIP_NO_ERROR; - } + err = CHIP_NO_ERROR; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK diff --git a/src/app/MessageDef/EventPathIB.cpp b/src/app/MessageDef/EventPathIB.cpp index 3a2e13b1d84eda..70c8ca2103e0e1 100644 --- a/src/app/MessageDef/EventPathIB.cpp +++ b/src/app/MessageDef/EventPathIB.cpp @@ -32,7 +32,7 @@ namespace app { CHIP_ERROR EventPathIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("EventPath ="); @@ -52,8 +52,8 @@ CHIP_ERROR EventPathIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kNode): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kNode))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kNode)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kNode))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kNode)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING { @@ -65,8 +65,8 @@ CHIP_ERROR EventPathIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kEndpoint): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEndpoint))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kEndpoint)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kEndpoint))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kEndpoint)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING { @@ -78,8 +78,8 @@ CHIP_ERROR EventPathIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kCluster): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kCluster))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kCluster)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kCluster))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kCluster)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING @@ -92,8 +92,8 @@ CHIP_ERROR EventPathIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kEvent): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEvent))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kEvent)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kEvent))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kEvent)); VerifyOrReturnError(TLV::kTLVType_UnsignedInteger == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING @@ -106,8 +106,8 @@ CHIP_ERROR EventPathIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kIsUrgent): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kIsUrgent))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kIsUrgent)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kIsUrgent))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kIsUrgent)); VerifyOrReturnError(TLV::kTLVType_Boolean == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); #if CHIP_DETAIL_LOGGING @@ -134,8 +134,7 @@ CHIP_ERROR EventPathIB::Parser::CheckSchemaValidity() const } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return err; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -161,9 +160,9 @@ CHIP_ERROR EventPathIB::Parser::GetEvent(EventId * const apEvent) const CHIP_ERROR EventPathIB::Parser::GetEventPath(ConcreteEventPath * const apPath) const { - VerifyOrReturnError(GetEndpoint(&(apPath->mEndpointId)) == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH); - VerifyOrReturnError(GetCluster(&(apPath->mClusterId)) == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH); - VerifyOrReturnError(GetEvent(&(apPath->mEventId)) == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH); + VerifyOrReturnError(GetEndpoint(&(apPath->mEndpointId)) == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB); + VerifyOrReturnError(GetCluster(&(apPath->mClusterId)) == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB); + VerifyOrReturnError(GetEvent(&(apPath->mEventId)) == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB); return CHIP_NO_ERROR; } diff --git a/src/app/MessageDef/EventPathIB.h b/src/app/MessageDef/EventPathIB.h index 9d6e3787de61d4..32b7948dfc6d54 100644 --- a/src/app/MessageDef/EventPathIB.h +++ b/src/app/MessageDef/EventPathIB.h @@ -124,7 +124,7 @@ class Parser : public ListParser * @param [in] apPath A pointer to the path to fill in. * * @return #CHIP_NO_ERROR on success - * #CHIP_ERROR_IM_MALFORMED_EVENT_PATH if the path from the reader is not a valid concrere event path. + * #CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB if the path from the reader is not a valid concrere event path. */ CHIP_ERROR GetEventPath(ConcreteEventPath * const apPath) const; }; diff --git a/src/app/MessageDef/EventPathIBs.cpp b/src/app/MessageDef/EventPathIBs.cpp index fc541ad4610ac6..98687f6db8b576 100644 --- a/src/app/MessageDef/EventPathIBs.cpp +++ b/src/app/MessageDef/EventPathIBs.cpp @@ -67,8 +67,7 @@ CHIP_ERROR EventPathIBs::Parser::CheckSchemaValidity() const err = CHIP_NO_ERROR; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK diff --git a/src/app/MessageDef/EventReportIB.cpp b/src/app/MessageDef/EventReportIB.cpp index b9ac47d75da332..ce59866612684a 100644 --- a/src/app/MessageDef/EventReportIB.cpp +++ b/src/app/MessageDef/EventReportIB.cpp @@ -32,7 +32,7 @@ namespace app { CHIP_ERROR EventReportIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("EventReportIB ="); @@ -52,8 +52,8 @@ CHIP_ERROR EventReportIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kEventStatus): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEventStatus))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kEventStatus)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kEventStatus))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kEventStatus)); { EventStatusIB::Parser eventStatus; ReturnErrorOnFailure(eventStatus.Init(reader)); @@ -65,8 +65,8 @@ CHIP_ERROR EventReportIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kEventData): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kEventData))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kEventData)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kEventData))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kEventData)); { EventDataIB::Parser eventData; ReturnErrorOnFailure(eventData.Init(reader)); @@ -91,12 +91,12 @@ CHIP_ERROR EventReportIB::Parser::CheckSchemaValidity() const const int CheckDataField = 1 << to_underlying(Tag::kEventData); const int CheckStatusField = (1 << to_underlying(Tag::kEventStatus)); - if ((TagPresenceMask & CheckDataField) == CheckDataField && (TagPresenceMask & CheckStatusField) == CheckStatusField) + if ((tagPresenceMask & CheckDataField) == CheckDataField && (tagPresenceMask & CheckStatusField) == CheckStatusField) { // kEventData and kEventStatus both exist err = CHIP_ERROR_IM_MALFORMED_EVENT_REPORT_IB; } - else if ((TagPresenceMask & CheckDataField) != CheckDataField && (TagPresenceMask & CheckStatusField) != CheckStatusField) + else if ((tagPresenceMask & CheckDataField) != CheckDataField && (tagPresenceMask & CheckStatusField) != CheckStatusField) { // kEventData and kErrorStatus not exist err = CHIP_ERROR_IM_MALFORMED_EVENT_REPORT_IB; @@ -108,8 +108,7 @@ CHIP_ERROR EventReportIB::Parser::CheckSchemaValidity() const } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -117,16 +116,14 @@ CHIP_ERROR EventReportIB::Parser::GetEventStatus(EventStatusIB::Parser * const a { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kEventStatus)), reader)); - ReturnErrorOnFailure(apEventStatus->Init(reader)); - return CHIP_NO_ERROR; + return apEventStatus->Init(reader); } CHIP_ERROR EventReportIB::Parser::GetEventData(EventDataIB::Parser * const apEventData) const { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kEventData)), reader)); - ReturnErrorOnFailure(apEventData->Init(reader)); - return CHIP_NO_ERROR; + return apEventData->Init(reader); } EventStatusIB::Builder & EventReportIB::Builder::CreateEventStatus() diff --git a/src/app/MessageDef/EventReportIBs.cpp b/src/app/MessageDef/EventReportIBs.cpp index 027af6f69476a4..f071333aa0c589 100644 --- a/src/app/MessageDef/EventReportIBs.cpp +++ b/src/app/MessageDef/EventReportIBs.cpp @@ -65,8 +65,7 @@ CHIP_ERROR EventReportIBs::Parser::CheckSchemaValidity() const err = CHIP_NO_ERROR; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK diff --git a/src/app/MessageDef/EventStatusIB.cpp b/src/app/MessageDef/EventStatusIB.cpp index 84188a16370f9d..5b831ac4fe7094 100644 --- a/src/app/MessageDef/EventStatusIB.cpp +++ b/src/app/MessageDef/EventStatusIB.cpp @@ -31,7 +31,7 @@ namespace app { CHIP_ERROR EventStatusIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("EventStatusIB ="); @@ -51,8 +51,8 @@ CHIP_ERROR EventStatusIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kPath): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kPath)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kPath))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kPath)); { EventPathIB::Parser path; ReturnErrorOnFailure(path.Init(reader)); @@ -64,8 +64,8 @@ CHIP_ERROR EventStatusIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kErrorStatus): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kErrorStatus))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kErrorStatus)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kErrorStatus))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kErrorStatus)); { StatusIB::Parser errorStatus; ReturnErrorOnFailure(errorStatus.Init(reader)); @@ -86,17 +86,12 @@ CHIP_ERROR EventStatusIB::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const int RequiredFields = (1 << to_underlying(Tag::kPath)) | (1 << to_underlying(Tag::kErrorStatus)); - - if ((TagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } + const int requiredFields = (1 << to_underlying(Tag::kPath)) | (1 << to_underlying(Tag::kErrorStatus)); + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_EVENT_STATUS_IB; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -104,16 +99,14 @@ CHIP_ERROR EventStatusIB::Parser::GetPath(EventPathIB::Parser * const apPath) co { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kPath)), reader)); - ReturnErrorOnFailure(apPath->Init(reader)); - return CHIP_NO_ERROR; + return apPath->Init(reader); } CHIP_ERROR EventStatusIB::Parser::GetErrorStatus(StatusIB::Parser * const apErrorStatus) const { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kErrorStatus)), reader)); - ReturnErrorOnFailure(apErrorStatus->Init(reader)); - return CHIP_NO_ERROR; + return apErrorStatus->Init(reader); } EventPathIB::Builder & EventStatusIB::Builder::CreatePath() diff --git a/src/app/MessageDef/InvokeRequestMessage.cpp b/src/app/MessageDef/InvokeRequestMessage.cpp index 2610a4d4e7ca5a..5df97196c6e4c3 100644 --- a/src/app/MessageDef/InvokeRequestMessage.cpp +++ b/src/app/MessageDef/InvokeRequestMessage.cpp @@ -99,22 +99,13 @@ CHIP_ERROR InvokeRequestMessage::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const int RequiredFields = (1 << to_underlying(Tag::kSuppressResponse)) | (1 << to_underlying(Tag::kTimedRequest)) | + const int requiredFields = (1 << to_underlying(Tag::kSuppressResponse)) | (1 << to_underlying(Tag::kTimedRequest)) | (1 << to_underlying(Tag::kInvokeRequests)); - - if ((tagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE; - } + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -132,8 +123,7 @@ CHIP_ERROR InvokeRequestMessage::Parser::GetInvokeRequests(InvokeRequests::Parse { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kInvokeRequests)), reader)); - ReturnErrorOnFailure(apInvokeRequests->Init(reader)); - return CHIP_NO_ERROR; + return apInvokeRequests->Init(reader); } InvokeRequestMessage::Builder & InvokeRequestMessage::Builder::SuppressResponse(const bool aSuppressResponse) diff --git a/src/app/MessageDef/InvokeRequests.cpp b/src/app/MessageDef/InvokeRequests.cpp index 2e74397fecaa19..d91b3f5e0a389e 100644 --- a/src/app/MessageDef/InvokeRequests.cpp +++ b/src/app/MessageDef/InvokeRequests.cpp @@ -66,8 +66,7 @@ CHIP_ERROR InvokeRequests::Parser::CheckSchemaValidity() const } } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK diff --git a/src/app/MessageDef/InvokeResponseIB.cpp b/src/app/MessageDef/InvokeResponseIB.cpp index d28dc49ccad6e3..438bc976a8c27b 100644 --- a/src/app/MessageDef/InvokeResponseIB.cpp +++ b/src/app/MessageDef/InvokeResponseIB.cpp @@ -29,7 +29,7 @@ namespace app { CHIP_ERROR InvokeResponseIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("InvokeResponseIB ="); @@ -49,8 +49,8 @@ CHIP_ERROR InvokeResponseIB::Parser::CheckSchemaValidity() const { case to_underlying(Tag::kCommand): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kCommand))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kCommand)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kCommand))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kCommand)); { CommandDataIB::Parser command; ReturnErrorOnFailure(command.Init(reader)); @@ -62,8 +62,8 @@ CHIP_ERROR InvokeResponseIB::Parser::CheckSchemaValidity() const break; case to_underlying(Tag::kStatus): // check if this tag has appeared before - VerifyOrReturnError(!(TagPresenceMask & (1 << to_underlying(Tag::kStatus))), CHIP_ERROR_INVALID_TLV_TAG); - TagPresenceMask |= (1 << to_underlying(Tag::kStatus)); + VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kStatus))), CHIP_ERROR_INVALID_TLV_TAG); + tagPresenceMask |= (1 << to_underlying(Tag::kStatus)); { CommandStatusIB::Parser status; ReturnErrorOnFailure(status.Init(reader)); @@ -89,13 +89,13 @@ CHIP_ERROR InvokeResponseIB::Parser::CheckSchemaValidity() const const int CheckCommandField = 1 << to_underlying(Tag::kCommand); const int CheckStatusField = (1 << to_underlying(Tag::kStatus)); - if ((TagPresenceMask & CheckCommandField) == CheckCommandField && (TagPresenceMask & CheckStatusField) == CheckStatusField) + if ((tagPresenceMask & CheckCommandField) == CheckCommandField && (tagPresenceMask & CheckStatusField) == CheckStatusField) { // kPath and kErrorStatus both exist err = CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB; } - else if ((TagPresenceMask & CheckCommandField) != CheckCommandField && - (TagPresenceMask & CheckStatusField) != CheckStatusField) + else if ((tagPresenceMask & CheckCommandField) != CheckCommandField && + (tagPresenceMask & CheckStatusField) != CheckStatusField) { // kPath and kErrorStatus not exist err = CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB; @@ -106,8 +106,7 @@ CHIP_ERROR InvokeResponseIB::Parser::CheckSchemaValidity() const } } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -115,16 +114,14 @@ CHIP_ERROR InvokeResponseIB::Parser::GetCommand(CommandDataIB::Parser * const ap { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kCommand)), reader)); - ReturnErrorOnFailure(apCommand->Init(reader)); - return CHIP_NO_ERROR; + return apCommand->Init(reader); } CHIP_ERROR InvokeResponseIB::Parser::GetStatus(CommandStatusIB::Parser * const apStatus) const { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kStatus)), reader)); - ReturnErrorOnFailure(apStatus->Init(reader)); - return CHIP_NO_ERROR; + return apStatus->Init(reader); } CommandDataIB::Builder & InvokeResponseIB::Builder::CreateCommand() diff --git a/src/app/MessageDef/InvokeResponseIBs.cpp b/src/app/MessageDef/InvokeResponseIBs.cpp index 4a148b889ae500..40a2c2649c829c 100644 --- a/src/app/MessageDef/InvokeResponseIBs.cpp +++ b/src/app/MessageDef/InvokeResponseIBs.cpp @@ -59,15 +59,14 @@ CHIP_ERROR InvokeResponseIBs::Parser::CheckSchemaValidity() const // if we have exhausted this container if (CHIP_END_OF_TLV == err) { - // if we have at least one data element + // if we have at least one response if (numInvokeResponses > 0) { err = CHIP_NO_ERROR; } } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK diff --git a/src/app/MessageDef/InvokeResponseMessage.cpp b/src/app/MessageDef/InvokeResponseMessage.cpp index 80c22a960a5f91..39a18a456513a7 100644 --- a/src/app/MessageDef/InvokeResponseMessage.cpp +++ b/src/app/MessageDef/InvokeResponseMessage.cpp @@ -86,21 +86,13 @@ CHIP_ERROR InvokeResponseMessage::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const int RequiredFields = (1 << to_underlying(Tag::kSuppressResponse)) | (1 << to_underlying(Tag::kInvokeResponses)); - - if ((tagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE; - } + const int requiredFields = (1 << to_underlying(Tag::kSuppressResponse)) | (1 << to_underlying(Tag::kInvokeResponses)); + err = + (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK @@ -113,8 +105,7 @@ CHIP_ERROR InvokeResponseMessage::Parser::GetInvokeResponses(InvokeResponseIBs:: { TLV::TLVReader reader; ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kInvokeResponses)), reader)); - ReturnErrorOnFailure(apStatus->Init(reader)); - return CHIP_NO_ERROR; + return apStatus->Init(reader); } InvokeResponseMessage::Builder & InvokeResponseMessage::Builder::SuppressResponse(const bool aSuppressResponse) diff --git a/src/app/MessageDef/ListParser.cpp b/src/app/MessageDef/ListParser.cpp index fce62c3143a6d9..09ab78d2228d4c 100644 --- a/src/app/MessageDef/ListParser.cpp +++ b/src/app/MessageDef/ListParser.cpp @@ -24,8 +24,7 @@ CHIP_ERROR ListParser::Init(const TLV::TLVReader & aReader) { mReader.Init(aReader); VerifyOrReturnError(TLV::kTLVType_List == mReader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(mReader.EnterContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return mReader.EnterContainer(mOuterContainerType); } } // namespace app } // namespace chip diff --git a/src/app/MessageDef/MessageBuilder.cpp b/src/app/MessageDef/MessageBuilder.cpp index 4ea0e418bbf24e..b9ad0e58968d23 100644 --- a/src/app/MessageDef/MessageBuilder.cpp +++ b/src/app/MessageDef/MessageBuilder.cpp @@ -24,9 +24,8 @@ namespace chip { namespace app { CHIP_ERROR MessageBuilder::EncodeInteractionModelRevision() { - ReturnErrorOnFailure(mpWriter->Put(TLV::ContextTag(kInteractionModelRevisionTag), - static_cast(CHIP_DEVICE_INTERACTION_MODEL_REVISION))); - return CHIP_NO_ERROR; + return mpWriter->Put(TLV::ContextTag(kInteractionModelRevisionTag), + static_cast(CHIP_DEVICE_INTERACTION_MODEL_REVISION)); } } // namespace app } // namespace chip diff --git a/src/app/MessageDef/ReadRequestMessage.cpp b/src/app/MessageDef/ReadRequestMessage.cpp index 0f25328584e7f6..0f47a956a90ee6 100644 --- a/src/app/MessageDef/ReadRequestMessage.cpp +++ b/src/app/MessageDef/ReadRequestMessage.cpp @@ -125,16 +125,8 @@ CHIP_ERROR ReadRequestMessage::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const int RequiredFields = (1 << to_underlying(Tag::kIsFabricFiltered)); - - if ((tagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE; - } + const int requiredFields = (1 << to_underlying(Tag::kIsFabricFiltered)); + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE; } ReturnErrorOnFailure(err); diff --git a/src/app/MessageDef/StatusIB.cpp b/src/app/MessageDef/StatusIB.cpp index 7707011dfb017e..9a9ba96598c972 100644 --- a/src/app/MessageDef/StatusIB.cpp +++ b/src/app/MessageDef/StatusIB.cpp @@ -68,7 +68,7 @@ CHIP_ERROR StatusIB::Parser::DecodeStatusIB(StatusIB & aStatusIB) const CHIP_ERROR StatusIB::Parser::CheckSchemaValidity() const { CHIP_ERROR err = CHIP_NO_ERROR; - int TagPresenceMask = 0; + int tagPresenceMask = 0; TLV::TLVReader reader; PRETTY_PRINT("StatusIB ="); @@ -82,9 +82,9 @@ CHIP_ERROR StatusIB::Parser::CheckSchemaValidity() const { continue; } - if (!(TagPresenceMask & (1 << to_underlying(Tag::kStatus)))) + if (!(tagPresenceMask & (1 << to_underlying(Tag::kStatus)))) { - TagPresenceMask |= (1 << to_underlying(Tag::kStatus)); + tagPresenceMask |= (1 << to_underlying(Tag::kStatus)); #if CHIP_DETAIL_LOGGING { @@ -94,9 +94,9 @@ CHIP_ERROR StatusIB::Parser::CheckSchemaValidity() const } #endif // CHIP_DETAIL_LOGGING } - else if (!(TagPresenceMask & (1 << to_underlying(Tag::kClusterStatus)))) + else if (!(tagPresenceMask & (1 << to_underlying(Tag::kClusterStatus)))) { - TagPresenceMask |= (1 << to_underlying(Tag::kClusterStatus)); + tagPresenceMask |= (1 << to_underlying(Tag::kClusterStatus)); #if CHIP_DETAIL_LOGGING { @@ -118,20 +118,11 @@ CHIP_ERROR StatusIB::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { // check for required fields: - const int RequiredFields = (1 << to_underlying(Tag::kStatus)); - - if ((TagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_STATUS_CODE; - } + const int requiredFields = (1 << to_underlying(Tag::kStatus)); + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_STATUS_IB; } ReturnErrorOnFailure(err); - ReturnErrorOnFailure(reader.ExitContainer(mOuterContainerType)); - return CHIP_NO_ERROR; + return reader.ExitContainer(mOuterContainerType); } #endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK diff --git a/src/app/MessageDef/StatusResponseMessage.cpp b/src/app/MessageDef/StatusResponseMessage.cpp index 0b09592f015bb6..a20fc4d5faa7ce 100644 --- a/src/app/MessageDef/StatusResponseMessage.cpp +++ b/src/app/MessageDef/StatusResponseMessage.cpp @@ -40,7 +40,8 @@ CHIP_ERROR StatusResponseMessage::Parser::CheckSchemaValidity() const { continue; } - switch (TLV::TagNumFromTag(reader.GetTag())) + uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); + switch (tagNum) { case to_underlying(Tag::kStatus): VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kStatus))), CHIP_ERROR_INVALID_TLV_TAG); @@ -58,7 +59,8 @@ CHIP_ERROR StatusResponseMessage::Parser::CheckSchemaValidity() const ReturnErrorOnFailure(MessageParser::CheckInteractionModelRevision(reader)); break; default: - ReturnErrorOnFailure(CHIP_ERROR_INVALID_TLV_TAG); + PRETTY_PRINT("Unknown tag num %" PRIu32, tagNum); + break; } } PRETTY_PRINT("}"); @@ -67,15 +69,8 @@ CHIP_ERROR StatusResponseMessage::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { const int requiredFields = (1 << to_underlying(Tag::kStatus)); - - if ((tagPresenceMask & requiredFields) == requiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE; - } + err = + (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE; } ReturnErrorOnFailure(err); return reader.ExitContainer(mOuterContainerType); diff --git a/src/app/MessageDef/StructParser.cpp b/src/app/MessageDef/StructParser.cpp index b6150b677efe25..daf2156437557a 100644 --- a/src/app/MessageDef/StructParser.cpp +++ b/src/app/MessageDef/StructParser.cpp @@ -23,8 +23,7 @@ CHIP_ERROR StructParser::Init(const TLV::TLVReader & aReader) mReader.Init(aReader); VerifyOrReturnError(TLV::kTLVType_Structure == mReader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); ReturnErrorOnFailure(mReader.EnterContainer(mOuterContainerType)); - ReturnErrorOnFailure(CheckSchemaOrdering()); - return CHIP_NO_ERROR; + return CheckSchemaOrdering(); } CHIP_ERROR StructParser::CheckSchemaOrdering() const diff --git a/src/app/MessageDef/SubscribeRequestMessage.cpp b/src/app/MessageDef/SubscribeRequestMessage.cpp index a30f577a3ad61b..abc83a9661e8e1 100644 --- a/src/app/MessageDef/SubscribeRequestMessage.cpp +++ b/src/app/MessageDef/SubscribeRequestMessage.cpp @@ -131,18 +131,6 @@ CHIP_ERROR SubscribeRequestMessage::Parser::CheckSchemaValidity() const PRETTY_PRINT_DECDEPTH(); } break; - case to_underlying(Tag::kIsProxy): - VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kIsProxy))), CHIP_ERROR_INVALID_TLV_TAG); - tagPresenceMask |= (1 << to_underlying(Tag::kIsProxy)); - VerifyOrReturnError(TLV::kTLVType_Boolean == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); -#if CHIP_DETAIL_LOGGING - { - bool isProxy; - ReturnErrorOnFailure(reader.Get(isProxy)); - PRETTY_PRINT("\tIsProxy = %s, ", isProxy ? "true" : "false"); - } -#endif // CHIP_DETAIL_LOGGING - break; case to_underlying(Tag::kIsFabricFiltered): // check if this tag has appeared before VerifyOrReturnError(!(tagPresenceMask & (1 << to_underlying(Tag::kIsFabricFiltered))), CHIP_ERROR_INVALID_TLV_TAG); @@ -169,17 +157,11 @@ CHIP_ERROR SubscribeRequestMessage::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const int RequiredFields = (1 << to_underlying(Tag::kIsFabricFiltered)) | + const int requiredFields = (1 << to_underlying(Tag::kIsFabricFiltered)) | (1 << to_underlying(Tag::kKeepSubscriptions)) | (1 << to_underlying(Tag::kMinIntervalFloorSeconds)) | (1 << to_underlying(Tag::kMaxIntervalCeilingSeconds)); - if ((tagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE; - } + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR + : CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE; } ReturnErrorOnFailure(err); @@ -230,11 +212,6 @@ CHIP_ERROR SubscribeRequestMessage::Parser::GetEventFilters(EventFilterIBs::Pars return apEventFilters->Init(reader); } -CHIP_ERROR SubscribeRequestMessage::Parser::GetIsProxy(bool * const apIsProxy) const -{ - return GetSimpleValue(to_underlying(Tag::kIsProxy), TLV::kTLVType_Boolean, apIsProxy); -} - CHIP_ERROR SubscribeRequestMessage::Parser::GetIsFabricFiltered(bool * const apIsFabricFiltered) const { return GetSimpleValue(to_underlying(Tag::kIsFabricFiltered), TLV::kTLVType_Boolean, apIsFabricFiltered); @@ -306,15 +283,6 @@ EventFilterIBs::Builder & SubscribeRequestMessage::Builder::CreateEventFilters() return mEventFilters; } -SubscribeRequestMessage::Builder & SubscribeRequestMessage::Builder::IsProxy(const bool aIsProxy) -{ - if (mError == CHIP_NO_ERROR) - { - mError = mpWriter->PutBoolean(TLV::ContextTag(to_underlying(Tag::kIsProxy)), aIsProxy); - } - return *this; -} - SubscribeRequestMessage::Builder & SubscribeRequestMessage::Builder::IsFabricFiltered(const bool aIsFabricFiltered) { // skip if error has already been set diff --git a/src/app/MessageDef/SubscribeRequestMessage.h b/src/app/MessageDef/SubscribeRequestMessage.h index d70451e5677da4..25529cc3870c69 100644 --- a/src/app/MessageDef/SubscribeRequestMessage.h +++ b/src/app/MessageDef/SubscribeRequestMessage.h @@ -41,7 +41,6 @@ enum class Tag : uint8_t kAttributeRequests = 3, kEventRequests = 4, kEventFilters = 5, - kIsProxy = 6, kIsFabricFiltered = 7, kDataVersionFilters = 8, }; @@ -118,13 +117,6 @@ class Parser : public MessageParser */ CHIP_ERROR GetEventFilters(EventFilterIBs::Parser * const apEventFilters) const; - /** - * @brief Get GetIsProxy boolean . - * @return #CHIP_NO_ERROR on success - * #CHIP_END_OF_TLV if there is no such element - */ - CHIP_ERROR GetIsProxy(bool * const apIsProxy) const; - /** * @brief Get IsFabricFiltered boolean * @@ -151,13 +143,6 @@ class Builder : public MessageBuilder EventPathIBs::Builder & CreateEventRequests(); EventFilterIBs::Builder & CreateEventFilters(); - /** - * @brief This is set to true by the subscriber if it is a proxy-type device proxying for another client. This - * confers it special privileges on the publisher that might result in evictions of other non-proxy subscriptions - * to make way for the proxy. - */ - SubscribeRequestMessage::Builder & IsProxy(const bool aIsProxy); - /** * @brief limits the data written within fabric-scoped lists to the accessing fabric * @return A reference to *this diff --git a/src/app/MessageDef/SubscribeResponseMessage.cpp b/src/app/MessageDef/SubscribeResponseMessage.cpp index d857f5c13c5264..c7cc524c47865d 100644 --- a/src/app/MessageDef/SubscribeResponseMessage.cpp +++ b/src/app/MessageDef/SubscribeResponseMessage.cpp @@ -91,17 +91,10 @@ CHIP_ERROR SubscribeResponseMessage::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const uint16_t RequiredFields = (1 << to_underlying(Tag::kSubscriptionId)) | + const uint16_t requiredFields = (1 << to_underlying(Tag::kSubscriptionId)) | (1 << to_underlying(Tag::kMinIntervalFloorSeconds)) | (1 << to_underlying(Tag::kMaxIntervalCeilingSeconds)); - - if ((tagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE; - } + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR + : CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE; } ReturnErrorOnFailure(err); return reader.ExitContainer(mOuterContainerType); diff --git a/src/app/MessageDef/TimedRequestMessage.cpp b/src/app/MessageDef/TimedRequestMessage.cpp index 957cd5e4d6c905..8ee9467646b2ab 100644 --- a/src/app/MessageDef/TimedRequestMessage.cpp +++ b/src/app/MessageDef/TimedRequestMessage.cpp @@ -64,16 +64,8 @@ CHIP_ERROR TimedRequestMessage::Parser::CheckSchemaValidity() const PRETTY_PRINT(""); if (CHIP_END_OF_TLV == err) { - const int RequiredFields = (1 << to_underlying(Tag::kTimeoutMs)); - - if ((tagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE; - } + const int requiredFields = (1 << to_underlying(Tag::kTimeoutMs)); + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE; } ReturnErrorOnFailure(err); return reader.ExitContainer(mOuterContainerType); diff --git a/src/app/MessageDef/WriteRequestMessage.cpp b/src/app/MessageDef/WriteRequestMessage.cpp index b367530711d097..25f547e2570640 100644 --- a/src/app/MessageDef/WriteRequestMessage.cpp +++ b/src/app/MessageDef/WriteRequestMessage.cpp @@ -116,16 +116,8 @@ CHIP_ERROR WriteRequestMessage::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const int RequiredFields = ((1 << to_underlying(Tag::kTimedRequest)) | (1 << to_underlying(Tag::kWriteRequests))); - - if ((tagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE; - } + const int requiredFields = ((1 << to_underlying(Tag::kTimedRequest)) | (1 << to_underlying(Tag::kWriteRequests))); + err = (tagPresenceMask & requiredFields) == requiredFields ? CHIP_NO_ERROR : CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE; } ReturnErrorOnFailure(err); diff --git a/src/app/MessageDef/WriteResponseMessage.cpp b/src/app/MessageDef/WriteResponseMessage.cpp index 5beaed04e87a11..0e4c9026b60aac 100644 --- a/src/app/MessageDef/WriteResponseMessage.cpp +++ b/src/app/MessageDef/WriteResponseMessage.cpp @@ -71,16 +71,7 @@ CHIP_ERROR WriteResponseMessage::Parser::CheckSchemaValidity() const if (CHIP_END_OF_TLV == err) { - const int RequiredFields = (1 << to_underlying(Tag::kWriteResponses)); - - if ((tagPresenceMask & RequiredFields) == RequiredFields) - { - err = CHIP_NO_ERROR; - } - else - { - err = CHIP_ERROR_IM_MALFORMED_WRITE_RESPONSE_MESSAGE; - } + err = CHIP_NO_ERROR; } ReturnErrorOnFailure(err); diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index 6a0c50702b2bcd..d58e41aca2f0e0 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -291,7 +291,7 @@ CHIP_ERROR ReadClient::GenerateEventPaths(EventPathIBs::Builder & aEventPathsBui { for (auto & event : aEventPaths) { - VerifyOrReturnError(event.IsValidEventPath(), CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + VerifyOrReturnError(event.IsValidEventPath(), CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB); EventPathIB::Builder & path = aEventPathsBuilder.CreatePath(); ReturnErrorOnFailure(aEventPathsBuilder.GetError()); ReturnErrorOnFailure(path.Encode(event)); @@ -306,7 +306,7 @@ CHIP_ERROR ReadClient::GenerateAttributePaths(AttributePathIBs::Builder & aAttri { for (auto & attribute : aAttributePaths) { - VerifyOrReturnError(attribute.IsValidAttributePath(), CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + VerifyOrReturnError(attribute.IsValidAttributePath(), CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB); AttributePathIB::Builder & path = aAttributePathIBsBuilder.CreatePath(); ReturnErrorOnFailure(aAttributePathIBsBuilder.GetError()); ReturnErrorOnFailure(path.Encode(attribute)); @@ -603,13 +603,13 @@ CHIP_ERROR ReadClient::ProcessAttributePath(AttributePathIB::Parser & aAttribute CHIP_ERROR err = CHIP_NO_ERROR; // The ReportData must contain a concrete attribute path err = aAttributePathParser.GetEndpoint(&(aAttributePath.mEndpointId)); - VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB); err = aAttributePathParser.GetCluster(&(aAttributePath.mClusterId)); - VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB); err = aAttributePathParser.GetAttribute(&(aAttributePath.mAttributeId)); - VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB); err = aAttributePathParser.GetListIndex(aAttributePath); - VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB); return CHIP_NO_ERROR; } diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index ee4be7d293fa64..8b722edbcfb83f 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -530,7 +530,7 @@ CHIP_ERROR ReadHandler::ProcessEventPaths(EventPathIBs::Parser & aEventPathsPars err = path.GetEndpoint(&(event.mEndpointId)); if (err == CHIP_NO_ERROR) { - VerifyOrReturnError(!event.HasWildcardEndpointId(), err = CHIP_ERROR_IM_MALFORMED_EVENT_PATH); + VerifyOrReturnError(!event.HasWildcardEndpointId(), err = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB); } else if (err == CHIP_END_OF_TLV) { @@ -541,7 +541,7 @@ CHIP_ERROR ReadHandler::ProcessEventPaths(EventPathIBs::Parser & aEventPathsPars err = path.GetCluster(&(event.mClusterId)); if (err == CHIP_NO_ERROR) { - VerifyOrReturnError(!event.HasWildcardClusterId(), err = CHIP_ERROR_IM_MALFORMED_EVENT_PATH); + VerifyOrReturnError(!event.HasWildcardClusterId(), err = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB); } else if (err == CHIP_END_OF_TLV) { @@ -556,7 +556,7 @@ CHIP_ERROR ReadHandler::ProcessEventPaths(EventPathIBs::Parser & aEventPathsPars } else if (err == CHIP_NO_ERROR) { - VerifyOrReturnError(!event.HasWildcardEventId(), err = CHIP_ERROR_IM_MALFORMED_EVENT_PATH); + VerifyOrReturnError(!event.HasWildcardEventId(), err = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB); } ReturnErrorOnFailure(err); diff --git a/src/app/WriteClient.cpp b/src/app/WriteClient.cpp index 56969167c8ca63..dfcd160bc45172 100644 --- a/src/app/WriteClient.cpp +++ b/src/app/WriteClient.cpp @@ -85,29 +85,29 @@ CHIP_ERROR WriteClient::ProcessWriteResponseMessage(System::PacketBufferHandle & reader.Init(std::move(payload)); - err = writeResponse.Init(reader); - SuccessOrExit(err); + ReturnErrorOnFailure(writeResponse.Init(reader)); #if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK - err = writeResponse.CheckSchemaValidity(); - SuccessOrExit(err); + ReturnErrorOnFailure(writeResponse.CheckSchemaValidity()); #endif + err = writeResponse.GetWriteResponses(&attributeStatusesParser); - SuccessOrExit(err); + if (err == CHIP_END_OF_TLV) + { + return CHIP_NO_ERROR; + } + ReturnErrorOnFailure(err); attributeStatusesParser.GetReader(&attributeStatusesReader); while (CHIP_NO_ERROR == (err = attributeStatusesReader.Next())) { - VerifyOrExit(TLV::AnonymousTag() == attributeStatusesReader.GetTag(), err = CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == attributeStatusesReader.GetTag(), err = CHIP_ERROR_INVALID_TLV_TAG); AttributeStatusIB::Parser element; - err = element.Init(attributeStatusesReader); - SuccessOrExit(err); - - err = ProcessAttributeStatusIB(element); - SuccessOrExit(err); + ReturnErrorOnFailure(element.Init(attributeStatusesReader)); + ReturnErrorOnFailure(ProcessAttributeStatusIB(element)); } // if we have exhausted this container @@ -115,11 +115,8 @@ CHIP_ERROR WriteClient::ProcessWriteResponseMessage(System::PacketBufferHandle & { err = CHIP_NO_ERROR; } - SuccessOrExit(err); - ReturnErrorOnFailure(writeResponse.ExitContainer()); - -exit: - return err; + ReturnErrorOnFailure(err); + return writeResponse.ExitContainer(); } CHIP_ERROR WriteClient::PrepareAttributeIB(const ConcreteDataAttributePath & aPath) diff --git a/src/app/tests/TestCommandInteraction.cpp b/src/app/tests/TestCommandInteraction.cpp index 298896ac3d69ff..9077345d234305 100644 --- a/src/app/tests/TestCommandInteraction.cpp +++ b/src/app/tests/TestCommandInteraction.cpp @@ -258,7 +258,7 @@ void TestCommandInteraction::GenerateInvokeRequest(nlTestSuite * apSuite, void * { chip::TLV::TLVWriter * pWriter = commandDataIBBuilder.GetWriter(); chip::TLV::TLVType dummyType = chip::TLV::kTLVType_NotSpecified; - err = pWriter->StartContainer(chip::TLV::ContextTag(chip::to_underlying(CommandDataIB::Tag::kData)), + err = pWriter->StartContainer(chip::TLV::ContextTag(chip::to_underlying(CommandDataIB::Tag::kFields)), chip::TLV::kTLVType_Structure, dummyType); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -315,7 +315,7 @@ void TestCommandInteraction::GenerateInvokeResponse(nlTestSuite * apSuite, void { chip::TLV::TLVWriter * pWriter = commandDataIBBuilder.GetWriter(); chip::TLV::TLVType dummyType = chip::TLV::kTLVType_NotSpecified; - err = pWriter->StartContainer(chip::TLV::ContextTag(chip::to_underlying(CommandDataIB::Tag::kData)), + err = pWriter->StartContainer(chip::TLV::ContextTag(chip::to_underlying(CommandDataIB::Tag::kFields)), chip::TLV::kTLVType_Structure, dummyType); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -855,11 +855,11 @@ void TestCommandInteraction::TestCommandHandlerRejectMultipleCommands(nlTestSuit CommandPathIB::Builder & path = invokeRequest.CreatePath(); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == invokeRequest.GetError()); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == path.Encode(commandPathParams)); - NL_TEST_ASSERT(apSuite, - CHIP_NO_ERROR == - invokeRequest.GetWriter()->StartContainer(TLV::ContextTag(to_underlying(CommandDataIB::Tag::kData)), - TLV::kTLVType_Structure, - commandSender.mDataElementContainerType)); + NL_TEST_ASSERT( + apSuite, + CHIP_NO_ERROR == + invokeRequest.GetWriter()->StartContainer(TLV::ContextTag(to_underlying(CommandDataIB::Tag::kFields)), + TLV::kTLVType_Structure, commandSender.mDataElementContainerType)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == invokeRequest.GetWriter()->PutBoolean(chip::TLV::ContextTag(1), true)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == invokeRequest.GetWriter()->EndContainer(commandSender.mDataElementContainerType)); diff --git a/src/app/tests/TestMessageDef.cpp b/src/app/tests/TestMessageDef.cpp index 745e167e5032a7..4235e5356b4ae0 100644 --- a/src/app/tests/TestMessageDef.cpp +++ b/src/app/tests/TestMessageDef.cpp @@ -763,7 +763,7 @@ void BuildCommandDataIB(nlTestSuite * apSuite, CommandDataIB::Builder & aCommand { chip::TLV::TLVWriter * pWriter = aCommandDataIBBuilder.GetWriter(); chip::TLV::TLVType dummyType = chip::TLV::kTLVType_NotSpecified; - err = pWriter->StartContainer(chip::TLV::ContextTag(chip::to_underlying(CommandDataIB::Tag::kData)), + err = pWriter->StartContainer(chip::TLV::ContextTag(chip::to_underlying(CommandDataIB::Tag::kFields)), chip::TLV::kTLVType_Structure, dummyType); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -793,7 +793,7 @@ void ParseCommandDataIB(nlTestSuite * apSuite, CommandDataIB::Parser & aCommandD chip::TLV::TLVReader reader; bool val = false; chip::TLV::TLVType container; - aCommandDataIBParser.GetData(&reader); + aCommandDataIBParser.GetFields(&reader); err = reader.EnterContainer(container); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -1262,9 +1262,6 @@ void BuildSubscribeRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); BuildEventFilters(apSuite, eventFilters); - subscribeRequestBuilder.IsProxy(true); - NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - subscribeRequestBuilder.IsFabricFiltered(true); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); @@ -1288,7 +1285,6 @@ void ParseSubscribeRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVReader & uint16_t MinIntervalFloorSeconds = 0; uint16_t MaxIntervalCeilingSeconds = 0; bool keepExistingSubscription = false; - bool isProxy = false; bool isFabricFiltered = false; err = subscribeRequestParser.Init(aReader); @@ -1318,9 +1314,6 @@ void ParseSubscribeRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVReader & err = subscribeRequestParser.GetKeepSubscriptions(&keepExistingSubscription); NL_TEST_ASSERT(apSuite, keepExistingSubscription && err == CHIP_NO_ERROR); - err = subscribeRequestParser.GetIsProxy(&isProxy); - NL_TEST_ASSERT(apSuite, isProxy && err == CHIP_NO_ERROR); - err = subscribeRequestParser.GetIsFabricFiltered(&isFabricFiltered); NL_TEST_ASSERT(apSuite, isFabricFiltered && err == CHIP_NO_ERROR); NL_TEST_ASSERT(apSuite, subscribeRequestParser.ExitContainer() == CHIP_NO_ERROR); diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index ee10fb4e68e4c4..2d261b86db7e54 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -537,7 +537,7 @@ void TestReadInteraction::TestReadClientGenerateInvalidAttributePathList(nlTestS AttributePathIBs::Builder & attributePathListBuilder = request.CreateAttributeRequests(); err = readClient.GenerateAttributePaths(attributePathListBuilder, attributePaths); - NL_TEST_ASSERT(apSuite, err == CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + NL_TEST_ASSERT(apSuite, err == CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB); } void TestReadInteraction::TestReadClientInvalidReport(nlTestSuite * apSuite, void * apContext) @@ -564,7 +564,7 @@ void TestReadInteraction::TestReadClientInvalidReport(nlTestSuite * apSuite, voi GenerateReportData(apSuite, apContext, buf, true /*aNeedInvalidReport*/, true /* aSuppressResponse*/); err = readClient.ProcessReportData(std::move(buf)); - NL_TEST_ASSERT(apSuite, err == CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + NL_TEST_ASSERT(apSuite, err == CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB); } void TestReadInteraction::TestReadHandlerInvalidAttributePath(nlTestSuite * apSuite, void * apContext) @@ -1458,9 +1458,6 @@ void TestReadInteraction::TestProcessSubscribeRequest(nlTestSuite * apSuite, voi err = attributePathListBuilder.GetError(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - subscribeRequestBuilder.IsProxy(true); - NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - subscribeRequestBuilder.IsFabricFiltered(false).EndOfSubscribeRequestMessage(); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); diff --git a/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt b/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt index 9053c1768b7de4..2f0b429f6a3337 100644 --- a/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt +++ b/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt @@ -36,7 +36,7 @@ while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) if (argExists[currentDecodeTagId]) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB; break; } else diff --git a/src/controller/java/AndroidCallbacks.cpp b/src/controller/java/AndroidCallbacks.cpp index 424fac43ee1605..afc2670be5d794 100644 --- a/src/controller/java/AndroidCallbacks.cpp +++ b/src/controller/java/AndroidCallbacks.cpp @@ -222,7 +222,7 @@ void ReportCallback::OnAttributeData(const app::ConcreteDataAttributePath & aPat jobject value = DecodeAttributeValue(aPath, readerForJavaObject, &err); // If we don't know this attribute, just skip it. - VerifyOrReturn(err != CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + VerifyOrReturn(err != CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB); VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(attributePathObj, err)); VerifyOrReturn(!env->ExceptionCheck(), env->ExceptionDescribe(), ReportError(attributePathObj, CHIP_JNI_ERROR_EXCEPTION_THROWN)); diff --git a/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt b/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt index 81bb283e4a3183..b8bbcfddd7737f 100644 --- a/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt +++ b/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt @@ -56,14 +56,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } {{/chip_server_cluster_attributes}} default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; } {{/chip_client_clusters}} default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } return nullptr; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 2bc28e290647b7..39767ccb6bae25 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -394,7 +394,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -506,7 +506,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -663,7 +663,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -920,7 +920,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -1138,7 +1138,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -1318,7 +1318,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -1490,7 +1490,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -1893,7 +1893,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -2050,7 +2050,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -2271,7 +2271,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -2398,7 +2398,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -2666,7 +2666,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -2970,7 +2970,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -3334,7 +3334,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -4293,7 +4293,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -4441,7 +4441,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -4675,7 +4675,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -4787,7 +4787,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -5285,7 +5285,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -5562,7 +5562,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -5830,7 +5830,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -6121,7 +6121,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -6276,7 +6276,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -6469,7 +6469,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -6678,7 +6678,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -7058,7 +7058,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -7337,7 +7337,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -7464,7 +7464,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -7606,7 +7606,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -7821,7 +7821,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -7933,7 +7933,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -8290,7 +8290,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -8411,7 +8411,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -8523,7 +8523,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -8707,7 +8707,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -8992,7 +8992,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -9284,7 +9284,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -9547,7 +9547,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -9611,7 +9611,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -9785,7 +9785,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -9942,7 +9942,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -10136,7 +10136,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -10278,7 +10278,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -10594,7 +10594,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -11186,7 +11186,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -11322,7 +11322,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -11563,7 +11563,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -12146,7 +12146,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -12339,7 +12339,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -12526,7 +12526,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -12748,7 +12748,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -12905,7 +12905,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -13079,7 +13079,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -13224,7 +13224,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -15620,7 +15620,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -15946,7 +15946,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -16103,7 +16103,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -17621,7 +17621,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -17763,7 +17763,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -17842,7 +17842,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -17973,7 +17973,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -18097,7 +18097,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -18439,7 +18439,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -18877,13 +18877,13 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } return nullptr; diff --git a/src/controller/python/chip/clusters/command.cpp b/src/controller/python/chip/clusters/command.cpp index b3ddbfba04b583..e87a2252048b26 100644 --- a/src/controller/python/chip/clusters/command.cpp +++ b/src/controller/python/chip/clusters/command.cpp @@ -146,7 +146,7 @@ chip::ChipError::StorageType pychip_CommandSender_SendCommand(void * appContext, VerifyOrExit(writer != nullptr, err = CHIP_ERROR_INCORRECT_STATE); reader.Init(payload, length); reader.Next(); - SuccessOrExit(writer->CopyContainer(TLV::ContextTag(to_underlying(CommandDataIB::Tag::kData)), reader)); + SuccessOrExit(writer->CopyContainer(TLV::ContextTag(to_underlying(CommandDataIB::Tag::kFields)), reader)); } SuccessOrExit(err = sender->FinishCommand(timedRequestTimeoutMs != 0 ? Optional(timedRequestTimeoutMs) diff --git a/src/darwin/Framework/CHIP/CHIPDevice.mm b/src/darwin/Framework/CHIP/CHIPDevice.mm index ed9499f4664fde..510cb8553c8d13 100644 --- a/src/darwin/Framework/CHIP/CHIPDevice.mm +++ b/src/darwin/Framework/CHIP/CHIPDevice.mm @@ -1423,7 +1423,7 @@ - (instancetype)initWithPath:(const ConcreteEventPath &)path } else { CHIP_ERROR err; value = CHIPDecodeEventPayload(aEventHeader.mPath, *apData, &err); - if (err == CHIP_ERROR_IM_MALFORMED_EVENT_PATH) { + if (err == CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB) { // We don't know this event; just skip it. return; } @@ -1465,7 +1465,7 @@ - (instancetype)initWithPath:(const ConcreteEventPath &)path } else { CHIP_ERROR err; value = CHIPDecodeAttributeValue(aPath, *apData, &err); - if (err == CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH) { + if (err == CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB) { // We don't know this attribute; just skip it. return; } diff --git a/src/darwin/Framework/CHIP/templates/CHIPAttributeTLVValueDecoder-src.zapt b/src/darwin/Framework/CHIP/templates/CHIPAttributeTLVValueDecoder-src.zapt index 102be84e662142..347d18014dcdc0 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPAttributeTLVValueDecoder-src.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPAttributeTLVValueDecoder-src.zapt @@ -38,14 +38,14 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader } {{/chip_server_cluster_attributes}} default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; } {{/chip_client_clusters}} default: { - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } } diff --git a/src/darwin/Framework/CHIP/templates/CHIPEventTLVValueDecoder-src.zapt b/src/darwin/Framework/CHIP/templates/CHIPEventTLVValueDecoder-src.zapt index a93042336ac313..5c48cf27b8c14a 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPEventTLVValueDecoder-src.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPEventTLVValueDecoder-src.zapt @@ -54,14 +54,14 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea {{/zcl_events}} default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; } {{/chip_client_clusters}} default: { - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index 5c83256a9f656a..0a41ed48f15e88 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -283,7 +283,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -392,7 +392,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -534,7 +534,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -750,7 +750,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -910,7 +910,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -1061,7 +1061,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -1280,7 +1280,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -1611,7 +1611,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -1819,7 +1819,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -1975,7 +1975,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -2095,7 +2095,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -2296,7 +2296,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -2570,7 +2570,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -2799,7 +2799,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -3520,7 +3520,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -3668,7 +3668,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -3883,7 +3883,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -3992,7 +3992,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -4615,7 +4615,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -6132,7 +6132,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -6352,7 +6352,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -6590,7 +6590,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -6731,7 +6731,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -6896,7 +6896,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -7061,7 +7061,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -7380,7 +7380,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -7591,7 +7591,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -7711,7 +7711,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -7842,7 +7842,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -8022,7 +8022,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -8131,7 +8131,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -8414,7 +8414,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -8562,7 +8562,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -8671,7 +8671,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -8825,7 +8825,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -9037,7 +9037,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -9261,7 +9261,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -9487,7 +9487,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -9596,7 +9596,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -9771,7 +9771,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -10012,7 +10012,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -10180,7 +10180,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -10311,7 +10311,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -10547,7 +10547,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -11042,7 +11042,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -11177,7 +11177,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -11409,7 +11409,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -11843,7 +11843,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -12008,7 +12008,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -12187,7 +12187,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -12362,7 +12362,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -12504,7 +12504,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -12654,7 +12654,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -12819,7 +12819,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -14293,7 +14293,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -14985,7 +14985,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -15127,7 +15127,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -16090,7 +16090,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -16247,7 +16247,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -16367,7 +16367,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -16508,7 +16508,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -16628,7 +16628,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -16900,7 +16900,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; @@ -17283,13 +17283,13 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return value; } default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } break; } default: { - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; } } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPEventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPEventTLVValueDecoder.mm index 5d3c55fe6103d5..073315ad6e0583 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPEventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPEventTLVValueDecoder.mm @@ -207,7 +207,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -217,7 +217,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -227,7 +227,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -237,7 +237,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -247,7 +247,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -257,7 +257,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -267,7 +267,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -337,7 +337,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -347,7 +347,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -357,7 +357,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -385,7 +385,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -456,7 +456,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -526,7 +526,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -536,7 +536,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -546,7 +546,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -556,7 +556,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -566,7 +566,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -576,7 +576,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -853,7 +853,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -863,7 +863,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -873,7 +873,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -883,7 +883,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -893,7 +893,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -903,7 +903,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -913,7 +913,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1102,7 +1102,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1112,7 +1112,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1122,7 +1122,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1132,7 +1132,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1142,7 +1142,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1152,7 +1152,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1162,7 +1162,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1172,7 +1172,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1182,7 +1182,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1192,7 +1192,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1202,7 +1202,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1212,7 +1212,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1222,7 +1222,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1232,7 +1232,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1346,7 +1346,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1356,7 +1356,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1366,7 +1366,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1376,7 +1376,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1386,7 +1386,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1396,7 +1396,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1406,7 +1406,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1416,7 +1416,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1646,7 +1646,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1656,7 +1656,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1666,7 +1666,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1700,7 +1700,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1846,7 +1846,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1856,7 +1856,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1866,7 +1866,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1987,7 +1987,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -1997,7 +1997,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -2007,7 +2007,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -2036,7 +2036,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -2046,7 +2046,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -2056,7 +2056,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -2066,7 +2066,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -2076,7 +2076,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -2147,7 +2147,7 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea } default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; @@ -2157,13 +2157,13 @@ id CHIPDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRea switch (aPath.mEventId) { default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } break; } default: { - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH; + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; } } diff --git a/src/lib/core/CHIPError.cpp b/src/lib/core/CHIPError.cpp index 82f7c974b08eb4..5b398d7de8800e 100644 --- a/src/lib/core/CHIPError.cpp +++ b/src/lib/core/CHIPError.cpp @@ -215,6 +215,18 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_INSUFFICIENT_PRIVILEGE.AsInteger(): desc = "Required privilege was insufficient during an operation"; break; + case CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_IB.AsInteger(): + desc = "Malformed Interacton Model Attribute Report IB"; + break; + case CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB.AsInteger(): + desc = "Malformed Interacton Model Command Data IB"; + break; + case CHIP_ERROR_IM_MALFORMED_EVENT_STATUS_IB.AsInteger(): + desc = "Malformed Interacton Model Event Status IB"; + break; + case CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE.AsInteger(): + desc = "Malformed Interacton Model Status Response IB"; + break; case CHIP_ERROR_INVALID_PATH_LIST.AsInteger(): desc = "Invalid TLV path list"; break; @@ -515,8 +527,8 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_TOO_MANY_SHARED_SESSION_END_NODES.AsInteger(): desc = "Too many shared session end nodes"; break; - case CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_ELEMENT.AsInteger(): - desc = "Malformed Interaction Model Attribute DataElement"; + case CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_IB.AsInteger(): + desc = "Malformed Interaction Model Attribute Data IB"; break; case CHIP_ERROR_WRONG_CERT_TYPE.AsInteger(): desc = "Wrong certificate type"; @@ -587,26 +599,23 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_MDNS_COLLISION.AsInteger(): desc = "mDNS collision"; break; - case CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH.AsInteger(): - desc = "Malformed Interacton Model Attribute Path"; + case CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB.AsInteger(): + desc = "Malformed Interacton Model Attribute Path IB"; break; - case CHIP_ERROR_IM_MALFORMED_EVENT_PATH.AsInteger(): - desc = "Malformed Interacton Model Event Path"; + case CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB.AsInteger(): + desc = "Malformed Interacton Model Event Path IB"; break; - case CHIP_ERROR_IM_MALFORMED_COMMAND_PATH.AsInteger(): - desc = "Malformed Interacton Model Command Path"; + case CHIP_ERROR_IM_MALFORMED_COMMAND_PATH_IB.AsInteger(): + desc = "Malformed Interacton Model Command Path IB"; break; - case CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_ELEMENT.AsInteger(): - desc = "Malformed Interacton Model Attribute DataElement"; + case CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_IB.AsInteger(): + desc = "Malformed Interacton Model Attribute Status IB"; break; - case CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT.AsInteger(): - desc = "Malformed Interacton Model Attribute DataElement"; + case CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB.AsInteger(): + desc = "Malformed Interacton Model Event Data IB"; break; - case CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT.AsInteger(): - desc = "Malformed Interacton Model Event DataElement"; - break; - case CHIP_ERROR_IM_MALFORMED_STATUS_CODE.AsInteger(): - desc = "Malformed Interacton Model Status Code"; + case CHIP_ERROR_IM_MALFORMED_STATUS_IB.AsInteger(): + desc = "Malformed Interacton Model Status IB"; break; case CHIP_ERROR_PEER_NODE_NOT_FOUND.AsInteger(): desc = "Unable to find the peer node"; @@ -657,10 +666,10 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) desc = "Malformed Interaction Model Command Status IB"; break; case CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB.AsInteger(): - desc = "Malformed Interaction Model Invoke Response code IB"; + desc = "Malformed Interaction Model Invoke Response IB"; break; case CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE.AsInteger(): - desc = "Malformed Interaction Model Invoke Response Message"; + desc = "Malformed Interaction Model Invoke Request Message"; break; case CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE.AsInteger(): desc = "Malformed Interaction Model Invoke Response Message"; @@ -671,8 +680,8 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE.AsInteger(): desc = "Malformed Interaction Model Write Request Message"; break; - case CHIP_ERROR_IM_MALFORMED_WRITE_RESPONSE_MESSAGE.AsInteger(): - desc = "Malformed Interaction Model Write Response Message"; + case CHIP_ERROR_IM_MALFORMED_EVENT_FILTER_IB.AsInteger(): + desc = "Malformed Interaction Model Event Filter IB"; break; case CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE.AsInteger(): desc = "Malformed Interaction Model Read Request Message"; @@ -719,9 +728,6 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) 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 93ed129de525b1..a9d104780d1a6d 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -1527,12 +1527,32 @@ using CHIP_ERROR = ::chip::ChipError; */ #define CHIP_ERROR_INSUFFICIENT_PRIVILEGE CHIP_CORE_ERROR(0x79) +/** + * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_IB + * + * @brief + * The Attribute Report IB is malformed: it does not contain + * the required elements + */ +#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_IB CHIP_CORE_ERROR(0x7a) -// unused CHIP_CORE_ERROR(0x7a) - -// unused CHIP_CORE_ERROR(0x7b) +/** + * @def CHIP_ERROR_IM_MALFORMED_EVENT_STATUS_IB + * + * @brief + * The Event Status IB is malformed: it does not contain + * the required elements + */ +#define CHIP_ERROR_IM_MALFORMED_EVENT_STATUS_IB CHIP_CORE_ERROR(0x7b) -// unused CHIP_CORE_ERROR(0x7c) +/** + * @def CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE + * + * @brief + * The Status Response Message is malformed: it does not contain + * the required elements + */ +#define CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE CHIP_CORE_ERROR(0x7c) // unused CHIP_CORE_ERROR(0x7d) @@ -1808,13 +1828,13 @@ using CHIP_ERROR = ::chip::ChipError; #define CHIP_ERROR_TOO_MANY_SHARED_SESSION_END_NODES CHIP_CORE_ERROR(0x9b) /** - * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_ELEMENT + * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_IB * * @brief - * The Attribute DataElement is malformed: it either does not contain + * The Attribute Data IB is malformed: it does not contain * the required elements */ -#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_ELEMENT CHIP_CORE_ERROR(0x9c) +#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_IB CHIP_CORE_ERROR(0x9c) /** * @def CHIP_ERROR_WRONG_CERT_TYPE @@ -2022,67 +2042,67 @@ using CHIP_ERROR = ::chip::ChipError; #define CHIP_ERROR_MDNS_COLLISION CHIP_CORE_ERROR(0xb4) /** - * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH + * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB * * @brief - * The Attribute path is malformed: it either does not contain + * The Attribute path IB is malformed: it does not contain * the required path */ -#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH CHIP_CORE_ERROR(0xb5) +#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB CHIP_CORE_ERROR(0xb5) /** - * @def CHIP_ERROR_IM_MALFORMED_EVENT_PATH + * @def CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB * * @brief - * The Attribute Path is malformed: it either does not contain + * The Event Path IB is malformed: it does not contain * the required elements */ -#define CHIP_ERROR_IM_MALFORMED_EVENT_PATH CHIP_CORE_ERROR(0xb6) +#define CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB CHIP_CORE_ERROR(0xb6) /** - * @def CHIP_ERROR_IM_MALFORMED_COMMAND_PATH + * @def CHIP_ERROR_IM_MALFORMED_COMMAND_PATH_IB * * @brief - * The Attribute DataElement is malformed: it either does not contain + * The Command Path IB is malformed: it does not contain * the required elements */ -#define CHIP_ERROR_IM_MALFORMED_COMMAND_PATH CHIP_CORE_ERROR(0xb7) +#define CHIP_ERROR_IM_MALFORMED_COMMAND_PATH_IB CHIP_CORE_ERROR(0xb7) /** - * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_ELEMENT + * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_IB * * @brief - * The Attribute DataElement is malformed: it either does not contain + * The Attribute Status IB is malformed: it does not contain * the required elements */ -#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_ELEMENT CHIP_CORE_ERROR(0xb8) +#define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_IB CHIP_CORE_ERROR(0xb8) /** - * @def CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT + * @def CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB * * @brief - * The Attribute DataElement is malformed: it either does not contain + * The Command Data IB is malformed: it does not contain * the required elements */ -#define CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT CHIP_CORE_ERROR(0xb9) +#define CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB CHIP_CORE_ERROR(0xb9) /** - * @def CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT + * @def CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB * * @brief - * The Event DataElement is malformed: it either does not contain + * The Event Data IB is malformed: it does not contain * the required elements */ -#define CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT CHIP_CORE_ERROR(0xba) +#define CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB CHIP_CORE_ERROR(0xba) /** - * @def CHIP_ERROR_IM_MALFORMED_STATUS_CODE + * @def CHIP_ERROR_IM_MALFORMED_STATUS_IB * * @brief - * The Attribute DataElement is malformed: it either does not contain + * The Attribute Data IB is malformed: it does not contain * the required elements */ -#define CHIP_ERROR_IM_MALFORMED_STATUS_CODE CHIP_CORE_ERROR(0xbb) +#define CHIP_ERROR_IM_MALFORMED_STATUS_IB CHIP_CORE_ERROR(0xbb) /** * @def CHIP_ERROR_PEER_NODE_NOT_FOUND @@ -2213,7 +2233,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_COMMAND_STATUS_IB * * @brief - * The CommandStatusCodeIB is malformed: it either does not contain + * The Command Status IB is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_COMMAND_STATUS_IB CHIP_CORE_ERROR(0xcb) @@ -2222,7 +2242,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB * * @brief - * The InvokeResponseIB is malformed: it either does not contain + * The Invoke Response IB is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB CHIP_CORE_ERROR(0xcc) @@ -2231,7 +2251,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE * * @brief - * The InvokeResponseMessage is malformed: it either does not contain + * The Invoke Request Message is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE CHIP_CORE_ERROR(0xcd) @@ -2240,7 +2260,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE * * @brief - * The InvokeResponseMessage is malformed: it either does not contain + * The Invoke Response Message is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE CHIP_CORE_ERROR(0xce) @@ -2249,7 +2269,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_MESSAGE * * @brief - * The InvokeResponseMessage is malformed: it either does not contain + * The Attribute Response Message is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_MESSAGE CHIP_CORE_ERROR(0xcf) @@ -2258,25 +2278,25 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE * * @brief - * The WriteRequestMessage is malformed: it either does not contain + * The Write Request Message is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE CHIP_CORE_ERROR(0xd0) /** - * @def CHIP_ERROR_IM_MALFORMED_WRITE_RESPONSE_MESSAGE + * @def CHIP_ERROR_IM_MALFORMED_EVENT_FILTER_IB * * @brief - * The WriteResponseMessage is malformed: it either does not contain + * The Event Filter IB is malformed: it does not contain * the required elements */ -#define CHIP_ERROR_IM_MALFORMED_WRITE_RESPONSE_MESSAGE CHIP_CORE_ERROR(0xd1) +#define CHIP_ERROR_IM_MALFORMED_EVENT_FILTER_IB CHIP_CORE_ERROR(0xd1) /** * @def CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE * * @brief - * The ReadRequestMessage is malformed: it either does not contain + * The Read Request Message is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE CHIP_CORE_ERROR(0xd2) @@ -2285,7 +2305,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE * * @brief - * The SubscribeRequestMessage is malformed: it either does not contain + * The Subscribe Request Message is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE CHIP_CORE_ERROR(0xd3) @@ -2294,7 +2314,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE * * @brief - * The SubscribeResponseMessage is malformed: it either does not contain + * The Subscribe Response Message is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE CHIP_CORE_ERROR(0xd4) @@ -2303,7 +2323,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_EVENT_REPORT_IB * * @brief - * The EventReportIB is malformed: it either does not contain + * The Event Report IB is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_EVENT_REPORT_IB CHIP_CORE_ERROR(0xd5) @@ -2312,7 +2332,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB * * @brief - * The ClusterPathIB is malformed: it either does not contain + * The Cluster Path IB is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB CHIP_CORE_ERROR(0xd6) @@ -2321,7 +2341,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB * * @brief - * The DataVersionFilterIB is malformed: it either does not contain + * The Data Version Filter IB is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB CHIP_CORE_ERROR(0xd7) @@ -2338,7 +2358,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE * * @brief - * The Attribute DataElement is malformed: it either does not contain + * The Timed Request Message is malformed: it does not contain * the required elements */ #define CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE CHIP_CORE_ERROR(0xd9) @@ -2401,15 +2421,6 @@ using CHIP_ERROR = ::chip::ChipError; */ #define CHIP_ERROR_MISSING_URI_SEPARATOR CHIP_CORE_ERROR(0xe0) -/** - * @def CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE - * - * @brief - * The Attribute DataElement is malformed: it either does not contain - * the required elements - */ -#define CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE CHIP_CORE_ERROR(0xe1) - // clang-format on // !!!!! IMPORTANT !!!!! If you add new CHIP errors, please update the translation diff --git a/src/lib/core/tests/TestCHIPErrorStr.cpp b/src/lib/core/tests/TestCHIPErrorStr.cpp index ba3101f3c8a4b7..259d6bb416f492 100644 --- a/src/lib/core/tests/TestCHIPErrorStr.cpp +++ b/src/lib/core/tests/TestCHIPErrorStr.cpp @@ -167,6 +167,12 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_CANCELLED, CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED, CHIP_ERROR_TLV_TAG_NOT_FOUND, + CHIP_ERROR_MISSING_SECURE_SESSION, + CHIP_ERROR_INVALID_ADMIN_SUBJECT, + CHIP_ERROR_INSUFFICIENT_PRIVILEGE, + CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_IB, + CHIP_ERROR_IM_MALFORMED_EVENT_STATUS_IB, + CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE, CHIP_ERROR_FABRIC_EXISTS, CHIP_ERROR_KEY_NOT_FOUND_FROM_PEER, CHIP_ERROR_WRONG_ENCRYPTION_TYPE_FROM_PEER, @@ -197,7 +203,7 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_RESPONSE, CHIP_ERROR_EXPORTED_KEY_AUTHENTICATION_FAILED, CHIP_ERROR_TOO_MANY_SHARED_SESSION_END_NODES, - CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_ELEMENT, + CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_IB, CHIP_ERROR_WRONG_CERT_TYPE, CHIP_ERROR_DEFAULT_EVENT_HANDLER_NOT_CALLED, CHIP_ERROR_PERSISTED_STORAGE_FAILED, @@ -221,13 +227,13 @@ static const CHIP_ERROR kTestElements[] = 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, - CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_ELEMENT, - CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT, - CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT, - CHIP_ERROR_IM_MALFORMED_STATUS_CODE, + CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB, + CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB, + CHIP_ERROR_IM_MALFORMED_COMMAND_PATH_IB, + CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_IB, + CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB, + CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB, + CHIP_ERROR_IM_MALFORMED_STATUS_IB, CHIP_ERROR_PEER_NODE_NOT_FOUND, CHIP_ERROR_HSM, CHIP_ERROR_IM_STATUS_CODE_RECEIVED, @@ -237,7 +243,7 @@ static const CHIP_ERROR kTestElements[] = 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_EVENT_FILTER_IB, CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE, CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE, CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE, @@ -256,7 +262,9 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE, CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE, CHIP_ERROR_INVALID_FILE_IDENTIFIER, - CHIP_ERROR_BUSY + CHIP_ERROR_BUSY, + CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_IB, + CHIP_ERROR_IM_MALFORMED_EVENT_STATUS_IB, }; // clang-format on