Skip to content

Commit 46dba23

Browse files
address comments
1 parent 32d3fa2 commit 46dba23

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

examples/chip-tool/commands/clusters/ClusterCommand.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
114114
if ((path.mEndpointId == chip::kRootEndpointId) && (path.mClusterId == chip::app::Clusters::IcdManagement::Id) &&
115115
(path.mCommandId == chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Id))
116116
{
117-
CHIP_ERROR deleteEntryError = CHIPCommand::sICDClientStorage.DeleteEntry(chip::ScopedNodeId(mPeerNodeId, mFabricIndex));
118-
if (deleteEntryError != CHIP_NO_ERROR)
119-
{
120-
ChipLogError(chipTool, "Failed to delete ICD entry: %s", chip::ErrorStr(deleteEntryError));
121-
}
117+
ModelCommand::ClearICDEntry(chip::ScopedNodeId(mPeerNodeId, mFabricIndex));
122118
}
123119
}
124120

examples/chip-tool/commands/clusters/ModelCommand.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ void ModelCommand::Shutdown()
7676
CHIPCommand::Shutdown();
7777
}
7878

79+
void ModelCommand::ClearICDEntry(const chip::ScopedNodeId & nodeId)
80+
{
81+
CHIP_ERROR deleteEntryError = CHIPCommand::sICDClientStorage.DeleteEntry(nodeId);
82+
if (deleteEntryError != CHIP_NO_ERROR)
83+
{
84+
ChipLogError(chipTool, "Failed to delete ICD entry: %" CHIP_ERROR_FORMAT, deleteEntryError.Format());
85+
}
86+
}
87+
7988
void ModelCommand::CheckPeerICDType()
8089
{
8190
if (mIsPeerLIT.HasValue())

examples/chip-tool/commands/clusters/ModelCommand.h

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ class ModelCommand : public CHIPCommand
6767

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

70+
void ClearICDEntry(const chip::ScopedNodeId & nodeId) override;
71+
7072
void Shutdown() override;
7173

7274
protected:

examples/tv-casting-app/tv-casting-common/commands/clusters/ModelCommand.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,8 @@ void ModelCommand::Shutdown()
8181
mOnDeviceConnectedCallback.Cancel();
8282
mOnDeviceConnectionFailureCallback.Cancel();
8383
}
84+
85+
void ClearICDEntry(const chip::ScopedNodeId & nodeId);
86+
{
87+
ChipLogError(chipTool, "ClearICDEntry is not implemented");
88+
}

0 commit comments

Comments
 (0)