diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 792df14307744c..9e7dad861ebfd1 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1714,9 +1714,7 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio GeneralCommissioningCluster genCom; // TODO: should get the endpoint information from the descriptor cluster. genCom.Associate(proxy, 0); - // TODO(cecille): Make this a parameter - uint16_t commissioningExpirySeconds = 60; - genCom.ArmFailSafe(mSuccess.Cancel(), mFailure.Cancel(), commissioningExpirySeconds, breadcrumb, kCommandTimeoutMs); + genCom.ArmFailSafe(mSuccess.Cancel(), mFailure.Cancel(), params.GetFailsafeTimerSeconds(), breadcrumb, kCommandTimeoutMs); } break; case CommissioningStage::kConfigRegulatory: { diff --git a/src/controller/CommissioningDelegate.h b/src/controller/CommissioningDelegate.h index 86133b9782e248..8eb6112e921651 100644 --- a/src/controller/CommissioningDelegate.h +++ b/src/controller/CommissioningDelegate.h @@ -61,11 +61,18 @@ class CommissioningParameters bool HasAttestationNonce() const { return mAttestationNonce.HasValue(); } bool HasWiFiCredentials() const { return mWiFiCreds.HasValue(); } bool HasThreadOperationalDataset() const { return mThreadOperationalDataset.HasValue(); } + uint16_t GetFailsafeTimerSeconds() const { return mFailsafeTimerSeconds; } const Optional GetCSRNonce() const { return mCSRNonce; } const Optional GetAttestationNonce() const { return mAttestationNonce; } const Optional GetWiFiCredentials() const { return mWiFiCreds; } const Optional GetThreadOperationalDataset() const { return mThreadOperationalDataset; } + CommissioningParameters & SetFailsafeTimerSeconds(uint16_t seconds) + { + mFailsafeTimerSeconds = seconds; + return *this; + } + // The lifetime of the buffer csrNonce is pointing to, should exceed the lifetime of CommissioningParameters object. CommissioningParameters & SetCSRNonce(ByteSpan csrNonce) { @@ -95,6 +102,7 @@ class CommissioningParameters CHIP_ERROR GetCompletionStatus() { return completionStatus; } private: + uint16_t mFailsafeTimerSeconds = 60; Optional mCSRNonce; ///< CSR Nonce passed by the commissioner Optional mAttestationNonce; ///< Attestation Nonce passed by the commissioner Optional mWiFiCreds;