[data-poll-handler] reset tx attempts when replacing a frame (#9397)

Whenever an indirect/CSL transmitted frame is being purged or replaced,
make sure that both indirect and CSL transmission attempts counts are
reset in order to avoid issues like considering a new frame as a
retransmission.
This commit is contained in:
Eduardo Montoya
2023-09-05 10:48:03 -07:00
committed by GitHub
parent a0a9cf26f0
commit c6bece0729
2 changed files with 14 additions and 6 deletions
+13 -6
View File
@@ -121,6 +121,7 @@ void DataPollHandler::RequestFrameChange(FrameChange aChange, Child &aChild)
}
else
{
ResetTxAttempts(aChild);
mCallbacks.HandleFrameChangeDone(aChild);
}
}
@@ -235,7 +236,7 @@ void DataPollHandler::HandleSentFrame(const Mac::TxFrame &aFrame, Error aError,
{
aChild.SetFramePurgePending(false);
aChild.SetFrameReplacePending(false);
aChild.ResetIndirectTxAttempts();
ResetTxAttempts(aChild);
mCallbacks.HandleFrameChangeDone(aChild);
ExitNow();
}
@@ -243,10 +244,7 @@ void DataPollHandler::HandleSentFrame(const Mac::TxFrame &aFrame, Error aError,
switch (aError)
{
case kErrorNone:
aChild.ResetIndirectTxAttempts();
#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
aChild.ResetCslTxAttempts();
#endif
ResetTxAttempts(aChild);
aChild.SetFrameReplacePending(false);
break;
@@ -265,7 +263,7 @@ void DataPollHandler::HandleSentFrame(const Mac::TxFrame &aFrame, Error aError,
if (aChild.IsFrameReplacePending())
{
aChild.SetFrameReplacePending(false);
aChild.ResetIndirectTxAttempts();
ResetTxAttempts(aChild);
mCallbacks.HandleFrameChangeDone(aChild);
ExitNow();
}
@@ -330,6 +328,15 @@ void DataPollHandler::ProcessPendingPolls(void)
}
}
void DataPollHandler::ResetTxAttempts(Child &aChild)
{
aChild.ResetIndirectTxAttempts();
#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
aChild.ResetCslTxAttempts();
#endif
}
} // namespace ot
#endif // #if OPENTHREAD_FTD
+1
View File
@@ -275,6 +275,7 @@ private:
void HandleSentFrame(const Mac::TxFrame &aFrame, Error aError, Child &aChild);
void ProcessPendingPolls(void);
void ResetTxAttempts(Child &aChild);
// In the current implementation of `DataPollHandler`, we can have a
// single indirect tx operation active at MAC layer at each point of