mirror of
https://github.com/espressif/openthread.git
synced 2026-08-13 22:27:47 +00:00
[topology] adding 'Neighbor::AddressMatcher' (#5354)
This commit adds new a type `Neighbor::AddressMactehr` which is used to filter and find a neighbor (child/router) with a given MAC address matching a given `Neighbor::StateFilter`. This new type helps simplify related code in `ChildTable`/`RouterTbale`.
This commit is contained in:
committed by
Jonathan Hui
parent
5bac12f9d6
commit
6c75a53bdc
@@ -96,9 +96,17 @@ static bool StateMatchesFilter(Child::State aState, Child::StateFilter aFilter)
|
||||
rval = child.IsStateValidOrAttaching();
|
||||
break;
|
||||
|
||||
case Child::kInStateInvalid:
|
||||
rval = child.IsStateInvalid();
|
||||
break;
|
||||
|
||||
case Child::kInStateAnyExceptValidOrRestoring:
|
||||
rval = !child.IsStateValidOrRestoring();
|
||||
break;
|
||||
|
||||
case Child::kInStateAny:
|
||||
rval = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return rval;
|
||||
|
||||
Reference in New Issue
Block a user