Skip to content

Commit 426d8fb

Browse files
Update ModelCommand.cpp
1 parent 067a372 commit 426d8fb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
5252
CHIP_ERROR SendCommand(chip::DeviceProxy * device, chip::EndpointId endpointId, chip::ClusterId clusterId,
5353
chip::CommandId commandId, const T & value)
5454
{
55+
mPeerNodeId = device->GetDeviceId();
56+
mFabricIndex = device->GetSecureSession().Value()->GetFabricIndex();
5557
return InteractionModelCommands::SendCommand(device, endpointId, clusterId, commandId, value);
5658
}
5759

5860
CHIP_ERROR SendCommand(chip::DeviceProxy * device, chip::EndpointId endpointId, chip::ClusterId clusterId,
5961
chip::CommandId commandId,
6062
const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type & value)
6163
{
62-
mPeerNodeId = device->GetDeviceId();
63-
mFabricIndex = device->GetSecureSession().Value()->GetFabricIndex();
6464
ReturnErrorOnFailure(InteractionModelCommands::SendCommand(device, endpointId, clusterId, commandId, value));
6565

6666
if (value.transferFileDesignator.HasValue() &&

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ 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;
70+
virtual void ClearICDEntry(const chip::ScopedNodeId & nodeId);
7171

7272
void Shutdown() override;
7373

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void ModelCommand::OnDeviceConnectedFn(void * context, Messaging::ExchangeManage
6161
VerifyOrReturn(command != nullptr, ChipLogError(chipTool, "OnDeviceConnectedFn: context is null"));
6262

6363
OperationalDeviceProxy device(&exchangeMgr, sessionHandle);
64-
CHIP_ERROR err = command->SendCommand(&device, command->minEndPointId);
64+
CHIP_ERROR err = command->SendCommand(&device, command->mEndPointId);
6565
VerifyOrReturn(CHIP_NO_ERROR == err, command->SetCommandExitStatus(err));
6666
}
6767

@@ -82,7 +82,7 @@ void ModelCommand::Shutdown()
8282
mOnDeviceConnectionFailureCallback.Cancel();
8383
}
8484

85-
void ClearICDEntry(const chip::ScopedNodeId & nodeId);
85+
void ModelCommand::ClearICDEntry(const chip::ScopedNodeId & nodeId)
8686
{
8787
ChipLogError(chipTool, "ClearICDEntry is not implemented in tv-casting-app");
8888
}

0 commit comments

Comments
 (0)