Skip to content

Commit

Permalink
[chip-tool] Add --skip-commissioning-complete optional parameter for …
Browse files Browse the repository at this point in the history
…non-concurrent connection use case (#23701)
  • Loading branch information
vivien-apple authored and pull[bot] committed Apr 30, 2024
1 parent c413155 commit 1316506
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
14 changes: 10 additions & 4 deletions examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,23 @@ CHIP_ERROR PairingCommand::RunInternal(NodeId remoteId)

CommissioningParameters PairingCommand::GetCommissioningParameters()
{
auto params = CommissioningParameters();
params.SetSkipCommissioningComplete(mSkipCommissioningComplete.ValueOr(false));

switch (mNetworkType)
{
case PairingNetworkType::WiFi:
return CommissioningParameters().SetWiFiCredentials(Controller::WiFiCredentials(mSSID, mPassword));
params.SetWiFiCredentials(Controller::WiFiCredentials(mSSID, mPassword));
break;
case PairingNetworkType::Thread:
return CommissioningParameters().SetThreadOperationalDataset(mOperationalDataset);
params.SetThreadOperationalDataset(mOperationalDataset);
break;
case PairingNetworkType::Ethernet:
case PairingNetworkType::None:
return CommissioningParameters();
break;
}
return CommissioningParameters();

return params;
}

CHIP_ERROR PairingCommand::PaseWithCode(NodeId remoteId)
Expand Down
6 changes: 6 additions & 0 deletions examples/chip-tool/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,32 @@ class PairingCommand : public CHIPCommand,
case PairingMode::None:
break;
case PairingMode::Code:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
case PairingMode::CodePaseOnly:
AddArgument("payload", &mOnboardingPayload);
AddArgument("discover-once", 0, 1, &mDiscoverOnce);
AddArgument("use-only-onnetwork-discovery", 0, 1, &mUseOnlyOnNetworkDiscovery);
break;
case PairingMode::Ble:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("discriminator", 0, 4096, &mDiscriminator);
break;
case PairingMode::OnNetwork:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("pase-only", 0, 1, &mPaseOnly);
break;
case PairingMode::SoftAP:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("discriminator", 0, 4096, &mDiscriminator);
AddArgument("device-remote-ip", &mRemoteAddr);
AddArgument("device-remote-port", 0, UINT16_MAX, &mRemotePort);
AddArgument("pase-only", 0, 1, &mPaseOnly);
break;
case PairingMode::Ethernet:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("discriminator", 0, 4096, &mDiscriminator);
AddArgument("device-remote-ip", &mRemoteAddr);
Expand Down Expand Up @@ -169,6 +174,7 @@ class PairingCommand : public CHIPCommand,
chip::Optional<bool> mDiscoverOnce;
chip::Optional<bool> mUseOnlyOnNetworkDiscovery;
chip::Optional<bool> mPaseOnly;
chip::Optional<bool> mSkipCommissioningComplete;
uint16_t mRemotePort;
uint16_t mDiscriminator;
uint32_t mSetupPINCode;
Expand Down

0 comments on commit 1316506

Please sign in to comment.