Skip to content

Commit

Permalink
[IM] Remove IsFabricFiltered flag from WriteRequestBuilder (#15178)
Browse files Browse the repository at this point in the history
  • Loading branch information
erjiaqing authored and pull[bot] committed Dec 14, 2023
1 parent d248c1e commit 1603180
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 52 deletions.
27 changes: 0 additions & 27 deletions src/app/MessageDef/WriteRequestMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
17 changes: 0 additions & 17 deletions src/app/MessageDef/WriteRequestMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ enum class Tag : uint8_t
kTimedRequest = 1,
kWriteRequests = 2,
kMoreChunkedMessages = 3,
kIsFabricFiltered = 4,
};

class Parser : public MessageParser
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*
Expand Down
7 changes: 0 additions & 7 deletions src/app/tests/TestMessageDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/app/tests/TestWriteInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1603180

Please sign in to comment.