[mle] inline simple getter methods (#3007)

This commit is contained in:
Abtin Keshavarzian
2018-08-31 08:57:54 -07:00
committed by Jonathan Hui
parent 5016af4cde
commit fdd770b8fc
4 changed files with 15 additions and 54 deletions
-40
View File
@@ -525,11 +525,6 @@ exit:
return error;
}
bool Mle::IsDiscoverInProgress(void)
{
return mIsDiscoverInProgress;
}
void Mle::HandleDiscoverComplete(void)
{
mIsDiscoverInProgress = false;
@@ -821,11 +816,6 @@ exit:
return error;
}
const Ip6::Address &Mle::GetLinkLocalAddress(void) const
{
return mLinkLocal64.GetAddress();
}
otError Mle::UpdateLinkLocalAddress(void)
{
ThreadNetif &netif = GetNetif();
@@ -839,11 +829,6 @@ otError Mle::UpdateLinkLocalAddress(void)
return OT_ERROR_NONE;
}
const otMeshLocalPrefix &Mle::GetMeshLocalPrefix(void) const
{
return reinterpret_cast<const otMeshLocalPrefix &>(mMeshLocal16.GetAddress());
}
otError Mle::SetMeshLocalPrefix(const otMeshLocalPrefix &aMeshLocalPrefix)
{
ThreadNetif &netif = GetNetif();
@@ -908,16 +893,6 @@ exit:
return OT_ERROR_NONE;
}
const Ip6::Address &Mle::GetLinkLocalAllThreadNodesAddress(void) const
{
return mLinkLocalAllThreadNodes.GetAddress();
}
const Ip6::Address &Mle::GetRealmLocalAllThreadNodesAddress(void) const
{
return mRealmLocalAllThreadNodes.GetAddress();
}
uint16_t Mle::GetRloc16(void) const
{
return GetNetif().GetMac().GetShortAddress();
@@ -942,11 +917,6 @@ otError Mle::SetRloc16(uint16_t aRloc16)
return OT_ERROR_NONE;
}
uint8_t Mle::GetLeaderId(void) const
{
return mLeaderData.GetLeaderRouterId();
}
void Mle::SetLeaderData(uint32_t aPartitionId, uint8_t aWeighting, uint8_t aLeaderRouterId)
{
if (mLeaderData.GetPartitionId() != aPartitionId)
@@ -964,16 +934,6 @@ void Mle::SetLeaderData(uint32_t aPartitionId, uint8_t aWeighting, uint8_t aLead
mLeaderData.SetLeaderRouterId(aLeaderRouterId);
}
const Ip6::Address &Mle::GetMeshLocal16(void) const
{
return mMeshLocal16.GetAddress();
}
const Ip6::Address &Mle::GetMeshLocal64(void) const
{
return mMeshLocal64.GetAddress();
}
otError Mle::GetLeaderAddress(Ip6::Address &aAddress) const
{
otError error = OT_ERROR_NONE;
+14 -8
View File
@@ -569,7 +569,7 @@ public:
* @returns true if an MLE Thread Discovery is in progress, false otherwise.
*
*/
bool IsDiscoverInProgress(void);
bool IsDiscoverInProgress(void) const { return mIsDiscoverInProgress; }
/**
* This method is called by the MeshForwarder to indicate that discovery is complete.
@@ -694,7 +694,10 @@ public:
* @returns A reference to the Mesh Local Prefix.
*
*/
const otMeshLocalPrefix &GetMeshLocalPrefix(void) const;
const otMeshLocalPrefix &GetMeshLocalPrefix(void) const
{
return reinterpret_cast<const otMeshLocalPrefix &>(mMeshLocal16.GetAddress());
}
/**
* This method sets the Mesh Local Prefix.
@@ -714,7 +717,7 @@ public:
* @returns A reference to the Thread link local address.
*
*/
const Ip6::Address &GetLinkLocalAddress(void) const;
const Ip6::Address &GetLinkLocalAddress(void) const { return mLinkLocal64.GetAddress(); }
/**
* This method updates the link local address.
@@ -732,7 +735,7 @@ public:
* @returns A reference to the link-local all Thread nodes multicast address.
*
*/
const Ip6::Address &GetLinkLocalAllThreadNodesAddress(void) const;
const Ip6::Address &GetLinkLocalAllThreadNodesAddress(void) const { return mLinkLocalAllThreadNodes.GetAddress(); }
/**
* This method returns a reference to the realm-local all Thread nodes multicast address.
@@ -740,7 +743,10 @@ public:
* @returns A reference to the realm-local all Thread nodes multicast address.
*
*/
const Ip6::Address &GetRealmLocalAllThreadNodesAddress(void) const;
const Ip6::Address &GetRealmLocalAllThreadNodesAddress(void) const
{
return mRealmLocalAllThreadNodes.GetAddress();
}
/**
* This method returns a pointer to the parent when operating in End Device mode.
@@ -816,7 +822,7 @@ public:
* @returns A reference to the RLOC assigned to the Thread interface.
*
*/
const Ip6::Address &GetMeshLocal16(void) const;
const Ip6::Address &GetMeshLocal16(void) const { return mMeshLocal16.GetAddress(); }
/**
* This method returns a reference to the ML-EID assigned to the Thread interface.
@@ -824,7 +830,7 @@ public:
* @returns A reference to the ML-EID assigned to the Thread interface.
*
*/
const Ip6::Address &GetMeshLocal64(void) const;
const Ip6::Address &GetMeshLocal64(void) const { return mMeshLocal64.GetAddress(); }
/**
* This method returns the Router ID of the Leader.
@@ -832,7 +838,7 @@ public:
* @returns The Router ID of the Leader.
*
*/
uint8_t GetLeaderId(void) const;
uint8_t GetLeaderId(void) const { return mLeaderData.GetLeaderRouterId(); }
/**
* This method retrieves the Leader's RLOC.
-5
View File
@@ -4570,11 +4570,6 @@ exit:
return false;
}
int8_t MleRouter::GetAssignParentPriority(void) const
{
return mParentPriority;
}
otError MleRouter::SetAssignParentPriority(int8_t aParentPriority)
{
otError error = OT_ERROR_NONE;
+1 -1
View File
@@ -580,7 +580,7 @@ public:
* @returns The assigned parent priority value, -2 means not assigned.
*
*/
int8_t GetAssignParentPriority(void) const;
int8_t GetAssignParentPriority(void) const { return mParentPriority; }
/**
* This method sets the parent priority.