mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
0841be04fd
This commit enhances the radio URL parsing logic to detect and fail when unused parameters are provided in the URL. This prevents typos or unsupported parameters from being silently ignored. The following changes were made: - Updated ot::Url::Url to track parameter usage by appending a trailing '&' delimiter in Init() and replacing it with '\0' in GetValue() when a parameter is matched. This marks the parameter as used and removes any limit on the number of trackable parameters. - Added a Validate() method to ot::Url::Url to verify that all parameters in the query string were accessed. - Refactored ot::Posix::Radio to share a single RadioUrl instance with SpinelManager, ensuring all components track usage on the same URL object. - Integrated Validate() calls in otSysInit() and platformTrelInit() to perform validation after all platform components have been initialized. - Updated Radio::ProcessMaxPowerTable to use a local copy of the parameter string to avoid premature modification of the URL buffer. - Adjusted RadioUrl and unit tests to provide sufficient buffer space for the additional tracking delimiter. - Added new unit tests in tests/unit/test_url.cpp to verify the usage tracking and validation logic.