From 75ab4c9a3fd2e519e5f6218f50ed79e677165d68 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:39:45 +1300 Subject: [PATCH] Use timeout from PerformCommissioningStep for kReadCommissioningInfo reads (#36812) Fixes #36803 --- src/controller/CHIPDeviceController.cpp | 10 +++++----- src/controller/CHIPDeviceController.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 1d0d36bd57f85e..e4b566f43b89db 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -2344,8 +2344,7 @@ void DeviceCommissioner::ContinueReadingCommissioningInfo(const CommissioningPar mReadCommissioningInfoProgress = kReadProgressNoFurtherAttributes; } - const auto timeout = MakeOptional(app::kExpectedIMProcessingTime); // TODO: Save timeout from PerformCommissioningStep? - SendCommissioningReadRequest(mDeviceBeingCommissioned, timeout, builder.paths(), builder.size()); + SendCommissioningReadRequest(mDeviceBeingCommissioned, mCommissioningStepTimeout, builder.paths(), builder.size()); } namespace { @@ -3004,9 +3003,10 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio params.GetCompletionStatus().err.AsString()); } - mCommissioningStage = step; - mCommissioningDelegate = delegate; - mDeviceBeingCommissioned = proxy; + mCommissioningStepTimeout = timeout; + mCommissioningStage = step; + mCommissioningDelegate = delegate; + mDeviceBeingCommissioned = proxy; // TODO: Extend timeouts to the DAC and Opcert requests. // TODO(cecille): We probably want something better than this for breadcrumbs. diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index 3d4b2fa17201f4..cf22b70d1f487f 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -838,6 +838,7 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, DeviceProxy * mDeviceBeingCommissioned = nullptr; CommissioneeDeviceProxy * mDeviceInPASEEstablishment = nullptr; + Optional mCommissioningStepTimeout; // Note: For multi-interaction steps this is per interaction CommissioningStage mCommissioningStage = CommissioningStage::kSecurePairing; uint8_t mReadCommissioningInfoProgress = 0; // see ContinueReadingCommissioningInfo()