From 102277222be7206227592d6a5410486163dc00ac Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 17 Jul 2023 07:25:19 -0400 Subject: [PATCH] Add a "country-code" argument to chip-tool pairing commands. (#27948) --- examples/chip-tool/commands/pairing/PairingCommand.cpp | 5 +++++ examples/chip-tool/commands/pairing/PairingCommand.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/examples/chip-tool/commands/pairing/PairingCommand.cpp b/examples/chip-tool/commands/pairing/PairingCommand.cpp index d5b0401b662269..76dbbcb721cad0 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.cpp +++ b/examples/chip-tool/commands/pairing/PairingCommand.cpp @@ -111,6 +111,11 @@ CommissioningParameters PairingCommand::GetCommissioningParameters() break; } + if (mCountryCode.HasValue()) + { + params.SetCountryCode(CharSpan::fromCharString(mCountryCode.Value())); + } + return params; } diff --git a/examples/chip-tool/commands/pairing/PairingCommand.h b/examples/chip-tool/commands/pairing/PairingCommand.h index a92ec4d1c67172..0e3dd8024d09cb 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.h +++ b/examples/chip-tool/commands/pairing/PairingCommand.h @@ -158,6 +158,12 @@ class PairingCommand : public CHIPCommand, break; } + if (mode != PairingMode::None) + { + AddArgument("country-code", &mCountryCode, + "Country code to use to set the Basic Information cluster's Location attribute"); + } + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } @@ -203,6 +209,7 @@ class PairingCommand : public CHIPCommand, chip::Optional mSkipCommissioningComplete; chip::Optional mBypassAttestationVerifier; chip::Optional> mCASEAuthTags; + chip::Optional mCountryCode; uint16_t mRemotePort; uint16_t mDiscriminator; uint32_t mSetupPINCode;