Skip to content

Commit

Permalink
[chip-tool] Add an optional timeout parameter to the pairing command (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored and pull[bot] committed Feb 14, 2024
1 parent 537538a commit 1207390
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/chip-tool/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,13 @@ class PairingCommand : public CHIPCommand,
AddArgument("name", &mDiscoveryFilterInstanceName);
break;
}

AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
}

/////////// CHIPCommand Interface /////////
CHIP_ERROR RunCommand() override;
chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(120); }
chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(120)); }

/////////// DevicePairingDelegate Interface /////////
void OnStatusUpdate(chip::Controller::DevicePairingDelegate::Status status) override;
Expand All @@ -161,6 +163,7 @@ class PairingCommand : public CHIPCommand,
const chip::Dnssd::DiscoveryFilterType mFilterType;
Command::AddressWithInterface mRemoteAddr;
NodeId mNodeId;
chip::Optional<uint16_t> mTimeout;
uint16_t mRemotePort;
uint16_t mDiscriminator;
uint32_t mSetupPINCode;
Expand Down

0 comments on commit 1207390

Please sign in to comment.