mirror of
https://github.com/espressif/openthread.git
synced 2026-08-14 14:47:46 +00:00
[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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user