[mle] change SetStateDetached()/SetStateChild() to be void (no return) (#3539)

This commit is contained in:
Abtin Keshavarzian
2019-01-31 08:50:07 -08:00
committed by Jonathan Hui
parent bd41c63a0a
commit 987ff3c017
2 changed files with 5 additions and 13 deletions
+3 -7
View File
@@ -701,7 +701,7 @@ bool Mle::IsAttached(void) const
return (mRole == OT_DEVICE_ROLE_CHILD || mRole == OT_DEVICE_ROLE_ROUTER || mRole == OT_DEVICE_ROLE_LEADER);
}
otError Mle::SetStateDetached(void)
void Mle::SetStateDetached(void)
{
ThreadNetif &netif = GetNetif();
@@ -723,11 +723,9 @@ otError Mle::SetStateDetached(void)
netif.GetMle().HandleDetachStart();
netif.GetIp6().SetForwardingEnabled(false);
netif.GetIp6().GetMpl().SetTimerExpirations(0);
return OT_ERROR_NONE;
}
otError Mle::SetStateChild(uint16_t aRloc16)
void Mle::SetStateChild(uint16_t aRloc16)
{
ThreadNetif &netif = GetNetif();
@@ -768,8 +766,6 @@ otError Mle::SetStateChild(uint16_t aRloc16)
InformPreviousParent();
mPreviousParentRloc = mParent.GetRloc16();
#endif
return OT_ERROR_NONE;
}
void Mle::InformPreviousChannel(void)
@@ -3391,7 +3387,7 @@ otError Mle::HandleChildIdResponse(const Message &aMessage, const Ip6::MessageIn
netif.GetActiveDataset().ApplyConfiguration();
SuccessOrExit(error = SetStateChild(shortAddress.GetRloc16()));
SetStateChild(shortAddress.GetRloc16());
exit:
+2 -6
View File
@@ -1521,18 +1521,14 @@ protected:
/**
* This method sets the Device State to Detached.
*
* @retval OT_ERROR_NONE Successfully set the Device State to Detached.
*
*/
otError SetStateDetached(void);
void SetStateDetached(void);
/**
* This method sets the Device State to Child.
*
* @retval OT_ERROR_NONE Successfully set the Device State to Child.
*
*/
otError SetStateChild(uint16_t aRloc16);
void SetStateChild(uint16_t aRloc16);
/**
* This method sets the Leader's Partition ID, Weighting, and Router ID values.