mirror of
https://github.com/espressif/openthread.git
synced 2026-09-04 16:20:05 +00:00
[nexus] add helper to allow link between nodes in nexus (#12906)
Added `Core::AllowLinkBetween()` and `Core::UnallowLinkBetween()` helper methods to the Nexus test platform. These methods simplify establishing bidirectional links between nodes in simulation tests by handling the reciprocal `AllowList()` calls in a single step. Updated various Nexus test cases to utilize these new helpers, replacing manual bidirectional `AllowList()` calls. This change reduces verbosity and ensures consistency in how links are established in the test topology.
This commit is contained in:
@@ -251,5 +251,17 @@ bool Node::Matches(const Ip6::Address &aAddress, AddressNetif aNetif) const
|
||||
return matches;
|
||||
}
|
||||
|
||||
void AllowLinkBetween(Node &aFirstNode, Node &aSecondNode)
|
||||
{
|
||||
aFirstNode.AllowList(aSecondNode);
|
||||
aSecondNode.AllowList(aFirstNode);
|
||||
}
|
||||
|
||||
void UnallowLinkBetween(Node &aFirstNode, Node &aSecondNode)
|
||||
{
|
||||
aFirstNode.UnallowList(aSecondNode);
|
||||
aSecondNode.UnallowList(aFirstNode);
|
||||
}
|
||||
|
||||
} // namespace Nexus
|
||||
} // namespace ot
|
||||
|
||||
Reference in New Issue
Block a user