Skip to content

Commit b47f90a

Browse files
authored
Replace PairWithQRCode/PairWithManualCode with PairWithCode since the setup pairer internaly distinguish both (project-chip#18552)
* Replace PairWithQRCode/PairWithManualCode with PairWithCode since the setup pairer internaly distinguish both * Update generated content
1 parent 8a872fd commit b47f90a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+197
-320
lines changed

examples/chip-tool-darwin/commands/pairing/Commands.h

+4-10
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,10 @@
2020

2121
#include "PairingCommandBridge.h"
2222

23-
class PairQRCode : public PairingCommandBridge
23+
class PairCode : public PairingCommandBridge
2424
{
2525
public:
26-
PairQRCode() : PairingCommandBridge("qrcode", PairingMode::QRCode, PairingNetworkType::None) {}
27-
};
28-
29-
class PairManualCode : public PairingCommandBridge
30-
{
31-
public:
32-
PairManualCode() : PairingCommandBridge("manualcode", PairingMode::ManualCode, PairingNetworkType::None) {}
26+
PairCode() : PairingCommandBridge("code", PairingMode::Code, PairingNetworkType::None) {}
3327
};
3428

3529
class PairWithIPAddress : public PairingCommandBridge
@@ -61,8 +55,8 @@ void registerCommandsPairing(Commands & commands)
6155
const char * clusterName = "Pairing";
6256

6357
commands_list clusterCommands = {
64-
make_unique<PairQRCode>(), make_unique<PairManualCode>(), make_unique<PairWithIPAddress>(),
65-
make_unique<PairBleWiFi>(), make_unique<PairBleThread>(), make_unique<Unpair>(),
58+
make_unique<PairCode>(), make_unique<PairWithIPAddress>(), make_unique<PairBleWiFi>(), make_unique<PairBleThread>(),
59+
make_unique<Unpair>(),
6660
};
6761

6862
commands.Register(clusterName, clusterCommands);

examples/chip-tool-darwin/commands/pairing/PairingCommandBridge.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
enum class PairingMode
2424
{
2525
None,
26-
QRCode,
27-
ManualCode,
26+
Code,
2827
Ethernet,
2928
Ble,
3029
};
@@ -62,10 +61,7 @@ class PairingCommandBridge : public CHIPCommandBridge
6261
{
6362
case PairingMode::None:
6463
break;
65-
case PairingMode::QRCode:
66-
AddArgument("payload", &mOnboardingPayload);
67-
break;
68-
case PairingMode::ManualCode:
64+
case PairingMode::Code:
6965
AddArgument("payload", &mOnboardingPayload);
7066
break;
7167
case PairingMode::Ethernet:

examples/chip-tool-darwin/commands/pairing/PairingCommandBridge.mm

+1-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@
6161
case PairingMode::None:
6262
Unpair();
6363
break;
64-
case PairingMode::QRCode:
65-
case PairingMode::ManualCode:
64+
case PairingMode::Code:
6665
PairWithPayload(&error);
6766
break;
6867
case PairingMode::Ethernet:

examples/chip-tool-darwin/commands/tests/TestCommandBridge.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ class TestCommandBridge : public CHIPCommandBridge,
143143
}
144144

145145
/////////// CommissionerCommands-like Interface /////////
146-
CHIP_ERROR PairWithQRCode(
147-
const char * _Nullable identity, const chip::app::Clusters::CommissionerCommands::Commands::PairWithQRCode::Type & value)
146+
CHIP_ERROR PairWithCode(
147+
const char * _Nullable identity, const chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type & value)
148148
{
149149
CHIPDeviceController * controller = GetCommissioner(identity);
150150
VerifyOrReturnError(controller != nil, CHIP_ERROR_INCORRECT_STATE);

examples/chip-tool/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ The command below will discover devices based on the given QR code (which
111111
devices log when they start up) and try to pair with the first one it discovers.
112112

113113
```
114-
$ chip-tool pairing qrcode ${NODE_ID_TO_ASSIGN} MT:#######
114+
$ chip-tool pairing code ${NODE_ID_TO_ASSIGN} MT:#######
115115
```
116116

117117
In all these cases, the device will be assigned node id `${NODE_ID_TO_ASSIGN}`

examples/chip-tool/commands/pairing/Commands.h

+16-52
Original file line numberDiff line numberDiff line change
@@ -34,67 +34,35 @@ class Unpair : public PairingCommand
3434
{}
3535
};
3636

37-
class PairQRCode : public PairingCommand
37+
class PairCode : public PairingCommand
3838
{
3939
public:
40-
PairQRCode(CredentialIssuerCommands * credsIssuerConfig) :
41-
PairingCommand("qrcode", PairingMode::QRCode, PairingNetworkType::None, credsIssuerConfig)
40+
PairCode(CredentialIssuerCommands * credsIssuerConfig) :
41+
PairingCommand("code", PairingMode::Code, PairingNetworkType::None, credsIssuerConfig)
4242
{}
4343
};
4444

45-
class PairQRCodePase : public PairingCommand
45+
class PairCodePase : public PairingCommand
4646
{
4747
public:
48-
PairQRCodePase(CredentialIssuerCommands * credsIssuerConfig) :
49-
PairingCommand("qrcode-paseonly", PairingMode::QRCodePaseOnly, PairingNetworkType::None, credsIssuerConfig)
48+
PairCodePase(CredentialIssuerCommands * credsIssuerConfig) :
49+
PairingCommand("code-paseonly", PairingMode::CodePaseOnly, PairingNetworkType::None, credsIssuerConfig)
5050
{}
5151
};
5252

53-
class PairQRCodeWifi : public PairingCommand
53+
class PairCodeWifi : public PairingCommand
5454
{
5555
public:
56-
PairQRCodeWifi(CredentialIssuerCommands * credsIssuerConfig) :
57-
PairingCommand("qrcode-wifi", PairingMode::QRCode, PairingNetworkType::WiFi, credsIssuerConfig)
56+
PairCodeWifi(CredentialIssuerCommands * credsIssuerConfig) :
57+
PairingCommand("code-wifi", PairingMode::Code, PairingNetworkType::WiFi, credsIssuerConfig)
5858
{}
5959
};
6060

61-
class PairQRCodeThread : public PairingCommand
61+
class PairCodeThread : public PairingCommand
6262
{
6363
public:
64-
PairQRCodeThread(CredentialIssuerCommands * credsIssuerConfig) :
65-
PairingCommand("qrcode-thread", PairingMode::QRCode, PairingNetworkType::Thread, credsIssuerConfig)
66-
{}
67-
};
68-
69-
class PairManualCode : public PairingCommand
70-
{
71-
public:
72-
PairManualCode(CredentialIssuerCommands * credsIssuerConfig) :
73-
PairingCommand("manualcode", PairingMode::ManualCode, PairingNetworkType::None, credsIssuerConfig)
74-
{}
75-
};
76-
77-
class PairManualCodePase : public PairingCommand
78-
{
79-
public:
80-
PairManualCodePase(CredentialIssuerCommands * credsIssuerConfig) :
81-
PairingCommand("manualcode-paseonly", PairingMode::ManualCodePaseOnly, PairingNetworkType::None, credsIssuerConfig)
82-
{}
83-
};
84-
85-
class PairManualCodeWifi : public PairingCommand
86-
{
87-
public:
88-
PairManualCodeWifi(CredentialIssuerCommands * credsIssuerConfig) :
89-
PairingCommand("manualcode-wifi", PairingMode::ManualCode, PairingNetworkType::WiFi, credsIssuerConfig)
90-
{}
91-
};
92-
93-
class PairManualCodeThread : public PairingCommand
94-
{
95-
public:
96-
PairManualCodeThread(CredentialIssuerCommands * credsIssuerConfig) :
97-
PairingCommand("manualcode-thread", PairingMode::ManualCode, PairingNetworkType::Thread, credsIssuerConfig)
64+
PairCodeThread(CredentialIssuerCommands * credsIssuerConfig) :
65+
PairingCommand("code-thread", PairingMode::Code, PairingNetworkType::Thread, credsIssuerConfig)
9866
{}
9967
};
10068

@@ -229,14 +197,10 @@ void registerCommandsPairing(Commands & commands, CredentialIssuerCommands * cre
229197

230198
commands_list clusterCommands = {
231199
make_unique<Unpair>(credsIssuerConfig),
232-
make_unique<PairQRCode>(credsIssuerConfig),
233-
make_unique<PairQRCodePase>(credsIssuerConfig),
234-
make_unique<PairQRCodeWifi>(credsIssuerConfig),
235-
make_unique<PairQRCodeThread>(credsIssuerConfig),
236-
make_unique<PairManualCode>(credsIssuerConfig),
237-
make_unique<PairManualCodePase>(credsIssuerConfig),
238-
make_unique<PairManualCodeWifi>(credsIssuerConfig),
239-
make_unique<PairManualCodeThread>(credsIssuerConfig),
200+
make_unique<PairCode>(credsIssuerConfig),
201+
make_unique<PairCodePase>(credsIssuerConfig),
202+
make_unique<PairCodeWifi>(credsIssuerConfig),
203+
make_unique<PairCodeThread>(credsIssuerConfig),
240204
make_unique<PairBleWiFi>(credsIssuerConfig),
241205
make_unique<PairBleThread>(credsIssuerConfig),
242206
make_unique<PairSoftAP>(credsIssuerConfig),

examples/chip-tool/commands/pairing/PairingCommand.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,10 @@ CHIP_ERROR PairingCommand::RunInternal(NodeId remoteId)
4545
case PairingMode::None:
4646
err = Unpair(remoteId);
4747
break;
48-
case PairingMode::QRCode:
48+
case PairingMode::Code:
4949
err = PairWithCode(remoteId);
5050
break;
51-
case PairingMode::ManualCode:
52-
err = PairWithCode(remoteId);
53-
break;
54-
case PairingMode::QRCodePaseOnly:
55-
case PairingMode::ManualCodePaseOnly:
51+
case PairingMode::CodePaseOnly:
5652
err = PaseWithCode(remoteId);
5753
break;
5854
case PairingMode::Ble:
@@ -160,7 +156,7 @@ void PairingCommand::OnPairingComplete(CHIP_ERROR err)
160156
if (err == CHIP_NO_ERROR)
161157
{
162158
ChipLogProgress(chipTool, "Pairing Success");
163-
if (mPairingMode == PairingMode::QRCodePaseOnly || mPairingMode == PairingMode::ManualCodePaseOnly)
159+
if (mPairingMode == PairingMode::CodePaseOnly)
164160
{
165161
SetCommandExitStatus(err);
166162
}

examples/chip-tool/commands/pairing/PairingCommand.h

+4-8
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
enum class PairingMode
3030
{
3131
None,
32-
QRCode,
33-
ManualCode,
34-
QRCodePaseOnly,
35-
ManualCodePaseOnly,
32+
Code,
33+
CodePaseOnly,
3634
Ble,
3735
SoftAP,
3836
Ethernet,
@@ -79,10 +77,8 @@ class PairingCommand : public CHIPCommand,
7977
{
8078
case PairingMode::None:
8179
break;
82-
case PairingMode::QRCode:
83-
case PairingMode::ManualCode:
84-
case PairingMode::QRCodePaseOnly:
85-
case PairingMode::ManualCodePaseOnly:
80+
case PairingMode::Code:
81+
case PairingMode::CodePaseOnly:
8682
AddArgument("payload", &mOnboardingPayload);
8783
break;
8884
case PairingMode::Ble:

examples/light-switch-app/telink/Readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ following states:
7676
2. Pair with device
7777

7878
```
79-
${CHIP_TOOL_DIR}/chip-tool pairing qrcode ${NODE_ID_TO_ASSIGN} MT:D8XA0CQM00KA0648G00
79+
${CHIP_TOOL_DIR}/chip-tool pairing code ${NODE_ID_TO_ASSIGN} MT:D8XA0CQM00KA0648G00
8080
```
8181

8282
here:

examples/lighting-app/telink/Readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ following states:
7878
1. Pair with device
7979

8080
```
81-
${CHIP_TOOL_DIR}/chip-tool pairing qrcode ${NODE_ID_TO_ASSIGN} MT:D8XA0CQM00KA0648G00
81+
${CHIP_TOOL_DIR}/chip-tool pairing code ${NODE_ID_TO_ASSIGN} MT:D8XA0CQM00KA0648G00
8282
```
8383

8484
here:

scripts/tests/chiptest/test_definition.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def Run(self, runner, apps_register, paths: ApplicationPaths, pics_file: str):
263263
# Only start and pair the default app
264264
app = apps_register.get('default')
265265
app.start()
266-
pairing_cmd = tool_cmd + ['pairing', 'qrcode', TEST_NODE_ID, app.setupCode]
266+
pairing_cmd = tool_cmd + ['pairing', 'code', TEST_NODE_ID, app.setupCode]
267267
if sys.platform != 'darwin':
268268
pairing_cmd.append('--paa-trust-store-path')
269269
pairing_cmd.append(DEVELOPMENT_PAA_LIST)

src/app/tests/suites/OTA_SuccessfulTransfer.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ tests:
7979
- label: "Commission the provider from alpha"
8080
identity: "alpha"
8181
cluster: "CommissionerCommands"
82-
command: "PairWithQRCode"
82+
command: "PairWithCode"
8383
arguments:
8484
values:
8585
- name: "nodeId"

src/app/tests/suites/TestClusterMultiFabric.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ tests:
4646
- label: "Commission from beta"
4747
identity: "beta"
4848
cluster: "CommissionerCommands"
49-
command: "PairWithQRCode"
49+
command: "PairWithCode"
5050
arguments:
5151
values:
5252
- name: "nodeId"

src/app/tests/suites/TestGeneralCommissioning.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ tests:
141141
- label: "Commission from beta"
142142
identity: "beta"
143143
cluster: "CommissionerCommands"
144-
command: "PairWithQRCode"
144+
command: "PairWithCode"
145145
arguments:
146146
values:
147147
- name: "nodeId"

src/app/tests/suites/TestMultiAdmin.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ tests:
5959
- label: "Commission from alpha when the commissioning window is not opened"
6060
identity: "alpha"
6161
cluster: "CommissionerCommands"
62-
command: "PairWithQRCode"
62+
command: "PairWithCode"
6363
arguments:
6464
values:
6565
- name: "nodeId"
@@ -81,7 +81,7 @@ tests:
8181
- label: "Commission from alpha again"
8282
identity: "alpha"
8383
cluster: "CommissionerCommands"
84-
command: "PairWithQRCode"
84+
command: "PairWithCode"
8585
arguments:
8686
values:
8787
- name: "nodeId"
@@ -118,7 +118,7 @@ tests:
118118
- label: "Commission from beta"
119119
identity: "beta"
120120
cluster: "CommissionerCommands"
121-
command: "PairWithQRCode"
121+
command: "PairWithCode"
122122
arguments:
123123
values:
124124
- name: "nodeId"
@@ -148,7 +148,7 @@ tests:
148148
- label: "Commission from gamma"
149149
identity: "gamma"
150150
cluster: "CommissionerCommands"
151-
command: "PairWithQRCode"
151+
command: "PairWithCode"
152152
arguments:
153153
values:
154154
- name: "nodeId"

src/app/tests/suites/TestSystemCommands.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ tests:
110110
- label: "Commission second accessory from alpha"
111111
identity: "alpha"
112112
cluster: "CommissionerCommands"
113-
command: "PairWithQRCode"
113+
command: "PairWithCode"
114114
arguments:
115115
values:
116116
- name: "nodeId"

src/app/tests/suites/certification/Test_TC_DD_3_11.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ tests:
3636
to complete the commissioning process."
3737
verification: |
3838
DUT Commissioner:
39-
sudo ./examples/chip-tool/out/debug/chip-tool pairing qrcode 1234 MT:-24J042C00KA0648G00
39+
sudo ./examples/chip-tool/out/debug/chip-tool pairing code 1234 MT:-24J042C00KA0648G00
4040
4141
...
4242
@@ -76,7 +76,7 @@ tests:
7676
complete the commissioning process using BLE"
7777
verification: |
7878
DUT Commissioner:
79-
sudo ./examples/chip-tool/out/debug/chip-tool pairing qrcode 1234 MT:-24J042C00KA0648G00
79+
sudo ./examples/chip-tool/out/debug/chip-tool pairing code 1234 MT:-24J042C00KA0648G00
8080
8181
...
8282
@@ -116,7 +116,7 @@ tests:
116116
commissioning process using IP Network"
117117
verification: |
118118
DUT Commissioner:
119-
sudo ./examples/chip-tool/out/debug/chip-tool pairing qrcode 1234 MT:-24J042C00KA0648G00
119+
sudo ./examples/chip-tool/out/debug/chip-tool pairing code 1234 MT:-24J042C00KA0648G00
120120
121121
...
122122

0 commit comments

Comments
 (0)