Skip to content

Commit

Permalink
Add a "country-code" argument to chip-tool pairing commands. (#27948)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Feb 20, 2024
1 parent 821c868 commit 1022772
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()
break;
}

if (mCountryCode.HasValue())
{
params.SetCountryCode(CharSpan::fromCharString(mCountryCode.Value()));
}

return params;
}

Expand Down
7 changes: 7 additions & 0 deletions examples/chip-tool/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -203,6 +209,7 @@ class PairingCommand : public CHIPCommand,
chip::Optional<bool> mSkipCommissioningComplete;
chip::Optional<bool> mBypassAttestationVerifier;
chip::Optional<std::vector<uint32_t>> mCASEAuthTags;
chip::Optional<char *> mCountryCode;
uint16_t mRemotePort;
uint16_t mDiscriminator;
uint32_t mSetupPINCode;
Expand Down

0 comments on commit 1022772

Please sign in to comment.