Skip to content

Commit

Permalink
Make it easier to create TLV context tags fron enum class values. (#2…
Browse files Browse the repository at this point in the history
…5381)

* Make it easier to create TLV context tags fron enum class values.

We shouldn't be making all consumers use to_underlying.

* Address review comment.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Nov 1, 2023
1 parent 572c3ef commit f5557e7
Show file tree
Hide file tree
Showing 53 changed files with 1,524 additions and 1,589 deletions.
4 changes: 2 additions & 2 deletions examples/platform/linux/testing/CustomCSRResponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ namespace DataModel {
template <>
CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, const CSRResponse::Type & responseData)
{
auto tag1 = TLV::ContextTag(to_underlying(CSRResponse::Fields::kNOCSRElements));
auto tag2 = TLV::ContextTag(to_underlying(CSRResponse::Fields::kAttestationSignature));
auto tag1 = TLV::ContextTag(CSRResponse::Fields::kNOCSRElements);
auto tag2 = TLV::ContextTag(CSRResponse::Fields::kAttestationSignature);
auto & options = LinuxDeviceOptions::GetInstance().mCSRResponseOptions;

TLV::TLVType outer;
Expand Down
4 changes: 2 additions & 2 deletions src/app/AttributeAccessInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ class AttributeReportBuilder
CHIP_ERROR EncodeValue(AttributeReportIBs::Builder & aAttributeReportIBs, T && item, Ts &&... aArgs)
{
return DataModel::Encode(*(aAttributeReportIBs.GetAttributeReport().GetAttributeData().GetWriter()),
TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), item, std::forward<Ts>(aArgs)...);
TLV::ContextTag(AttributeDataIB::Tag::kData), item, std::forward<Ts>(aArgs)...);
}

template <typename T, std::enable_if_t<DataModel::IsFabricScoped<T>::value, bool> = true, typename... Ts>
CHIP_ERROR EncodeValue(AttributeReportIBs::Builder & aAttributeReportIBs, FabricIndex accessingFabricIndex, T && item,
Ts &&... aArgs)
{
return DataModel::EncodeForRead(*(aAttributeReportIBs.GetAttributeReport().GetAttributeData().GetWriter()),
TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), accessingFabricIndex, item);
TLV::ContextTag(AttributeDataIB::Tag::kData), accessingFabricIndex, item);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/CommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ CHIP_ERROR CommandHandler::PrepareCommand(const ConcreteCommandPath & aCommandPa
ReturnErrorOnFailure(path.Encode(aCommandPath));
if (aStartDataStruct)
{
ReturnErrorOnFailure(commandData.GetWriter()->StartContainer(TLV::ContextTag(to_underlying(CommandDataIB::Tag::kFields)),
ReturnErrorOnFailure(commandData.GetWriter()->StartContainer(TLV::ContextTag(CommandDataIB::Tag::kFields),
TLV::kTLVType_Structure, mDataElementContainerType));
}
MoveToState(State::AddingCommand);
Expand Down
2 changes: 1 addition & 1 deletion src/app/CommandHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class CommandHandler : public Messaging::ExchangeDelegate
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::kFields)), aData));
ReturnErrorOnFailure(DataModel::Encode(*writer, TLV::ContextTag(CommandDataIB::Tag::kFields), aData));

return FinishCommand(/* aEndDataStruct = */ false);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/CommandSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ CHIP_ERROR CommandSender::PrepareCommand(const CommandPathParams & aCommandPathP

if (aStartDataStruct)
{
ReturnErrorOnFailure(invokeRequest.GetWriter()->StartContainer(TLV::ContextTag(to_underlying(CommandDataIB::Tag::kFields)),
ReturnErrorOnFailure(invokeRequest.GetWriter()->StartContainer(TLV::ContextTag(CommandDataIB::Tag::kFields),
TLV::kTLVType_Structure, mDataElementContainerType));
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/CommandSender.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,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::kFields)), aData));
ReturnErrorOnFailure(DataModel::Encode(*writer, TLV::ContextTag(CommandDataIB::Tag::kFields), aData));
return FinishCommand(aTimedInvokeTimeoutMs);
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/EventLogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class EventLogger : public EventLoggingDelegate
EventLogger(const T & aEventData) : mEventData(aEventData){};
CHIP_ERROR WriteEvent(chip::TLV::TLVWriter & aWriter) final override
{
return DataModel::Encode(aWriter, TLV::ContextTag(to_underlying(EventDataIB::Tag::kData)), mEventData);
return DataModel::Encode(aWriter, TLV::ContextTag(EventDataIB::Tag::kData), mEventData);
}

