mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
422f673c7c
This commit updates how `RoutePublisher` determines the published route preference: - Medium preference is used on a border router (BR) acting as a router or a BR acting as an end-device (ED) connected to a parent with link quality 3. - An ED BR with lower link quality publishes its route with low preference. For ED BRs, the preference is updated if the parent's link quality changes. However, to avoid frequent preference changes due to link variability, the following rules are used: - If the link quality goes to 1 or 2, the route preference is immediately changed to low. - On transition to link quality 3, we wait for 5 minutes before changing the preference to medium. - If the ED BR switches parents, the link quality to the new parent is used to determine preference. It also adds new APIs and related CLI commands to allow users to get and manually set the published route preference. A new test script `test-021-br-route-prf.py` is added to validate the selection of route preference by BR. This commit also adds a new mechanism to detect when the link quality to the parent changes and signal it using a newly added `Notifier` event.