[csl] allow scheduling delayed reception in any radio state (#7677)

When radio supports receive timing it makes no sense to restrict
scheduling future reception slots while the radio state is for
instance transmitting or receiving, as long as CSL parameters are
properly configured.
This commit is contained in:
Eduardo Montoya
2022-05-10 09:11:27 -07:00
committed by GitHub
parent d9dd34ea6f
commit 645fbcd400
+8 -7
View File
@@ -1165,18 +1165,19 @@ void SubMac::HandleCslTimer(void)
}
Get<Radio>().UpdateCslSampleTime(mCslSampleTime.GetValue());
if (mState == kStateCslSample)
if (RadioSupportsReceiveTiming())
{
if (RadioSupportsReceiveTiming())
if (mState != kStateDisabled && mCslChannel)
{
IgnoreError(Get<Radio>().ReceiveAt(mCslChannel, mCslSampleTime.GetValue() - periodUs - timeAhead,
timeAhead + timeAfter));
}
else
{
IgnoreError(Get<Radio>().Receive(mCslChannel));
LogDebg("CSL sample %u, duration %u", mCslTimer.GetNow().GetValue(), timeAhead + timeAfter);
}
}
else if (mState == kStateCslSample)
{
IgnoreError(Get<Radio>().Receive(mCslChannel));
LogDebg("CSL sample %u, duration %u", mCslTimer.GetNow().GetValue(), timeAhead + timeAfter);
}
break;