mirror of
https://github.com/espressif/openthread.git
synced 2026-09-14 13:10:08 +00:00
[mle] rename static method to ChildIdFromRloc16() from GetChildId() (#4486)
This commit is contained in:
committed by
Jonathan Hui
parent
b7a56cdfd7
commit
c9ce2d42e9
@@ -916,14 +916,14 @@ public:
|
|||||||
otError GetLeaderData(otLeaderData &aLeaderData);
|
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.
|
* @param[in] aRloc16 The RLOC16 value.
|
||||||
*
|
*
|
||||||
* @returns The Child ID portion of an RLOC16.
|
* @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.
|
* 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.
|
* @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.
|
* This method fills the NetworkDataTlv.
|
||||||
|
|||||||
@@ -3501,7 +3501,7 @@ otError MleRouter::GetChildInfoById(uint16_t aChildId, otChildInfo &aChildInfo)
|
|||||||
|
|
||||||
if ((aChildId & ~kMaxChildId) != 0)
|
if ((aChildId & ~kMaxChildId) != 0)
|
||||||
{
|
{
|
||||||
aChildId = GetChildId(aChildId);
|
aChildId = ChildIdFromRloc16(aChildId);
|
||||||
}
|
}
|
||||||
|
|
||||||
rloc16 = Get<Mac::Mac>().GetShortAddress() | aChildId;
|
rloc16 = Get<Mac::Mac>().GetShortAddress() | aChildId;
|
||||||
@@ -3652,7 +3652,7 @@ otError MleRouter::GetChildInfo(Child &aChild, otChildInfo &aChildInfo)
|
|||||||
aChildInfo.mExtAddress = aChild.GetExtAddress();
|
aChildInfo.mExtAddress = aChild.GetExtAddress();
|
||||||
aChildInfo.mTimeout = aChild.GetTimeout();
|
aChildInfo.mTimeout = aChild.GetTimeout();
|
||||||
aChildInfo.mRloc16 = aChild.GetRloc16();
|
aChildInfo.mRloc16 = aChild.GetRloc16();
|
||||||
aChildInfo.mChildId = GetChildId(aChild.GetRloc16());
|
aChildInfo.mChildId = ChildIdFromRloc16(aChild.GetRloc16());
|
||||||
aChildInfo.mNetworkDataVersion = aChild.GetNetworkDataVersion();
|
aChildInfo.mNetworkDataVersion = aChild.GetNetworkDataVersion();
|
||||||
aChildInfo.mAge = Time::MsecToSec(TimerMilli::GetNow() - aChild.GetLastHeard());
|
aChildInfo.mAge = Time::MsecToSec(TimerMilli::GetNow() - aChild.GetLastHeard());
|
||||||
aChildInfo.mLinkQualityIn = aChild.GetLinkInfo().GetLinkQuality();
|
aChildInfo.mLinkQualityIn = aChild.GetLinkInfo().GetLinkQuality();
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ otError NetworkDiagnostic::AppendChildTable(Message &aMessage)
|
|||||||
entry.SetReserved(0);
|
entry.SetReserved(0);
|
||||||
entry.SetTimeout(timeout + 4);
|
entry.SetTimeout(timeout + 4);
|
||||||
|
|
||||||
entry.SetChildId(Mle::Mle::GetChildId(child.GetRloc16()));
|
entry.SetChildId(Mle::Mle::ChildIdFromRloc16(child.GetRloc16()));
|
||||||
entry.SetMode(child.GetDeviceMode());
|
entry.SetMode(child.GetDeviceMode());
|
||||||
|
|
||||||
SuccessOrExit(error = aMessage.Append(&entry, sizeof(ChildTableEntry)));
|
SuccessOrExit(error = aMessage.Append(&entry, sizeof(ChildTableEntry)));
|
||||||
|
|||||||
Reference in New Issue
Block a user