From 16031800fb3d300e43f063c82912a19721a03111 Mon Sep 17 00:00:00 2001 From: Song GUO Date: Wed, 16 Feb 2022 22:44:38 +0800 Subject: [PATCH] [IM] Remove IsFabricFiltered flag from WriteRequestBuilder (#15178) --- src/app/MessageDef/WriteRequestMessage.cpp | 27 ---------------------- src/app/MessageDef/WriteRequestMessage.h | 17 -------------- src/app/tests/TestMessageDef.cpp | 7 ------ src/app/tests/TestWriteInteraction.cpp | 2 +- 4 files changed, 1 insertion(+), 52 deletions(-) diff --git a/src/app/MessageDef/WriteRequestMessage.cpp b/src/app/MessageDef/WriteRequestMessage.cpp index 10521b715f6841..df586e55077b32 100644 --- a/src/app/MessageDef/WriteRequestMessage.cpp +++ b/src/app/MessageDef/WriteRequestMessage.cpp @@ -97,18 +97,6 @@ CHIP_ERROR WriteRequestMessage::Parser::CheckSchemaValidity() const ReturnErrorOnFailure(reader.Get(moreChunkedMessages)); PRETTY_PRINT("\tmoreChunkedMessages = %s, ", moreChunkedMessages ? "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); - tagPresenceMask |= (1 << to_underlying(Tag::kIsFabricFiltered)); -#if CHIP_DETAIL_LOGGING - { - bool isFabricFiltered; - ReturnErrorOnFailure(reader.Get(isFabricFiltered)); - PRETTY_PRINT("\tisFabricFiltered = %s, ", isFabricFiltered ? "true" : "false"); - } #endif // CHIP_DETAIL_LOGGING break; case kInteractionModelRevisionTag: @@ -164,11 +152,6 @@ CHIP_ERROR WriteRequestMessage::Parser::GetMoreChunkedMessages(bool * const apMo return GetSimpleValue(to_underlying(Tag::kMoreChunkedMessages), TLV::kTLVType_Boolean, apMoreChunkedMessages); } -CHIP_ERROR WriteRequestMessage::Parser::GetIsFabricFiltered(bool * const apIsFabricFiltered) const -{ - return GetSimpleValue(to_underlying(Tag::kIsFabricFiltered), TLV::kTLVType_Boolean, apIsFabricFiltered); -} - WriteRequestMessage::Builder & WriteRequestMessage::Builder::SuppressResponse(const bool aSuppressResponse) { // skip if error has already been set @@ -209,16 +192,6 @@ WriteRequestMessage::Builder & WriteRequestMessage::Builder::MoreChunkedMessages return *this; } -WriteRequestMessage::Builder & WriteRequestMessage::Builder::IsFabricFiltered(const bool aIsFabricFiltered) -{ - // skip if error has already been set - if (mError == CHIP_NO_ERROR) - { - mError = mpWriter->PutBoolean(TLV::ContextTag(to_underlying(Tag::kIsFabricFiltered)), aIsFabricFiltered); - } - return *this; -} - WriteRequestMessage::Builder & WriteRequestMessage::Builder::EndOfWriteRequestMessage() { if (mError == CHIP_NO_ERROR) diff --git a/src/app/MessageDef/WriteRequestMessage.h b/src/app/MessageDef/WriteRequestMessage.h index 0e4ec4333ba3b3..7e79617bd3f9d8 100644 --- a/src/app/MessageDef/WriteRequestMessage.h +++ b/src/app/MessageDef/WriteRequestMessage.h @@ -40,7 +40,6 @@ enum class Tag : uint8_t kTimedRequest = 1, kWriteRequests = 2, kMoreChunkedMessages = 3, - kIsFabricFiltered = 4, }; class Parser : public MessageParser @@ -98,16 +97,6 @@ class Parser : public MessageParser * #CHIP_END_OF_TLV if there is no such element */ CHIP_ERROR GetMoreChunkedMessages(bool * const apMoreChunkedMessages) const; - - /** - * @brief Get IsFabricFiltered boolean - * - * @param [in] apIsFabricFiltered A pointer to apIsFabricFiltered - * - * @return #CHIP_NO_ERROR on success - * #CHIP_END_OF_TLV if there is no such element - */ - CHIP_ERROR GetIsFabricFiltered(bool * const apIsFabricFiltered) const; }; class Builder : public MessageBuilder @@ -143,12 +132,6 @@ class Builder : public MessageBuilder AttributeDataIBs::Builder & GetWriteRequests() { return mWriteRequests; }; - /** - * @brief limits the data written within fabric-scoped lists to the accessing fabric - * @return A reference to *this - */ - WriteRequestMessage::Builder & IsFabricFiltered(const bool aIsFabricFiltered); - /** * @brief Mark the end of this WriteRequestMessage * diff --git a/src/app/tests/TestMessageDef.cpp b/src/app/tests/TestMessageDef.cpp index 95c3cd52f075e2..c864e3139c355d 100644 --- a/src/app/tests/TestMessageDef.cpp +++ b/src/app/tests/TestMessageDef.cpp @@ -1163,9 +1163,6 @@ void BuildWriteRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & aWri writeRequestBuilder.MoreChunkedMessages(true); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); - writeRequestBuilder.IsFabricFiltered(true); - NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); - writeRequestBuilder.EndOfWriteRequestMessage(); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); } @@ -1179,7 +1176,6 @@ void ParseWriteRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVReader & aRea bool timeRequest = false; AttributeDataIBs::Parser writeRequests; bool moreChunkedMessages = false; - bool isFabricFiltered = false; err = writeRequestParser.Init(aReader); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -1198,9 +1194,6 @@ void ParseWriteRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVReader & aRea err = writeRequestParser.GetMoreChunkedMessages(&moreChunkedMessages); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && moreChunkedMessages); - - err = writeRequestParser.GetIsFabricFiltered(&isFabricFiltered); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && isFabricFiltered); } void BuildWriteResponseMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & aWriter) diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index 15b6a159bdc288..78b81ac868c570 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -159,7 +159,7 @@ void TestWriteInteraction::GenerateWriteRequest(nlTestSuite * apSuite, void * ap attributeDataIBsBuilder.EndOfAttributeDataIBs(); NL_TEST_ASSERT(apSuite, attributeDataIBsBuilder.GetError() == CHIP_NO_ERROR); - writeRequestBuilder.IsFabricFiltered(false).EndOfWriteRequestMessage(); + writeRequestBuilder.EndOfWriteRequestMessage(); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); err = writer.Finalize(&aPayload);