Skip to content

Commit

Permalink
Use GetDeviceBeingCommissioned() instead of FindCommissioneeDevice()
Browse files Browse the repository at this point in the history
Revert making private API public.

Signed-off-by: Markus Becker <[email protected]>
  • Loading branch information
markus-becker-tridonic-com committed Apr 28, 2022
1 parent 4a5d443 commit 1686194
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions examples/chip-tool/commands/clusters/ModelCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ CHIP_ERROR ModelCommand::RunCommand()
if (mViaPase.ValueOr(0) == 1)
{
ChipLogProgress(chipTool, "Sending command via PASE to node 0x%" PRIx64, mNodeId);
CommissioneeDeviceProxy * device = CurrentCommissioner().FindCommissioneeDevice(mNodeId);
return this->SendCommand(device, this->mEndPointId);
CommissioneeDeviceProxy * commissioneeDevice = nullptr;
CHIP_ERROR err = CurrentCommissioner().GetDeviceBeingCommissioned(mNodeId, &commissioneeDevice);
VerifyOrReturnError(CHIP_NO_ERROR == err, err);
VerifyOrReturnError(commissioneeDevice != nullptr, CHIP_ERROR_NOT_CONNECTED);

return this->SendCommand(commissioneeDevice, this->mEndPointId);
}
else
{
Expand Down
1 change: 0 additions & 1 deletion src/controller/CHIPDeviceController.h
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController,

void HandleAttestationResult(CHIP_ERROR err);

public:
CommissioneeDeviceProxy * FindCommissioneeDevice(const SessionHandle & session);
CommissioneeDeviceProxy * FindCommissioneeDevice(NodeId id);
CommissioneeDeviceProxy * FindCommissioneeDevice(const Transport::PeerAddress & peerAddress);
Expand Down

0 comments on commit 1686194

Please sign in to comment.