-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Give commissionees at least ScanMaxTimeSeconds when asking for network scans. #40711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…k scans. We were just doing the 30-second default instead of checking what ScanMaxTimeSeconds is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the commissioning process to properly respect the ScanMaxTimeSeconds
attribute when performing network scans, instead of using a hardcoded 30-second default timeout.
- Adds reading of the
ScanMaxTimeSeconds
attribute during commissioning info collection - Implements proper timeout handling for network scan operations based on the retrieved values
- Fixes a typo in an error message
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/controller/CommissioningDelegate.h | Adds maxScanTime field to NetworkClusterInfo struct to store scan timeout values |
src/controller/CHIPDeviceController.cpp | Implements reading of ScanMaxTimeSeconds attribute and fixes error message typo |
src/controller/AutoCommissioner.cpp | Uses the retrieved scan timeout values for kScanNetworks commissioning stage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly implements the use of ScanMaxTimeSeconds
from the commissionee for network scans, replacing the previous hardcoded timeout. The changes are logical and well-contained. I have one suggestion to improve maintainability by refactoring duplicated code in src/controller/CHIPDeviceController.cpp
.
PR #40711: Size comparison from f1631b6 to bde2d56 Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40711 +/- ##
==========================================
+ Coverage 50.71% 50.73% +0.01%
==========================================
Files 1355 1356 +1
Lines 99303 99358 +55
Branches 12877 12873 -4
==========================================
+ Hits 50366 50409 +43
- Misses 48937 48949 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
} | ||
return return_err; | ||
} | ||
|
||
CHIP_ERROR DeviceCommissioner::ParseNetworkCommissioningTimeouts(NetworkClusterInfo & networkInfo, const char * networkType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the network type string ? It's used for logging info. Is it safe to use if a non null terminated buffer is passed
We were just doing the 30-second default instead of checking what ScanMaxTimeSeconds is.
Testing
Manual for now; we have no good way to test things with specific ScanMaxTimeSeconds values.