mirror of
https://github.com/espressif/openthread.git
synced 2026-08-15 07:07:46 +00:00
[mesh-forwarder] do not treat CCA failures the same as no-ack (#2765)
Thread 1.1.1 Section 5.9.4 states: "Note that failures to transmit due to failed clear channel assessments do not count as a failure to receive an ACK."
This commit is contained in:
@@ -217,6 +217,12 @@ void DataPollManager::HandlePollSent(otError aError)
|
||||
|
||||
break;
|
||||
|
||||
case OT_ERROR_CHANNEL_ACCESS_FAILURE:
|
||||
case OT_ERROR_ABORT:
|
||||
mRetxMode = true;
|
||||
shouldRecalculatePollPeriod = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
mPollTxFailureCounter++;
|
||||
|
||||
|
||||
@@ -957,7 +957,7 @@ void MeshForwarder::HandleSentFrame(Mac::Frame &aFrame, otError aError)
|
||||
|
||||
if (mSendMessage->GetDirectTransmission())
|
||||
{
|
||||
if (aError != OT_ERROR_NONE)
|
||||
if (aError == OT_ERROR_NO_ACK)
|
||||
{
|
||||
// If the transmission of any fragment frame fails,
|
||||
// the overall message transmission is considered
|
||||
|
||||
@@ -592,14 +592,18 @@ void MeshForwarder::HandleSentFrameToChild(const Mac::Frame &aFrame, otError aEr
|
||||
iter.Advance();
|
||||
mIndirectStartingChild = iter.GetChild();
|
||||
|
||||
if (aError == OT_ERROR_NONE)
|
||||
switch (aError)
|
||||
{
|
||||
case OT_ERROR_NONE:
|
||||
child->ResetIndirectTxAttempts();
|
||||
}
|
||||
else
|
||||
{
|
||||
child->IncrementIndirectTxAttempts();
|
||||
break;
|
||||
|
||||
case OT_ERROR_NO_ACK:
|
||||
child->IncrementIndirectTxAttempts();
|
||||
// fall through
|
||||
|
||||
case OT_ERROR_CHANNEL_ACCESS_FAILURE:
|
||||
case OT_ERROR_ABORT:
|
||||
if (child->GetIndirectTxAttempts() < kMaxPollTriggeredTxAttempts)
|
||||
{
|
||||
// We save the frame counter, key id, and data sequence number of
|
||||
@@ -634,6 +638,12 @@ void MeshForwarder::HandleSentFrameToChild(const Mac::Frame &aFrame, otError aEr
|
||||
|
||||
mMessageNextOffset = mSendMessage->GetLength();
|
||||
#endif
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user