Skip to content

Commit

Permalink
Merge 062d160 into 8b8dadd
Browse files Browse the repository at this point in the history
  • Loading branch information
yunhanw-google authored Jun 5, 2024
2 parents 8b8dadd + 062d160 commit 2532306
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions examples/chip-tool/commands/clusters/ClusterCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,23 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub

if (data != nullptr)
{
LogErrorOnFailure(RemoteDataModelLogger::LogCommandAsJSON(path, data));

error = DataModelLogger::LogCommand(path, data);
{
// log a snapshot to not advance the data reader.
chip::TLV::TLVReader logTlvReader;
logTlvReader.Init(*data);
LogErrorOnFailure(RemoteDataModelLogger::LogCommandAsJSON(path, &logTlvReader));
error = DataModelLogger::LogCommand(path, &logTlvReader);
}
if (CHIP_NO_ERROR != error)
{
ChipLogError(chipTool, "Response Failure: Can not decode Data");
mError = error;
return;
}
if ((path.mEndpointId == chip::kRootEndpointId) && (path.mClusterId == chip::app::Clusters::IcdManagement::Id) &&
(path.mCommandId == chip::app::Clusters::IcdManagement::Commands::RegisterClient::Id))
(path.mCommandId == chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::Id))
{
// log a snapshot to not advance the data reader.
chip::TLV::TLVReader counterTlvReader;
counterTlvReader.Init(*data);
chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType value;
Expand All @@ -139,7 +144,6 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
ChipLogError(chipTool, "Failed to decode ICD counter: %" CHIP_ERROR_FORMAT, err.Format());
return;
}

chip::app::ICDClientInfo clientInfo;
clientInfo.peer_node = mScopedNodeId;
clientInfo.monitored_subject = mMonitoredSubject;
Expand Down

0 comments on commit 2532306

Please sign in to comment.