diff --git a/src/core/mac/data_poll_handler.cpp b/src/core/mac/data_poll_handler.cpp index e86d91707520..8449cf3199b2 100644 --- a/src/core/mac/data_poll_handler.cpp +++ b/src/core/mac/data_poll_handler.cpp @@ -126,6 +126,7 @@ void DataPollHandler::RequestFrameChange(FrameChange aChange, Child &aChild) } else { + ResetTxAttempts(aChild); mCallbacks.HandleFrameChangeDone(aChild); } } @@ -240,6 +241,7 @@ void DataPollHandler::HandleSentFrame(const Mac::TxFrame &aFrame, Error aError, { aChild.SetFramePurgePending(false); aChild.SetFrameReplacePending(false); + ResetTxAttempts(aChild); mCallbacks.HandleFrameChangeDone(aChild); ExitNow(); } @@ -247,10 +249,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; @@ -269,6 +268,7 @@ void DataPollHandler::HandleSentFrame(const Mac::TxFrame &aFrame, Error aError, if (aChild.IsFrameReplacePending()) { aChild.SetFrameReplacePending(false); + ResetTxAttempts(aChild); mCallbacks.HandleFrameChangeDone(aChild); ExitNow(); } @@ -333,6 +333,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 diff --git a/src/core/mac/data_poll_handler.hpp b/src/core/mac/data_poll_handler.hpp index da7f744b76ea..0bc58d3e8390 100644 --- a/src/core/mac/data_poll_handler.hpp +++ b/src/core/mac/data_poll_handler.hpp @@ -275,6 +275,7 @@ class DataPollHandler : public InstanceLocator, private NonCopyable 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