mirror of
https://github.com/espressif/openthread.git
synced 2026-08-31 22:39:54 +00:00
Some Logging Cleanup (#810)
* Remove unnecessary WPP definition. * Various other small fixes.
This commit is contained in:
@@ -195,11 +195,14 @@ ThreadError Mle::Start(void)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
|
||||
otLogFuncEntry();
|
||||
|
||||
// cannot bring up the interface if IEEE 802.15.4 promiscuous mode is enabled
|
||||
VerifyOrExit(otPlatRadioGetPromiscuous(mNetif.GetInstance()) == false, error = kThreadError_InvalidState);
|
||||
VerifyOrExit(mNetif.IsUp(), error = kThreadError_InvalidState);
|
||||
|
||||
mDeviceState = kDeviceStateDetached;
|
||||
mNetif.SetStateChangedFlags(OT_NET_ROLE);
|
||||
SetStateDetached();
|
||||
|
||||
mKeyManager.Start();
|
||||
@@ -220,11 +223,13 @@ ThreadError Mle::Start(void)
|
||||
}
|
||||
|
||||
exit:
|
||||
otLogFuncExitErr(error);
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Mle::Stop(void)
|
||||
{
|
||||
otLogFuncEntry();
|
||||
mKeyManager.Stop();
|
||||
SetStateDetached();
|
||||
mNetif.RemoveUnicastAddress(mLinkLocal16);
|
||||
@@ -236,6 +241,7 @@ ThreadError Mle::Stop(void)
|
||||
}
|
||||
|
||||
mDeviceState = kDeviceStateDisabled;
|
||||
otLogFuncExit();
|
||||
return kThreadError_None;
|
||||
}
|
||||
|
||||
@@ -309,6 +315,8 @@ ThreadError Mle::BecomeDetached(void)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
|
||||
otLogFuncEntry();
|
||||
|
||||
VerifyOrExit(mDeviceState != kDeviceStateDisabled, error = kThreadError_InvalidState);
|
||||
|
||||
SetStateDetached();
|
||||
@@ -316,6 +324,7 @@ ThreadError Mle::BecomeDetached(void)
|
||||
BecomeChild(kMleAttachAnyPartition);
|
||||
|
||||
exit:
|
||||
otLogFuncExitErr(error);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -323,6 +332,8 @@ ThreadError Mle::BecomeChild(otMleAttachFilter aFilter)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
|
||||
otLogFuncEntry();
|
||||
|
||||
VerifyOrExit(mDeviceState != kDeviceStateDisabled, error = kThreadError_InvalidState);
|
||||
VerifyOrExit(mParentRequestState == kParentIdle, error = kThreadError_Busy);
|
||||
|
||||
@@ -338,6 +349,7 @@ ThreadError Mle::BecomeChild(otMleAttachFilter aFilter)
|
||||
mParentRequestTimer.Start(kParentRequestRouterTimeout);
|
||||
|
||||
exit:
|
||||
otLogFuncExitErr(error);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1870,6 +1882,12 @@ ThreadError Mle::HandleAdvertisement(const Message &aMessage, const Ip6::Message
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
if (error != kThreadError_None)
|
||||
{
|
||||
otLogWarnMleErr(error, "Failed to process Advertisement");
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1992,6 +2010,12 @@ ThreadError Mle::HandleDataResponse(const Message &aMessage, const Ip6::MessageI
|
||||
mRetrieveNewNetworkData = false;
|
||||
|
||||
exit:
|
||||
|
||||
if (error != kThreadError_None)
|
||||
{
|
||||
otLogWarnMleErr(error, "Failed to process Data Response");
|
||||
}
|
||||
|
||||
(void)aMessageInfo;
|
||||
|
||||
if (dataRequest)
|
||||
@@ -2175,6 +2199,12 @@ ThreadError Mle::HandleParentResponse(const Message &aMessage, const Ip6::Messag
|
||||
mParentIsSingleton = connectivity.GetActiveRouters() <= 1;
|
||||
|
||||
exit:
|
||||
|
||||
if (error != kThreadError_None)
|
||||
{
|
||||
otLogWarnMleErr(error, "Failed to process Parent Response");
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -2284,6 +2314,12 @@ ThreadError Mle::HandleChildIdResponse(const Message &aMessage, const Ip6::Messa
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
if (error != kThreadError_None)
|
||||
{
|
||||
otLogWarnMleErr(error, "Failed to process Child ID Response");
|
||||
}
|
||||
|
||||
(void)aMessageInfo;
|
||||
return error;
|
||||
}
|
||||
@@ -2394,6 +2430,12 @@ ThreadError Mle::HandleChildUpdateResponse(const Message &aMessage, const Ip6::M
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
if (error != kThreadError_None)
|
||||
{
|
||||
otLogWarnMleErr(error, "Failed to process Child Update Response");
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -2501,6 +2543,12 @@ ThreadError Mle::HandleDiscoveryRequest(const Message &aMessage, const Ip6::Mess
|
||||
error = SendDiscoveryResponse(aMessageInfo.GetPeerAddr(), aMessage.GetPanId());
|
||||
|
||||
exit:
|
||||
|
||||
if (error != kThreadError_None)
|
||||
{
|
||||
otLogWarnMleErr(error, "Failed to process Discovery Request");
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -2682,6 +2730,12 @@ ThreadError Mle::HandleDiscoveryResponse(const Message &aMessage, const Ip6::Mes
|
||||
mDiscoverHandler(&result, mDiscoverContext);
|
||||
|
||||
exit:
|
||||
|
||||
if (error != kThreadError_None)
|
||||
{
|
||||
otLogWarnMleErr(error, "Failed to process Discovery Response");
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user