[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.
This commit is contained in:
Li Cao
2020-09-08 18:22:27 -07:00
committed by GitHub
parent a2d6901404
commit 3ffc503c32
+1
View File
@@ -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)
{