mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 23:27:46 +00:00
[router-table] remove duplicate method (#8434)
This commit removes `RouterTable::GetActiveLinkCount()` and uses `GetNeighborCount()` instead (which does the same).
This commit is contained in:
@@ -1406,7 +1406,7 @@ Error MleRouter::HandleAdvertisement(RxInfo &aRxInfo)
|
||||
VerifyOrExit(router != nullptr);
|
||||
|
||||
if (IsFullThreadDevice() && !router->IsStateValid() && !router->IsStateLinkRequest() &&
|
||||
(mRouterTable.GetActiveLinkCount() < OPENTHREAD_CONFIG_MLE_CHILD_ROUTER_LINKS))
|
||||
(mRouterTable.GetNeighborCount() < OPENTHREAD_CONFIG_MLE_CHILD_ROUTER_LINKS))
|
||||
{
|
||||
router->SetExtAddress(extAddr);
|
||||
router->GetLinkInfo().Clear();
|
||||
|
||||
@@ -342,21 +342,6 @@ void RouterTable::RemoveRouterLink(Router &aRouter)
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t RouterTable::GetActiveLinkCount(void) const
|
||||
{
|
||||
uint8_t activeLinks = 0;
|
||||
|
||||
for (const Router *router = GetFirstEntry(); router != nullptr; router = GetNextEntry(router))
|
||||
{
|
||||
if (router->IsStateValid())
|
||||
{
|
||||
activeLinks++;
|
||||
}
|
||||
}
|
||||
|
||||
return activeLinks;
|
||||
}
|
||||
|
||||
const Router *RouterTable::FindRouter(const Router::AddressMatcher &aMatcher) const
|
||||
{
|
||||
const Router *router;
|
||||
|
||||
@@ -147,14 +147,6 @@ public:
|
||||
*/
|
||||
uint8_t GetActiveRouterCount(void) const { return mActiveRouterCount; }
|
||||
|
||||
/**
|
||||
* This method returns the number of active links with neighboring routers.
|
||||
*
|
||||
* @returns The number of active links with neighboring routers.
|
||||
*
|
||||
*/
|
||||
uint8_t GetActiveLinkCount(void) const;
|
||||
|
||||
/**
|
||||
* This method returns the leader in the Thread network.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user