From 3ffc503c32117cdeb4515c6d0a14b0079702fbd7 Mon Sep 17 00:00:00 2001 From: Li Cao Date: Wed, 9 Sep 2020 09:22:27 +0800 Subject: [PATCH] [low-power] remove extra csl tx after buffered message sent by indirect tx (#5497) Consider such a case: - The CSL transmitter has a buffered message for a CSL receiver and has scheduled that tx. - Before the CSL transmitter actually sends it, the receiver sends a data request. - The CSL transmitter immediately sends the buffered message to the receiver. - The scheduled time comes. In current CSL implementation, though the buffered message has been sent through indirect tx, when the origin CSL tx time comes, it would send another 'empty frame' due to the missing of check and the implementation of IndirectSender::PrepareFrameForChild. This commit adds the check for this case and avoid to send the meaningless empty frame. --- src/core/thread/csl_tx_scheduler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/thread/csl_tx_scheduler.cpp b/src/core/thread/csl_tx_scheduler.cpp index 725f96174..cf0d5327d 100644 --- a/src/core/thread/csl_tx_scheduler.cpp +++ b/src/core/thread/csl_tx_scheduler.cpp @@ -167,6 +167,7 @@ otError CslTxScheduler::HandleFrameRequest(Mac::TxFrame &aFrame) SuccessOrExit(error = mCallbacks.PrepareFrameForChild(aFrame, mFrameContext, *mCslTxChild)); mCslTxMessage = mCslTxChild->GetIndirectMessage(); + VerifyOrExit(mCslTxMessage != nullptr, error = OT_ERROR_ABORT); if (mCslTxChild->GetIndirectTxAttempts() > 0 || mCslTxChild->GetCslTxAttempts() > 0) {