mirror of
https://github.com/espressif/openthread.git
synced 2026-10-02 05:47:40 +00:00
Add/Update logs related to data poll transmission (#1738)
This commit adds/updates logs in `DataPollManager`: - New logs in `HandlePollSent()` after either successful or failed transmission of a data poll. - New logs in `HandlePollTimeout()` to indicate data poll timeout.
This commit is contained in:
committed by
Jonathan Hui
parent
57b081da6d
commit
f24017f1dd
@@ -131,7 +131,7 @@ exit:
|
|||||||
switch (error)
|
switch (error)
|
||||||
{
|
{
|
||||||
case kThreadError_None:
|
case kThreadError_None:
|
||||||
otLogDebgMac(GetInstance(), "Sent poll");
|
otLogDebgMac(GetInstance(), "Sending data poll");
|
||||||
|
|
||||||
if (mNoBufferRetxMode == true)
|
if (mNoBufferRetxMode == true)
|
||||||
{
|
{
|
||||||
@@ -201,11 +201,16 @@ void DataPollManager::HandlePollSent(ThreadError aError)
|
|||||||
shouldRecalculatePollPeriod = true;
|
shouldRecalculatePollPeriod = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
otLogInfoMac(GetInstance(), "Sent data poll");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
mPollTxFailureCounter++;
|
mPollTxFailureCounter++;
|
||||||
|
|
||||||
|
otLogInfoMac(GetInstance(), "Failed to send data poll, error:%s, retx:%d/%d",
|
||||||
|
otThreadErrorToString(aError), mPollTxFailureCounter, kMaxPollRetxAttempts);
|
||||||
|
|
||||||
if (mPollTxFailureCounter < kMaxPollRetxAttempts)
|
if (mPollTxFailureCounter < kMaxPollRetxAttempts)
|
||||||
{
|
{
|
||||||
if (mRetxMode == false)
|
if (mRetxMode == false)
|
||||||
@@ -216,8 +221,6 @@ void DataPollManager::HandlePollSent(ThreadError aError)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
otLogWarnMac(GetInstance(), "Data poll tx failed in %d back-to-back attempts.", mPollTxFailureCounter);
|
|
||||||
|
|
||||||
mRetxMode = false;
|
mRetxMode = false;
|
||||||
mPollTxFailureCounter = 0;
|
mPollTxFailureCounter = 0;
|
||||||
shouldRecalculatePollPeriod = true;
|
shouldRecalculatePollPeriod = true;
|
||||||
@@ -245,13 +248,14 @@ void DataPollManager::HandlePollTimeout(void)
|
|||||||
|
|
||||||
mPollTimeoutCounter++;
|
mPollTimeoutCounter++;
|
||||||
|
|
||||||
if (mPollTimeoutCounter <= kQuickPollsAfterTimeout)
|
otLogInfoMac(GetInstance(), "Data poll timeout, retry:%d/%d", mPollTimeoutCounter, kQuickPollsAfterTimeout);
|
||||||
|
|
||||||
|
if (mPollTimeoutCounter < kQuickPollsAfterTimeout)
|
||||||
{
|
{
|
||||||
SendDataPoll();
|
SendDataPoll();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
otLogInfoMac(GetInstance(), "Data poll timeout happened %d times back-to-back.", mPollTimeoutCounter);
|
|
||||||
mPollTimeoutCounter = 0;
|
mPollTimeoutCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user