Skip to content

Commit

Permalink
[yaml] Add discoverOnce as an optional argument to CommissionerComman…
Browse files Browse the repository at this point in the history
…ds::PairWithCode (#25048)

* [yaml] Add discoverOnce as an optional argument to CommissionerCommands::PairWithCode

* Update zap version

* Add ClustersWithShutdownFunctions to config-data.yaml in order to get ZAP to run

* Update generated simulated clusters code
  • Loading branch information
vivien-apple authored and pull[bot] committed Aug 25, 2023
1 parent 3fdcdd9 commit 1137196
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-cert-bins/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG COMMITHASH=7b99e6399c6069037c613782d78132c69b9dcabb
# ZAP Development install, so that it runs on both x64 and arm64
# Generally this should match with the ZAP version that is used for codegen within the
# specified SHA
ARG ZAP_VERSION=v2023.02.09-nightly
ARG ZAP_VERSION=v2023.02.16-nightly

# Ensure TARGETPLATFORM is set
RUN case ${TARGETPLATFORM} in \
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup/zap.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"mac-arm64",
"windows-amd64"
],
"tags": ["version:[email protected].09-nightly.1"]
"tags": ["version:[email protected].16-nightly.1"]
}
]
}
2 changes: 1 addition & 1 deletion scripts/tools/zap/zap_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Use scripts/tools/zap/version_update.py to manage ZAP versioning as many
# files may need updating for versions
#
MIN_ZAP_VERSION = '2023.2.9'
MIN_ZAP_VERSION = '2023.2.16'


class ZapTool:
Expand Down
2 changes: 2 additions & 0 deletions src/app/common/templates/config-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ ClustersWithPreAttributeChangeFunctions:
- Mode Select
- Fan Control
- Thermostat

ClustersWithShutdownFunctions: []
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ CommissionerCommands::PairWithCode(const char * identity,
memcpy(code, value.payload.data(), value.payload.size());
ChipLogError(chipTool, "Pairing Code is %s", code);

mDiscoverOnce = value.discoverOnce;

// To reduce the scanning latency in some setups, and since the primary use for PairWithCode is to commission a device to
// another commissioner, assume that the commissionable device is available on the network.
chip::Controller::DiscoveryType discoveryType = chip::Controller::DiscoveryType::kDiscoveryNetworkOnly;
Expand Down Expand Up @@ -128,6 +130,11 @@ void CommissionerCommands::OnStatusUpdate(DevicePairingDelegate::Status status)
OnResponse(ConvertToStatusIB(CHIP_ERROR_INCORRECT_STATE), nullptr);
break;
case DevicePairingDelegate::Status::SecurePairingDiscoveringMoreDevices:
if (mDiscoverOnce.ValueOr(false))
{
ChipLogError(chipTool, "Secure Pairing Failed");
OnResponse(ConvertToStatusIB(CHIP_ERROR_INCORRECT_STATE), nullptr);
}
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ class CommissionerCommands : public chip::Controller::DevicePairingDelegate
void OnPairingComplete(CHIP_ERROR error) override;
void OnPairingDeleted(CHIP_ERROR error) override;
void OnCommissioningComplete(chip::NodeId deviceId, CHIP_ERROR error) override;

private:
chip::Optional<bool> mDiscoverOnce;
};

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

0 comments on commit 1137196

Please sign in to comment.