Skip to content

Commit

Permalink
Use timeout from PerformCommissioningStep for kReadCommissioningInfo …
Browse files Browse the repository at this point in the history
…reads (#36812)

Fixes #36803
  • Loading branch information
ksperling-apple authored Dec 12, 2024
1 parent 7ceaf6f commit 75ab4c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/controller/CHIPDeviceController.h
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController,
DeviceProxy * mDeviceBeingCommissioned = nullptr;
CommissioneeDeviceProxy * mDeviceInPASEEstablishment = nullptr;

Optional<System::Clock::Timeout> mCommissioningStepTimeout; // Note: For multi-interaction steps this is per interaction
CommissioningStage mCommissioningStage = CommissioningStage::kSecurePairing;
uint8_t mReadCommissioningInfoProgress = 0; // see ContinueReadingCommissioningInfo()

Expand Down

0 comments on commit 75ab4c9

Please sign in to comment.