Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Apr 20, 2022
1 parent c165aaf commit 3da3e60
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ jobs:
./scripts/run_in_build_env.sh \
"./scripts/tests/run_test_suite.py \
--chip-tool ./out/darwin-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \
--target-skip-glob '{TestGroupMessaging,TestArmFailSafe}' \
--target-skip-glob '{TestGroupMessaging}' \
run \
--iterations 1 \
--all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \
Expand Down
4 changes: 2 additions & 2 deletions src/app/tests/suites/TestArmFailSafe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ tests:
- label: "Commission from beta device"
identity: "beta"
cluster: "CommissionerCommands"
command: "PairDevice"
command: "PairWithTimeout"
arguments:
values:
- name: "nodeId"
value: nodeId2
- name: "payload"
value: payload
- name: "timeout"
- name: "failsafeTimeout"
value: 0
response:
error: UNSUPPORTED_ACCESS
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

constexpr uint16_t kPayloadMaxSize = 64;

CHIP_ERROR CommissionerCommands::PairDevice(chip::NodeId nodeId, const chip::CharSpan payload, uint16_t timeout)
CHIP_ERROR CommissionerCommands::PairWithTimeout(chip::NodeId nodeId, const chip::CharSpan payload, uint16_t failsafeTimeout)
{
VerifyOrReturnError(payload.size() > 0 && payload.size() < kPayloadMaxSize, CHIP_ERROR_INVALID_ARGUMENT);

Expand All @@ -30,7 +30,7 @@ CHIP_ERROR CommissionerCommands::PairDevice(chip::NodeId nodeId, const chip::Cha
memcpy(qrCode, payload.data(), payload.size());

chip::Controller::CommissioningParameters commissioningParams;
commissioningParams.SetFailsafeTimerSeconds(timeout);
commissioningParams.SetFailsafeTimerSeconds(failsafeTimeout);

return GetCurrentCommissioner().PairDevice(nodeId, qrCode, commissioningParams);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CommissionerCommands : public chip::Controller::DevicePairingDelegate
virtual CHIP_ERROR ContinueOnChipMainThread(CHIP_ERROR err) = 0;
virtual chip::Controller::DeviceCommissioner & GetCurrentCommissioner() = 0;

CHIP_ERROR PairDevice(chip::NodeId nodeId, const chip::CharSpan payload, uint16_t timeout);
CHIP_ERROR PairWithTimeout(chip::NodeId nodeId, const chip::CharSpan payload, uint16_t failsafeTimeout);
CHIP_ERROR PairWithQRCode(chip::NodeId nodeId, const chip::CharSpan payload);
CHIP_ERROR PairWithManualCode(chip::NodeId nodeId, const chip::CharSpan payload);
CHIP_ERROR Unpair(chip::NodeId nodeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
*
*/

const PairDevice = {
name : 'PairDevice',
arguments :
[ { type : 'NODE_ID', name : 'nodeId' }, { type : 'CHAR_STRING', name : 'payload' }, { type : 'INT16U', name : 'timeout' } ],
const PairWithTimeout = {
name : 'PairWithTimeout',
arguments : [
{ type : 'NODE_ID', name : 'nodeId' }, { type : 'CHAR_STRING', name : 'payload' }, { type : 'INT16U', name : 'failsafeTimeout' }
],
response : { arguments : [] }
};

Expand All @@ -50,7 +51,7 @@ const Unpair = {
};

const name = 'CommissionerCommands';
const commands = [ PairDevice, PairWithQRCode, PairWithManualCode, Unpair ];
const commands = [ PairWithTimeout, PairWithQRCode, PairWithManualCode, Unpair ];

const CommissionerCommands = {
name,
Expand Down
5 changes: 3 additions & 2 deletions zzz_generated/chip-tool/zap-generated/test/Commands.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3da3e60

Please sign in to comment.