[data-poll-sender] change StartPolling() to return void (#4941)

This commit is contained in:
Jonathan Hui
2020-05-11 12:44:54 -07:00
parent eac2dd9d07
commit 11db44e36a
3 changed files with 6 additions and 11 deletions
+4 -5
View File
@@ -69,18 +69,17 @@ const Neighbor &DataPollSender::GetParent(void) const
return parentCandidate.IsStateValid() ? parentCandidate : Get<Mle::MleRouter>().GetParent();
}
otError DataPollSender::StartPolling(void)
void DataPollSender::StartPolling(void)
{
otError error = OT_ERROR_NONE;
VerifyOrExit(!mEnabled, OT_NOOP);
VerifyOrExit(!mEnabled, error = OT_ERROR_ALREADY);
VerifyOrExit(!Get<Mle::MleRouter>().IsRxOnWhenIdle(), error = OT_ERROR_INVALID_STATE);
OT_ASSERT(!Get<Mle::MleRouter>().IsRxOnWhenIdle());
mEnabled = true;
ScheduleNextPoll(kRecalculatePollPeriod);
exit:
return error;
return;
}
void DataPollSender::StopPolling(void)
+1 -5
View File
@@ -79,12 +79,8 @@ public:
/**
* This method instructs the data poll sender to start sending periodic data polls.
*
* @retval OT_ERROR_NONE Successfully started sending periodic data polls.
* @retval OT_ERROR_ALREADY Periodic data poll transmission is already started/enabled.
* @retval OT_ERROR_INVALID_STATE Device is not in rx-off-when-idle mode.
*
*/
otError StartPolling(void);
void StartPolling(void);
/**
* This method instructs the data poll sender to stop sending periodic data polls.
+1 -1
View File
@@ -358,7 +358,7 @@ void MeshForwarder::SetRxOnWhenIdle(bool aRxOnWhenIdle)
}
else
{
IgnoreError(mDataPollSender.StartPolling());
mDataPollSender.StartPolling();
Get<Utils::SupervisionListener>().Start();
}
}