private:
Expand Down
22 changes: 11 additions & 11 deletions src/app/EventManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,16 @@ CHIP_ERROR EventManagement::CopyAndAdjustDeltaTime(const TLVReader & aReader, si
// Does not go on the wire.
return CHIP_NO_ERROR;
}
if ((aReader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kSystemTimestamp))) && !(ctx->mpContext->mFirst) &&
if ((aReader.GetTag() == TLV::ContextTag(EventDataIB::Tag::kSystemTimestamp)) && !(ctx->mpContext->mFirst) &&
(ctx->mpContext->mCurrentTime.mType == ctx->mpContext->mPreviousTime.mType))
{
return ctx->mpWriter->Put(TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaSystemTimestamp)),
return ctx->mpWriter->Put(TLV::ContextTag(EventDataIB::Tag::kDeltaSystemTimestamp),
ctx->mpContext->mCurrentTime.mValue - ctx->mpContext->mPreviousTime.mValue);
}
if ((aReader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kEpochTimestamp))) && !(ctx->mpContext->mFirst) &&
if ((aReader.GetTag() == TLV::ContextTag(EventDataIB::Tag::kEpochTimestamp)) && !(ctx->mpContext->mFirst) &&
(ctx->mpContext->mCurrentTime.mType == ctx->mpContext->mPreviousTime.mType))
{
return ctx->mpWriter->Put(TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaEpochTimestamp)),
return ctx->mpWriter->Put(TLV::ContextTag(EventDataIB::Tag::kDeltaEpochTimestamp),
ctx->mpContext->mCurrentTime.mValue - ctx->mpContext->mPreviousTime.mValue);
}

Expand Down Expand Up @@ -508,7 +508,7 @@ CHIP_ERROR EventManagement::CopyEvent(const TLVReader & aReader, TLVWriter & aWr
ReturnErrorOnFailure(reader.Next());
ReturnErrorOnFailure(reader.EnterContainer(containerType1));
ReturnErrorOnFailure(
aWriter.StartContainer(TLV::ContextTag(to_underlying(EventReportIB::Tag::kEventData)), kTLVType_Structure, containerType1));
aWriter.StartContainer(TLV::ContextTag(EventReportIB::Tag::kEventData), kTLVType_Structure, containerType1));
err = TLV::Utilities::Iterate(reader, CopyAndAdjustDeltaTime, &context, false /*recurse*/);
if (err == CHIP_END_OF_TLV)
{
Expand Down Expand Up @@ -683,7 +683,7 @@ CHIP_ERROR EventManagement::FabricRemovedCB(const TLV::TLVReader & aReader, size
TLVType tlvType1;
event.Init(aReader);
VerifyOrReturnError(event.EnterContainer(tlvType) == CHIP_NO_ERROR, CHIP_NO_ERROR);
VerifyOrReturnError(event.Next(TLV::ContextTag(to_underlying(EventReportIB::Tag::kEventData))) == CHIP_NO_ERROR, CHIP_NO_ERROR);
VerifyOrReturnError(event.Next(TLV::ContextTag(EventReportIB::Tag::kEventData)) == CHIP_NO_ERROR, CHIP_NO_ERROR);
VerifyOrReturnError(event.EnterContainer(tlvType1) == CHIP_NO_ERROR, CHIP_NO_ERROR);

while (CHIP_NO_ERROR == event.Next())
Expand Down Expand Up @@ -751,7 +751,7 @@ CHIP_ERROR EventManagement::FetchEventParameters(const TLVReader & aReader, size
TLVReader reader;
reader.Init(aReader);

if (reader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kPath)))
if (reader.GetTag() == TLV::ContextTag(EventDataIB::Tag::kPath))
{
EventPathIB::Parser path;
ReturnErrorOnFailure(path.Init(aReader));
Expand All @@ -761,28 +761,28 @@ CHIP_ERROR EventManagement::FetchEventParameters(const TLVReader & aReader, size
envelope->mFieldsToRead |= 1 << to_underlying(EventDataIB::Tag::kPath);
}

if (reader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kPriority)))
if (reader.GetTag() == TLV::ContextTag(EventDataIB::Tag::kPriority))
{
uint16_t extPriority; // Note: the type here matches the type case in EventManagement::LogEvent, priority section
ReturnErrorOnFailure(reader.Get(extPriority));
envelope->mPriority = static_cast<PriorityLevel>(extPriority);
envelope->mFieldsToRead |= 1 << to_underlying(EventDataIB::Tag::kPriority);
}

