mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
[br-tracker] enhance NetDataBrTracker to support filtering (#11964)
This change enhances `NetDataBrTracker` to support filtering of Border Routers. The `NetDataPeerBrTracker` is renamed to `NetDataBrTracker` to reflect that it can now track all Border Routers, not just peers. A new `Filter` enum is introduced with `kAllBorderRouters` and `kExcludeThisDevice` options. This allows callers to specify whether to include the current device in the list of Border Routers. The `CountPeerBrs()` and `GetNext()` methods are updated to `CountBrs()` and `GetNext()` respectively, and now accept a `Filter` parameter. This change provides more flexibility to the `NetDataBrTracker` and makes the code more reusable. The unit tests are also updated to clean up resources to avoid heap allocation leaks at the end of tests.
This commit is contained in:
committed by
GitHub
parent
14373d5543
commit
7bbdbc69ce
@@ -163,7 +163,7 @@ void Notifier::EmitEvents(void)
|
||||
#if OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
|
||||
Get<BorderRouter::RoutingManager>().HandleNotifierEvents(events);
|
||||
#if OPENTHREAD_CONFIG_BORDER_ROUTING_TRACK_PEER_BR_INFO_ENABLE
|
||||
Get<BorderRouter::NetDataPeerBrTracker>().HandleNotifierEvents(events);
|
||||
Get<BorderRouter::NetDataBrTracker>().HandleNotifierEvents(events);
|
||||
#endif
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE
|
||||
|
||||
Reference in New Issue
Block a user