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:
Abtin Keshavarzian
2017-05-08 20:53:33 -07:00
committed by Jonathan Hui
parent 57b081da6d
commit f24017f1dd
+9 -5
View File
@@ -131,7 +131,7 @@ exit:
switch (error)
{
case kThreadError_None:
otLogDebgMac(GetInstance(), "Sent poll");
otLogDebgMac(GetInstance(), "Sending data poll");
if (mNoBufferRetxMode == true)
{
@@ -201,11 +201,16 @@ void DataPollManager::HandlePollSent(ThreadError aError)
shouldRecalculatePollPeriod = true;
}
otLogInfoMac(GetInstance(), "Sent data poll");
break;
default:
mPollTxFailureCounter++;
otLogInfoMac(GetInstance(), "Failed to send data poll, error:%s, retx:%d/%d",
otThreadErrorToString(aError), mPollTxFailureCounter, kMaxPollRetxAttempts);
if (mPollTxFailureCounter < kMaxPollRetxAttempts)
{
if (mRetxMode == false)
@@ -216,8 +221,6 @@ void DataPollManager::HandlePollSent(ThreadError aError)
}
else
{
otLogWarnMac(GetInstance(), "Data poll tx failed in %d back-to-back attempts.", mPollTxFailureCounter);
mRetxMode = false;
mPollTxFailureCounter = 0;
shouldRecalculatePollPeriod = true;
@@ -245,13 +248,14 @@ void DataPollManager::HandlePollTimeout(void)
mPollTimeoutCounter++;
if (mPollTimeoutCounter <= kQuickPollsAfterTimeout)
otLogInfoMac(GetInstance(), "Data poll timeout, retry:%d/%d", mPollTimeoutCounter, kQuickPollsAfterTimeout);
if (mPollTimeoutCounter < kQuickPollsAfterTimeout)
{
SendDataPoll();
}
else
{
otLogInfoMac(GetInstance(), "Data poll timeout happened %d times back-to-back.", mPollTimeoutCounter);
mPollTimeoutCounter = 0;
}