Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yunhanw-google committed May 30, 2024
1 parent 32d3fa2 commit b53dfed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 1 addition & 5 deletions examples/chip-tool/commands/clusters/ClusterCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
if ((path.mEndpointId == chip::kRootEndpointId) && (path.mClusterId == chip::app::Clusters::IcdManagement::Id) &&
(path.mCommandId == chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Id))
{
CHIP_ERROR deleteEntryError = CHIPCommand::sICDClientStorage.DeleteEntry(chip::ScopedNodeId(mPeerNodeId, mFabricIndex));
if (deleteEntryError != CHIP_NO_ERROR)
{
ChipLogError(chipTool, "Failed to delete ICD entry: %s", chip::ErrorStr(deleteEntryError));
}
ModelCommand::ClearICDEntry(chip::ScopedNodeId(mPeerNodeId, mFabricIndex));
}
}

Expand Down
9 changes: 9 additions & 0 deletions examples/chip-tool/commands/clusters/ModelCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ void ModelCommand::Shutdown()
CHIPCommand::Shutdown();
}

void ModelCommand::ClearICDEntry(const chip::ScopedNodeId & nodeId)
{
CHIP_ERROR deleteEntryError = CHIPCommand::sICDClientStorage.DeleteEntry(nodeId);
if (deleteEntryError != CHIP_NO_ERROR)
{
ChipLogError(chipTool, "Failed to delete ICD entry: %" CHIP_ERROR_FORMAT, deleteEntryError.Format());
}
}

void ModelCommand::CheckPeerICDType()
{
if (mIsPeerLIT.HasValue())
Expand Down
2 changes: 2 additions & 0 deletions examples/chip-tool/commands/clusters/ModelCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class ModelCommand : public CHIPCommand

virtual CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) { return CHIP_ERROR_BAD_REQUEST; };

void ClearICDEntry(const chip::ScopedNodeId & nodeId);

void Shutdown() override;

protected:
Expand Down

0 comments on commit b53dfed

Please sign in to comment.