diff --git a/src/app/ClusterInfo.h b/src/app/ClusterInfo.h index f9179ab373db72..5ae16f1aded068 100644 --- a/src/app/ClusterInfo.h +++ b/src/app/ClusterInfo.h @@ -18,103 +18,72 @@ #pragma once -#include #include #include #include namespace chip { namespace app { -static constexpr AttributeId kRootAttributeId = 0xFFFFFFFF; +/** + * ClusterInfo is the representation of an attribute path or an event path used by ReadHandler, ReadClient, WriteHandler, + * Report::Engine etc, tt uses some invalid values for representing the wildcard value for its field and contains a mpNext field so + * it can be used as a linked list. + */ +// TODO: The cluster info should be separated into AttributeInfo and EventInfo. +// Note: The change will happen after #11171 with a better linked list. struct ClusterInfo { - enum class Flags : uint8_t - { - kFieldIdValid = 0x01, - kListIndexValid = 0x02, - kEventIdValid = 0x03, - }; + // Endpoint Id is a uint16 number, and should between 0 and 0xFFFE + static constexpr EndpointId kInvalidEndpointId = 0xFFFF; + // The ClusterId, AttributeId and EventId are MEIs, + // 0xFFFF is not a valid manufacturer code, thus 0xFFFF'FFFF is not a valid MEI + static constexpr ClusterId kInvalidClusterId = 0xFFFF'FFFF; + static constexpr AttributeId kInvalidAttributeId = 0xFFFF'FFFF; + static constexpr EventId kInvalidEventId = 0xFFFF'FFFF; + // ListIndex is a uint16 number, thus 0xFFFF is not a valid list index. + static constexpr ListIndex kInvalidListIndex = 0xFFFF; bool IsAttributePathSupersetOf(const ClusterInfo & other) const { - if ((other.mEndpointId != mEndpointId) || (other.mClusterId != mClusterId)) - { - return false; - } - - Optional myFieldId = - mFlags.Has(Flags::kFieldIdValid) ? Optional::Value(mFieldId) : Optional::Missing(); - - Optional otherFieldId = other.mFlags.Has(Flags::kFieldIdValid) ? Optional::Value(other.mFieldId) - : Optional::Missing(); - - Optional myListIndex = - mFlags.Has(Flags::kListIndexValid) ? Optional::Value(mListIndex) : Optional::Missing(); - - Optional otherListIndex = other.mFlags.Has(Flags::kListIndexValid) ? Optional::Value(other.mListIndex) - : Optional::Missing(); + VerifyOrReturnError(!HasWildcardEndpointId() || mEndpointId == other.mEndpointId, false); + VerifyOrReturnError(!HasWildcardClusterId() || mClusterId == other.mClusterId, false); + VerifyOrReturnError(!HasWildcardAttributeId() || mFieldId == other.mFieldId, false); + VerifyOrReturnError(!HasWildcardListIndex() || mListIndex == other.mListIndex, false); - // If list index exists, field index must exist - // Field 0xFFFFFFF (any) & listindex set is invalid - assert(!(myListIndex.HasValue() && !myFieldId.HasValue())); - assert(!(otherListIndex.HasValue() && !otherFieldId.HasValue())); - assert(!(myFieldId == Optional::Value(kRootAttributeId) && myListIndex.HasValue())); - assert(!(otherFieldId == Optional::Value(kRootAttributeId) && otherListIndex.HasValue())); - - if (myFieldId == Optional::Value(kRootAttributeId)) - { - return true; - } - - if (myFieldId != otherFieldId) - { - return false; - } + return true; + } - // We only support top layer for attribute representation, either FieldId or FieldId + ListIndex - // Combination: if myFieldId == otherFieldId, ListIndex cannot exist without FieldId - // 1. myListIndex and otherListIndex both missing or both exactly the same, then current is superset of other - // 2. myListIndex is missing, no matter if otherListIndex is missing or not, then current is superset of other - if (myListIndex == otherListIndex) - { - // either both missing or both exactly the same - return true; - } + bool HasWildcard() const { return !HasWildcardEndpointId() || !HasWildcardClusterId() || !HasWildcardAttributeId(); } - if (!myListIndex.HasValue()) - { - // difference is ok only if myListIndex is missing - return true; - } + /** + * Verify if it mets some basic constrants of a attribute path: If list index is valid, then field id must be valid too. + * There are other conditions that the path is not a valid path, e.g. the path does not exists, wildcard cluster id with + * non-wildcard attribute id and valid list index on a non-array attributes etc. + */ + bool IsValidAttributePath() const { return mListIndex == kInvalidListIndex || mFieldId != kInvalidAttributeId; } - return false; - } + inline bool HasWildcardNodeId() const { return mNodeId != kUndefinedNodeId; } + inline bool HasWildcardEndpointId() const { return mEndpointId != kInvalidEndpointId; } + inline bool HasWildcardClusterId() const { return mClusterId != kInvalidClusterId; } + inline bool HasWildcardAttributeId() const { return mFieldId != kInvalidAttributeId; } + inline bool HasWildcardListIndex() const { return mListIndex != kInvalidListIndex; } + inline bool HasWildcardEventId() const { return mEventId != kInvalidEventId; } ClusterInfo() {} - NodeId mNodeId = 0; - ClusterId mClusterId = 0; - ListIndex mListIndex = 0; - AttributeId mFieldId = 0; - EndpointId mEndpointId = 0; - BitFlags mFlags; - ClusterInfo * mpNext = nullptr; - EventId mEventId = 0; - /* For better structure alignment + /* + * For better structure alignment * Above ordering is by bit-size to ensure least amount of memory alignment padding. - * Changing order to something more natural (e.g. clusterid before nodeid) will result + * Changing order to something more natural (e.g. endpoint id before cluster id) will result * in extra memory alignment padding. - * uint64 mNodeId - * uint16_t mClusterId - * uint16_t mListIndex - * uint8_t FieldId - * uint8_t EndpointId - * uint8_t mDirty - * uint8_t mType - * uint32_t mpNext - * uint16_t EventId - * padding 2 bytes */ + ClusterInfo * mpNext = nullptr; // pointer width (32/64 bits) + NodeId mNodeId = kUndefinedNodeId; // uint64 + ClusterId mClusterId = kInvalidClusterId; // uint32 + AttributeId mFieldId = kInvalidAttributeId; // uint32 + EventId mEventId = kInvalidEventId; // uint32 + ListIndex mListIndex = kInvalidListIndex; // uint16 + EndpointId mEndpointId = kInvalidEndpointId; // uint16 }; } // namespace app } // namespace chip diff --git a/src/app/EventManagement.cpp b/src/app/EventManagement.cpp index 5fa2eaeb1db386..d6c524e598cfe4 100644 --- a/src/app/EventManagement.cpp +++ b/src/app/EventManagement.cpp @@ -619,6 +619,7 @@ static bool IsInterestedEventPaths(EventLoadOutContext * eventLoadOutContext, co } while (interestedEventPaths != nullptr) { + // TODO: Support wildcard event path if (interestedEventPaths->mNodeId == event.mNodeId && interestedEventPaths->mEndpointId == event.mEndpointId && interestedEventPaths->mClusterId == event.mClusterId && interestedEventPaths->mEventId == event.mEventId) { diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index b4135df49fa0df..50bc098cff135f 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -465,7 +465,6 @@ void InteractionModelEngine::ReleaseClusterInfoList(ClusterInfo *& aClusterInfo) { lastClusterInfo = lastClusterInfo->mpNext; } - lastClusterInfo->mFlags.ClearAll(); lastClusterInfo->mpNext = mpNextAvailableClusterInfo; mpNextAvailableClusterInfo = aClusterInfo; aClusterInfo = nullptr; @@ -502,7 +501,6 @@ bool InteractionModelEngine::MergeOverlappedAttributePath(ClusterInfo * apAttrib { runner->mListIndex = aAttributePath.mListIndex; runner->mFieldId = aAttributePath.mFieldId; - runner->mFlags = aAttributePath.mFlags; return true; } runner = runner->mpNext; diff --git a/src/app/MessageDef/Parser.h b/src/app/MessageDef/Parser.h index 446703bf417ccf..109278890716c2 100644 --- a/src/app/MessageDef/Parser.h +++ b/src/app/MessageDef/Parser.h @@ -86,11 +86,11 @@ class Parser CHIP_ERROR err = CHIP_NO_ERROR; chip::TLV::TLVReader reader; - *apLValue = 0; - err = mReader.FindElementWithTag(chip::TLV::ContextTag(aContextTag), reader); SuccessOrExit(err); + *apLValue = 0; + VerifyOrExit(aTLVType == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); err = reader.Get(*apLValue); diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index d3516d1aabe796..732c287aa7db72 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -475,8 +475,14 @@ CHIP_ERROR ReadClient::ProcessAttributeDataList(TLV::TLVReader & aAttributeDataL SuccessOrExit(err); err = attributePathParser.GetNodeId(&(clusterInfo.mNodeId)); + if (err == CHIP_END_OF_TLV) + { + err = CHIP_NO_ERROR; + } SuccessOrExit(err); + // The ReportData must contain a concrete attribute path + err = attributePathParser.GetEndpointId(&(clusterInfo.mEndpointId)); SuccessOrExit(err); @@ -484,23 +490,10 @@ CHIP_ERROR ReadClient::ProcessAttributeDataList(TLV::TLVReader & aAttributeDataL SuccessOrExit(err); err = attributePathParser.GetFieldId(&(clusterInfo.mFieldId)); - if (CHIP_NO_ERROR == err) - { - clusterInfo.mFlags.Set(ClusterInfo::Flags::kFieldIdValid); - } - else if (CHIP_END_OF_TLV == err) - { - err = CHIP_NO_ERROR; - } SuccessOrExit(err); err = attributePathParser.GetListIndex(&(clusterInfo.mListIndex)); - if (CHIP_NO_ERROR == err) - { - VerifyOrExit(clusterInfo.mFlags.Has(ClusterInfo::Flags::kFieldIdValid), err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); - clusterInfo.mFlags.Set(ClusterInfo::Flags::kListIndexValid); - } - else if (CHIP_END_OF_TLV == err) + if (CHIP_END_OF_TLV == err) { err = CHIP_NO_ERROR; } @@ -529,6 +522,10 @@ CHIP_ERROR ReadClient::ProcessAttributeDataList(TLV::TLVReader & aAttributeDataL } exit: + if (err != CHIP_NO_ERROR) + { + err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + } return err; } diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index c2ec72d32f3924..88b1b51ea0843a 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -335,28 +335,37 @@ CHIP_ERROR ReadHandler::ProcessAttributePathList(AttributePathList::Parser & aAt AttributePath::Parser path; err = path.Init(reader); SuccessOrExit(err); - err = path.GetNodeId(&(clusterInfo.mNodeId)); - SuccessOrExit(err); + // TODO: Support wildcard paths here + // TODO: MEIs (ClusterId and AttributeId) have a invalid pattern instead of a single invalid value, need to add separate + // functions for checking if we have received valid values. err = path.GetEndpointId(&(clusterInfo.mEndpointId)); + if (err == CHIP_NO_ERROR) + { + VerifyOrExit(clusterInfo.mEndpointId != ClusterInfo::kInvalidEndpointId, err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + } SuccessOrExit(err); err = path.GetClusterId(&(clusterInfo.mClusterId)); + if (err == CHIP_NO_ERROR) + { + VerifyOrExit(clusterInfo.mClusterId != ClusterInfo::kInvalidClusterId, err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + } + SuccessOrExit(err); err = path.GetFieldId(&(clusterInfo.mFieldId)); - if (CHIP_NO_ERROR == err) + if (CHIP_END_OF_TLV == err) { - clusterInfo.mFlags.Set(ClusterInfo::Flags::kFieldIdValid); + err = CHIP_NO_ERROR; } - else if (CHIP_END_OF_TLV == err) + else if (err == CHIP_NO_ERROR) { - err = CHIP_NO_ERROR; + VerifyOrExit(clusterInfo.mFieldId != ClusterInfo::kInvalidAttributeId, err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); } SuccessOrExit(err); err = path.GetListIndex(&(clusterInfo.mListIndex)); if (CHIP_NO_ERROR == err) { - VerifyOrExit(clusterInfo.mFlags.Has(ClusterInfo::Flags::kFieldIdValid), err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); - clusterInfo.mFlags.Set(ClusterInfo::Flags::kListIndexValid); + VerifyOrExit(clusterInfo.mFieldId != ClusterInfo::kInvalidAttributeId, err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); } else if (CHIP_END_OF_TLV == err) { @@ -398,11 +407,7 @@ CHIP_ERROR ReadHandler::ProcessEventPaths(EventPaths::Parser & aEventPathsParser err = path.GetCluster(&(clusterInfo.mClusterId)); SuccessOrExit(err); err = path.GetEvent(&(clusterInfo.mEventId)); - if (CHIP_NO_ERROR == err) - { - clusterInfo.mFlags.Set(ClusterInfo::Flags::kEventIdValid); - } - else if (CHIP_END_OF_TLV == err) + if (CHIP_END_OF_TLV == err) { err = CHIP_NO_ERROR; } diff --git a/src/app/WriteHandler.cpp b/src/app/WriteHandler.cpp index 87d8a9eeb7c6c5..7833ee75c165bc 100644 --- a/src/app/WriteHandler.cpp +++ b/src/app/WriteHandler.cpp @@ -124,7 +124,10 @@ CHIP_ERROR WriteHandler::ProcessAttributeDataList(TLV::TLVReader & aAttributeDat SuccessOrExit(err); err = attributePath.GetNodeId(&(clusterInfo.mNodeId)); - SuccessOrExit(err); + if (CHIP_END_OF_TLV == err) + { + err = CHIP_NO_ERROR; + } err = attributePath.GetEndpointId(&(clusterInfo.mEndpointId)); SuccessOrExit(err); @@ -133,23 +136,17 @@ CHIP_ERROR WriteHandler::ProcessAttributeDataList(TLV::TLVReader & aAttributeDat SuccessOrExit(err); err = attributePath.GetFieldId(&(clusterInfo.mFieldId)); - if (CHIP_NO_ERROR == err) - { - clusterInfo.mFlags.Set(ClusterInfo::Flags::kFieldIdValid); - } - else if (CHIP_END_OF_TLV == err) - { - err = CHIP_NO_ERROR; - } SuccessOrExit(err); err = attributePath.GetListIndex(&(clusterInfo.mListIndex)); - if (CHIP_NO_ERROR == err) + if (CHIP_END_OF_TLV == err) { - VerifyOrExit(clusterInfo.mFlags.Has(ClusterInfo::Flags::kFieldIdValid), err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); - clusterInfo.mFlags.Set(ClusterInfo::Flags::kListIndexValid); + err = CHIP_NO_ERROR; } + VerifyOrExit(clusterInfo.IsValidAttributePath() && !clusterInfo.HasWildcard(), + err = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); + err = element.GetData(&dataReader); SuccessOrExit(err); diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index 54bc91aac4c2af..da6b6a104a939d 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -70,8 +70,7 @@ Engine::RetrieveClusterData(FabricIndex aAccessingFabricIndex, AttributeDataList ConcreteAttributePath path(aClusterInfo.mEndpointId, aClusterInfo.mClusterId, aClusterInfo.mFieldId); AttributeDataElement::Builder attributeDataElementBuilder = aAttributeDataList.CreateAttributeDataElementBuilder(); AttributePath::Builder attributePathBuilder = attributeDataElementBuilder.CreateAttributePathBuilder(); - attributePathBuilder.NodeId(aClusterInfo.mNodeId) - .EndpointId(aClusterInfo.mEndpointId) + attributePathBuilder.EndpointId(aClusterInfo.mEndpointId) .ClusterId(aClusterInfo.mClusterId) .FieldId(aClusterInfo.mFieldId) .EndOfAttributePath(); diff --git a/src/app/tests/TestClusterInfo.cpp b/src/app/tests/TestClusterInfo.cpp index 932fe062104e72..00f940a713918d 100644 --- a/src/app/tests/TestClusterInfo.cpp +++ b/src/app/tests/TestClusterInfo.cpp @@ -34,19 +34,15 @@ void TestAttributePathIncludedSameFieldId(nlTestSuite * apSuite, void * apContex ClusterInfo clusterInfo1; ClusterInfo clusterInfo2; ClusterInfo clusterInfo3; - clusterInfo1.mFlags.Set(ClusterInfo::Flags::kFieldIdValid); - clusterInfo2.mFlags.Set(ClusterInfo::Flags::kFieldIdValid); - clusterInfo3.mFlags.Set(ClusterInfo::Flags::kFieldIdValid); clusterInfo1.mFieldId = 1; clusterInfo2.mFieldId = 1; clusterInfo3.mFieldId = 1; NL_TEST_ASSERT(apSuite, clusterInfo1.IsAttributePathSupersetOf(clusterInfo2)); - clusterInfo2.mFlags.Set(ClusterInfo::Flags::kListIndexValid); clusterInfo2.mListIndex = 1; NL_TEST_ASSERT(apSuite, clusterInfo1.IsAttributePathSupersetOf(clusterInfo2)); - clusterInfo1.mFlags.Set(ClusterInfo::Flags::kListIndexValid); + clusterInfo1.mListIndex = 0; NL_TEST_ASSERT(apSuite, !clusterInfo1.IsAttributePathSupersetOf(clusterInfo3)); - clusterInfo3.mFlags.Set(ClusterInfo::Flags::kListIndexValid); + clusterInfo3.mListIndex = 0; NL_TEST_ASSERT(apSuite, clusterInfo1.IsAttributePathSupersetOf(clusterInfo3)); clusterInfo3.mListIndex = 1; NL_TEST_ASSERT(apSuite, !clusterInfo1.IsAttributePathSupersetOf(clusterInfo3)); @@ -56,19 +52,17 @@ void TestAttributePathIncludedDifferentFieldId(nlTestSuite * apSuite, void * apC { ClusterInfo clusterInfo1; ClusterInfo clusterInfo2; - clusterInfo1.mFlags.Set(ClusterInfo::Flags::kFieldIdValid); - clusterInfo2.mFlags.Set(ClusterInfo::Flags::kFieldIdValid); clusterInfo1.mFieldId = 1; clusterInfo2.mFieldId = 2; NL_TEST_ASSERT(apSuite, !clusterInfo1.IsAttributePathSupersetOf(clusterInfo2)); - clusterInfo1.mFieldId = 0xFFFFFFFF; + clusterInfo1.mFieldId = ClusterInfo::kInvalidAttributeId; clusterInfo2.mFieldId = 2; NL_TEST_ASSERT(apSuite, clusterInfo1.IsAttributePathSupersetOf(clusterInfo2)); - clusterInfo1.mFieldId = 0xFFFFFFFF; - clusterInfo2.mFieldId = 0xFFFFFFFF; + clusterInfo1.mFieldId = ClusterInfo::kInvalidAttributeId; + clusterInfo2.mFieldId = ClusterInfo::kInvalidAttributeId; NL_TEST_ASSERT(apSuite, clusterInfo1.IsAttributePathSupersetOf(clusterInfo2)); clusterInfo1.mFieldId = 1; - clusterInfo2.mFieldId = 0xFFFFFFFF; + clusterInfo2.mFieldId = ClusterInfo::kInvalidAttributeId; NL_TEST_ASSERT(apSuite, !clusterInfo1.IsAttributePathSupersetOf(clusterInfo2)); } diff --git a/src/app/tests/TestInteractionModelEngine.cpp b/src/app/tests/TestInteractionModelEngine.cpp index b55200f7a901f7..5200e39b15f0f0 100644 --- a/src/app/tests/TestInteractionModelEngine.cpp +++ b/src/app/tests/TestInteractionModelEngine.cpp @@ -99,19 +99,15 @@ void TestInteractionModelEngine::TestMergeOverlappedAttributePath(nlTestSuite * NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); ClusterInfo clusterInfoList[2]; - clusterInfoList[0].mFlags.Set(chip::app::ClusterInfo::Flags::kFieldIdValid); clusterInfoList[0].mFieldId = 1; - clusterInfoList[1].mFlags.Set(chip::app::ClusterInfo::Flags::kFieldIdValid); clusterInfoList[1].mFieldId = 2; chip::app::ClusterInfo testClusterInfo; - testClusterInfo.mFlags.Set(chip::app::ClusterInfo::Flags::kFieldIdValid); testClusterInfo.mFieldId = 3; NL_TEST_ASSERT(apSuite, !InteractionModelEngine::GetInstance()->MergeOverlappedAttributePath(clusterInfoList, testClusterInfo)); - testClusterInfo.mFieldId = 0xFFFFFFFF; + testClusterInfo.mFieldId = ClusterInfo::kInvalidAttributeId; NL_TEST_ASSERT(apSuite, InteractionModelEngine::GetInstance()->MergeOverlappedAttributePath(clusterInfoList, testClusterInfo)); - testClusterInfo.mFlags.Set(chip::app::ClusterInfo::Flags::kListIndexValid); testClusterInfo.mFieldId = 1; testClusterInfo.mListIndex = 2; NL_TEST_ASSERT(apSuite, InteractionModelEngine::GetInstance()->MergeOverlappedAttributePath(clusterInfoList, testClusterInfo)); diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index f5db2d8e039437..d7af4860607537 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -904,34 +904,28 @@ void TestReadInteraction::TestSubscribeRoundtrip(nlTestSuite * apSuite, void * a chip::app::ClusterInfo dirtyPath1; dirtyPath1.mClusterId = kTestClusterId; dirtyPath1.mEndpointId = kTestEndpointId; - dirtyPath1.mFlags.Set(chip::app::ClusterInfo::Flags::kFieldIdValid); - dirtyPath1.mFieldId = 1; + dirtyPath1.mFieldId = 1; chip::app::ClusterInfo dirtyPath2; dirtyPath2.mClusterId = kTestClusterId; dirtyPath2.mEndpointId = kTestEndpointId; - dirtyPath2.mFlags.Set(chip::app::ClusterInfo::Flags::kFieldIdValid); - dirtyPath2.mFieldId = 2; + dirtyPath2.mFieldId = 2; chip::app::ClusterInfo dirtyPath3; - dirtyPath2.mClusterId = kTestClusterId; - dirtyPath2.mEndpointId = kTestEndpointId; - dirtyPath2.mFlags.Set(chip::app::ClusterInfo::Flags::kFieldIdValid); - dirtyPath2.mFlags.Set(chip::app::ClusterInfo::Flags::kListIndexValid); - dirtyPath2.mFieldId = 2; - dirtyPath2.mListIndex = 1; + dirtyPath3.mClusterId = kTestClusterId; + dirtyPath3.mEndpointId = kTestEndpointId; + dirtyPath3.mFieldId = 2; + dirtyPath3.mListIndex = 1; chip::app::ClusterInfo dirtyPath4; dirtyPath4.mClusterId = kTestClusterId; dirtyPath4.mEndpointId = kTestEndpointId; - dirtyPath4.mFlags.Set(chip::app::ClusterInfo::Flags::kFieldIdValid); - dirtyPath4.mFieldId = 3; + dirtyPath4.mFieldId = 3; chip::app::ClusterInfo dirtyPath5; dirtyPath5.mClusterId = kTestClusterId; dirtyPath5.mEndpointId = kTestEndpointId; - dirtyPath5.mFlags.Set(chip::app::ClusterInfo::Flags::kFieldIdValid); - dirtyPath5.mFieldId = 4; + dirtyPath5.mFieldId = 4; // Test report with 2 different path delegate.mpReadHandler->mHoldReport = false; diff --git a/src/app/tests/integration/chip_im_responder.cpp b/src/app/tests/integration/chip_im_responder.cpp index c805e15b9a41a4..9be9a077614cd0 100644 --- a/src/app/tests/integration/chip_im_responder.cpp +++ b/src/app/tests/integration/chip_im_responder.cpp @@ -171,7 +171,6 @@ void MutateClusterHandler(chip::System::Layer * systemLayer, void * appState) chip::app::ClusterInfo dirtyPath; dirtyPath.mClusterId = kTestClusterId; dirtyPath.mEndpointId = kTestEndpointId; - dirtyPath.mFlags.Set(chip::app::ClusterInfo::Flags::kFieldIdValid); printf("MutateClusterHandler is triggered..."); // send dirty change if (!testSyncReport) diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index e59527b436d89d..5e3dad6581d035 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -502,7 +502,6 @@ void MatterReportingAttributeChangeCallback(EndpointId endpoint, ClusterId clust info.mClusterId = clusterId; info.mFieldId = attributeId; info.mEndpointId = endpoint; - info.mFlags.Set(ClusterInfo::Flags::kFieldIdValid); InteractionModelEngine::GetInstance()->GetReportingEngine().SetDirty(info);