if (reader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kEventNumber)))
if (reader.GetTag() == TLV::ContextTag(EventDataIB::Tag::kEventNumber))
{
ReturnErrorOnFailure(reader.Get(envelope->mEventNumber));
}

if (reader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kSystemTimestamp)))
if (reader.GetTag() == TLV::ContextTag(EventDataIB::Tag::kSystemTimestamp))
{
uint64_t systemTime;
ReturnErrorOnFailure(reader.Get(systemTime));
envelope->mCurrentTime.mType = Timestamp::Type::kSystem;
envelope->mCurrentTime.mValue = systemTime;
}

if (reader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kEpochTimestamp)))
if (reader.GetTag() == TLV::ContextTag(EventDataIB::Tag::kEpochTimestamp))
{
uint64_t epochTime;
ReturnErrorOnFailure(reader.Get(epochTime));
Expand Down
6 changes: 3 additions & 3 deletions src/app/MessageDef/AttributeDataIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ CHIP_ERROR AttributeDataIB::Parser::PrettyPrint() const
CHIP_ERROR AttributeDataIB::Parser::GetPath(AttributePathIB::Parser * const apPath) const
{
TLV::TLVReader reader;
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kPath)), reader));
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(Tag::kPath), reader));
return apPath->Init(reader);
}

Expand All @@ -105,7 +105,7 @@ CHIP_ERROR AttributeDataIB::Parser::GetDataVersion(chip::DataVersion * const apV

CHIP_ERROR AttributeDataIB::Parser::GetData(TLV::TLVReader * const apReader) const
{
return mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kData)), *apReader);
return mReader.FindElementWithTag(TLV::ContextTag(Tag::kData), *apReader);
}

AttributePathIB::Builder & AttributeDataIB::Builder::CreatePath()
Expand All @@ -122,7 +122,7 @@ AttributeDataIB::Builder & AttributeDataIB::Builder::DataVersion(const chip::Dat
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kDataVersion)), aDataVersion);
mError = mpWriter->Put(TLV::ContextTag(Tag::kDataVersion), aDataVersion);
}
return *this;
}
Expand Down
14 changes: 7 additions & 7 deletions src/app/MessageDef/AttributePathIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ AttributePathIB::Builder & AttributePathIB::Builder::EnableTagCompression(const
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->PutBoolean(TLV::ContextTag(to_underlying(Tag::kEnableTagCompression)), aEnableTagCompression);
mError = mpWriter->PutBoolean(TLV::ContextTag(Tag::kEnableTagCompression), aEnableTagCompression);
}
return *this;
}
Expand All @@ -281,7 +281,7 @@ AttributePathIB::Builder & AttributePathIB::Builder::Node(const NodeId aNode)
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kNode)), aNode);
mError = mpWriter->Put(TLV::ContextTag(Tag::kNode), aNode);
}
return *this;
}
Expand All @@ -291,7 +291,7 @@ AttributePathIB::Builder & AttributePathIB::Builder::Endpoint(const EndpointId a
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kEndpoint)), aEndpoint);
mError = mpWriter->Put(TLV::ContextTag(Tag::kEndpoint), aEndpoint);
}
return *this;
}
Expand All @@ -301,7 +301,7 @@ AttributePathIB::Builder & AttributePathIB::Builder::Cluster(const ClusterId aCl
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kCluster)), aCluster);
mError = mpWriter->Put(TLV::ContextTag(Tag::kCluster), aCluster);
}
return *this;
}
Expand All @@ -311,7 +311,7 @@ AttributePathIB::Builder & AttributePathIB::Builder::Attribute(const AttributeId
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kAttribute)), aAttribute);
mError = mpWriter->Put(TLV::ContextTag(Tag::kAttribute), aAttribute);
}
return *this;
}
Expand All @@ -321,7 +321,7 @@ AttributePathIB::Builder & AttributePathIB::Builder::ListIndex(const DataModel::
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = DataModel::Encode(*mpWriter, TLV::ContextTag(to_underlying(Tag::kListIndex)), aListIndex);
mError = DataModel::Encode(*mpWriter, TLV::ContextTag(Tag::kListIndex), aListIndex);
}
return *this;
}
Expand All @@ -331,7 +331,7 @@ AttributePathIB::Builder & AttributePathIB::Builder::ListIndex(const chip::ListI
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kListIndex)), aListIndex);
mError = mpWriter->Put(TLV::ContextTag(Tag::kListIndex), aListIndex);
}
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/MessageDef/AttributeReportIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ CHIP_ERROR AttributeReportIB::Parser::PrettyPrint() const
CHIP_ERROR AttributeReportIB::Parser::GetAttributeStatus(AttributeStatusIB::Parser * const apAttributeStatus) const
{
TLV::TLVReader reader;
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kAttributeStatus)), reader));
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(Tag::kAttributeStatus), reader));
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(mReader.FindElementWithTag(TLV::ContextTag(Tag::kAttributeData), reader));
return apAttributeData->Init(reader);
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/MessageDef/AttributeStatusIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ CHIP_ERROR AttributeStatusIB::Parser::PrettyPrint() const
CHIP_ERROR AttributeStatusIB::Parser::GetPath(AttributePathIB::Parser * const apPath) const
{
TLV::TLVReader reader;
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kPath)), reader));
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(Tag::kPath), reader));
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(mReader.FindElementWithTag(TLV::ContextTag(Tag::kErrorStatus), reader));
return apErrorStatus->Init(reader);
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/MessageDef/ClusterPathIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ ClusterPathIB::Builder & ClusterPathIB::Builder::Node(const NodeId aNode)
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kNode)), aNode);
mError = mpWriter->Put(TLV::ContextTag(Tag::kNode), aNode);
}
return *this;
}
Expand All @@ -127,7 +127,7 @@ ClusterPathIB::Builder & ClusterPathIB::Builder::Endpoint(const EndpointId aEndp
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kEndpoint)), aEndpoint);
mError = mpWriter->Put(TLV::ContextTag(Tag::kEndpoint), aEndpoint);
}
return *this;
}
Expand All @@ -137,7 +137,7 @@ ClusterPathIB::Builder & ClusterPathIB::Builder::Cluster(const ClusterId aCluste
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kCluster)), aCluster);
mError = mpWriter->Put(TLV::ContextTag(Tag::kCluster), aCluster);
}
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/MessageDef/CommandDataIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ CHIP_ERROR CommandDataIB::Parser::PrettyPrint() const
CHIP_ERROR CommandDataIB::Parser::GetPath(CommandPathIB::Parser * const apPath) const
{
TLV::TLVReader reader;
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kPath)), reader));
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(Tag::kPath), reader));
return apPath->Init(reader);
}

