[data-poll-sender] faster rtx polling for CSL (#8654)

Make sure that retransmission of data polls happens at least at the
CSL period rate, when this is lower than
OPENTHREAD_CONFIG_MAC_RETX_POLL_PERIOD.

This greatly improves latency under situations of heavy traffic, where
CSL synchronization might be lost ocassionaly due to the mix of CSL
and indirect transmissions.
This commit is contained in:
Eduardo Montoya
2023-01-17 09:58:27 -08:00
committed by GitHub
parent b832cb2c49
commit 0614ff6e43
3 changed files with 16 additions and 2 deletions
+7
View File
@@ -513,6 +513,13 @@ uint32_t DataPollSender::CalculatePollPeriod(void) const
if (mRetxMode)
{
period = Min(period, kRetxPollPeriod);
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
if (Get<Mac::Mac>().GetCslPeriodMs() > 0)
{
period = Min(period, Get<Mac::Mac>().GetCslPeriodMs());
}
#endif
}
if (mRemainingFastPolls != 0)
+8
View File
@@ -617,6 +617,14 @@ public:
*/
uint16_t GetCslPeriod(void) const { return mCslPeriod; }
/**
* This method gets the CSL period.
*
* @returns CSL period in milliseconds.
*
*/
uint32_t GetCslPeriodMs(void) const { return mCslPeriod * kUsPerTenSymbols / 1000; }
/**
* This method sets the CSL period.
*
+1 -2
View File
@@ -1900,8 +1900,7 @@ void Mle::ScheduleMessageTransmissionTimer(void)
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
if (Get<Mac::Mac>().IsCslEnabled())
{
ExitNow(interval = Get<Mac::Mac>().GetCslPeriod() * kUsPerTenSymbols / 1000 +
static_cast<uint32_t>(kUnicastRetransmissionDelay));
ExitNow(interval = Get<Mac::Mac>().GetCslPeriodMs() + static_cast<uint32_t>(kUnicastRetransmissionDelay));
}
else
#endif