Skip to content

Commit

Permalink
[mac] prioritize indirect transmissions
Browse files Browse the repository at this point in the history
According to the Specification transmission priorities are set as
following (where priority 1 is the highest):
1. Indirect responses to Data Requests
2. CSL
3. Direct transmissions

This commit fixes the current behavior of prioritizing CSL transmissions.
  • Loading branch information
konradderda committed Nov 27, 2023
1 parent d6827ca commit 760bf18
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/core/mac/mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,12 +645,18 @@ void Mac::PerformNextOperation(void)
{
mOperation = kOperationWaitingForData;
}
#if OPENTHREAD_FTD && OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
#if OPENTHREAD_FTD
else if (IsPending(kOperationTransmitDataIndirect))
{
mOperation = kOperationTransmitDataIndirect;
}
#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
else if (IsPending(kOperationTransmitDataCsl) && TimerMilli::GetNow() >= mCslTxFireTime)
{
mOperation = kOperationTransmitDataCsl;
}
#endif
#endif // OPENTHREAD_FTD
else if (IsPending(kOperationActiveScan))
{
mOperation = kOperationActiveScan;
Expand All @@ -663,12 +669,6 @@ void Mac::PerformNextOperation(void)
{
mOperation = kOperationTransmitBeacon;
}
#if OPENTHREAD_FTD
else if (IsPending(kOperationTransmitDataIndirect))
{
mOperation = kOperationTransmitDataIndirect;
}
#endif // OPENTHREAD_FTD
else if (IsPending(kOperationTransmitPoll) && (!IsPending(kOperationTransmitDataDirect) || mShouldTxPollBeforeData))
{
mOperation = kOperationTransmitPoll;
Expand Down

0 comments on commit 760bf18

Please sign in to comment.