@@ -59,6 +59,8 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
59
59
chip::CommandId commandId,
60
60
const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type & value)
61
61
{
62
+ mPeerNodeId = device->GetDeviceId ();
63
+ mFabricIndex = device->GetSecureSession ().Value ()->GetFabricIndex ();
62
64
ReturnErrorOnFailure (InteractionModelCommands::SendCommand (device, endpointId, clusterId, commandId, value));
63
65
64
66
if (value.transferFileDesignator .HasValue () &&
@@ -109,6 +111,15 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
109
111
return ;
110
112
}
111
113
}
114
+ if ((path.mEndpointId == chip::kRootEndpointId ) && (path.mClusterId == chip::app::Clusters::IcdManagement::Id) && (path.mCommandId == chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Id))
115
+ {
116
+ CHIP_ERROR deleteEntryError =
117
+ 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
+ }
122
+ }
112
123
}
113
124
114
125
virtual void OnError (const chip::app::CommandSender * client, CHIP_ERROR error) override
@@ -208,7 +219,8 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
208
219
private:
209
220
chip::ClusterId mClusterId ;
210
221
chip::CommandId mCommandId ;
211
-
222
+ chip::FabricIndex mFabricIndex = 0 ;
223
+ chip::NodeId mPeerNodeId = 0 ;
212
224
CHIP_ERROR mError = CHIP_NO_ERROR;
213
225
CustomArgument mPayload ;
214
226
};
0 commit comments