[mac] stop timer on pending WaitingForData operation on rx-on-idle change (#3437)

This commit changes `SetRxOnWhenIdle()` to stop the timer (data poll
timeout) if there is a pending `kOperationWaitingForData` when rx-on-
when-idle is being enabled. This addresses an issue where the timer
could remain active if the `SetRxOnwhenIdle(true)` is called before
the operation `kOperationWaitingForData` actually starts. Note that
the data poll timeout timer gets started while current operation is
`kOperationTransmitData` (from `HandleTransmitDone()` on a successful
data request frame transmission with a received ack indicating a
pending frame).
This commit is contained in:
Abtin Keshavarzian
2019-01-09 09:43:51 -08:00
committed by Jonathan Hui
parent eb8c6d90bd
commit bf48a647b3
+5 -1
View File
@@ -323,7 +323,11 @@ void Mac::SetRxOnWhenIdle(bool aRxOnWhenIdle)
if (mRxOnWhenIdle)
{
mPendingWaitingForData = false;
if (mPendingWaitingForData)
{
mTimer.Stop();
mPendingWaitingForData = false;
}
if (mOperation == kOperationWaitingForData)
{