CHIP_ERROR CommandDataIB::Parser::GetFields(TLV::TLVReader * const apReader) const
{
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kFields)), *apReader));
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(Tag::kFields), *apReader));
return CHIP_NO_ERROR;
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/MessageDef/CommandPathIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ CommandPathIB::Builder & CommandPathIB::Builder::EndpointId(const chip::Endpoint
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kEndpointId)), aEndpointId);
mError = mpWriter->Put(TLV::ContextTag(Tag::kEndpointId), aEndpointId);
}
return *this;
}
Expand All @@ -129,7 +129,7 @@ CommandPathIB::Builder & CommandPathIB::Builder::ClusterId(const chip::ClusterId
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kClusterId)), aClusterId);
mError = mpWriter->Put(TLV::ContextTag(Tag::kClusterId), aClusterId);
}
return *this;
}
Expand All @@ -139,7 +139,7 @@ CommandPathIB::Builder & CommandPathIB::Builder::CommandId(const chip::CommandId
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kCommandId)), aCommandId);
mError = mpWriter->Put(TLV::ContextTag(Tag::kCommandId), aCommandId);
}
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/MessageDef/CommandStatusIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ CHIP_ERROR CommandStatusIB::Parser::PrettyPrint() const
CHIP_ERROR CommandStatusIB::Parser::GetPath(CommandPathIB::Parser * const apPath) const
{
TLV::TLVReader reader;
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kPath)), reader));
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(Tag::kPath), reader));
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(mReader.FindElementWithTag(TLV::ContextTag(Tag::kErrorStatus), reader));
return apErrorStatus->Init(reader);
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/MessageDef/DataVersionFilterIB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ CHIP_ERROR DataVersionFilterIB::Parser::PrettyPrint() const
CHIP_ERROR DataVersionFilterIB::Parser::GetPath(ClusterPathIB::Parser * const apPath) const
{
TLV::TLVReader reader;
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(to_underlying(Tag::kPath)), reader));
ReturnErrorOnFailure(mReader.FindElementWithTag(TLV::ContextTag(Tag::kPath), reader));
return apPath->Init(reader);
}

Expand All @@ -116,7 +116,7 @@ DataVersionFilterIB::Builder & DataVersionFilterIB::Builder::DataVersion(const c
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
{
mError = mpWriter->Put(TLV::ContextTag(to_underlying(Tag::kDataVersion)), aDataVersion);
mError = mpWriter->Put(TLV::ContextTag(Tag::kDataVersion), aDataVersion);
}
return *this;
}
Expand Down
Loading

0 comments on commit f5557e7

Please sign in to comment.