From c9ce2d42e9270a108a3dd86c99f81b4d84f6545b Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Fri, 17 Jan 2020 12:49:17 -0800 Subject: [PATCH] [mle] rename static method to ChildIdFromRloc16() from GetChildId() (#4486) --- src/core/thread/mle.hpp | 6 +++--- src/core/thread/mle_router.cpp | 4 ++-- src/core/thread/network_diagnostic.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/thread/mle.hpp b/src/core/thread/mle.hpp index 40c4d38cf..a2b03b935 100644 --- a/src/core/thread/mle.hpp +++ b/src/core/thread/mle.hpp @@ -916,14 +916,14 @@ public: otError GetLeaderData(otLeaderData &aLeaderData); /** - * This method returns the Child ID portion of an RLOC16. + * This method derives the Child ID from a given RLOC16. * * @param[in] aRloc16 The RLOC16 value. * * @returns The Child ID portion of an RLOC16. * */ - static uint16_t GetChildId(uint16_t aRloc16) { return aRloc16 & kMaxChildId; } + static uint16_t ChildIdFromRloc16(uint16_t aRloc16) { return aRloc16 & kMaxChildId; } /** * This method derives the Router ID portion from a given RLOC16. @@ -1010,7 +1010,7 @@ public: * @retval FALSE If @p aRloc16 does not refer to an active router. * */ - static bool IsActiveRouter(uint16_t aRloc16) { return GetChildId(aRloc16) == 0; } + static bool IsActiveRouter(uint16_t aRloc16) { return ChildIdFromRloc16(aRloc16) == 0; } /** * This method fills the NetworkDataTlv. diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 17b135a81..f3cccb454 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -3501,7 +3501,7 @@ otError MleRouter::GetChildInfoById(uint16_t aChildId, otChildInfo &aChildInfo) if ((aChildId & ~kMaxChildId) != 0) { - aChildId = GetChildId(aChildId); + aChildId = ChildIdFromRloc16(aChildId); } rloc16 = Get().GetShortAddress() | aChildId; @@ -3652,7 +3652,7 @@ otError MleRouter::GetChildInfo(Child &aChild, otChildInfo &aChildInfo) aChildInfo.mExtAddress = aChild.GetExtAddress(); aChildInfo.mTimeout = aChild.GetTimeout(); aChildInfo.mRloc16 = aChild.GetRloc16(); - aChildInfo.mChildId = GetChildId(aChild.GetRloc16()); + aChildInfo.mChildId = ChildIdFromRloc16(aChild.GetRloc16()); aChildInfo.mNetworkDataVersion = aChild.GetNetworkDataVersion(); aChildInfo.mAge = Time::MsecToSec(TimerMilli::GetNow() - aChild.GetLastHeard()); aChildInfo.mLinkQualityIn = aChild.GetLinkInfo().GetLinkQuality(); diff --git a/src/core/thread/network_diagnostic.cpp b/src/core/thread/network_diagnostic.cpp index 034e3481f..99afd3881 100644 --- a/src/core/thread/network_diagnostic.cpp +++ b/src/core/thread/network_diagnostic.cpp @@ -261,7 +261,7 @@ otError NetworkDiagnostic::AppendChildTable(Message &aMessage) entry.SetReserved(0); entry.SetTimeout(timeout + 4); - entry.SetChildId(Mle::Mle::GetChildId(child.GetRloc16())); + entry.SetChildId(Mle::Mle::ChildIdFromRloc16(child.GetRloc16())); entry.SetMode(child.GetDeviceMode()); SuccessOrExit(error = aMessage.Append(&entry, sizeof(ChildTableEntry)));