mirror of
https://github.com/espressif/openthread.git
synced 2026-08-31 22:39:54 +00:00
[data-poll-sender] change StartPolling() to return void (#4941)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -358,7 +358,7 @@ void MeshForwarder::SetRxOnWhenIdle(bool aRxOnWhenIdle)
|
||||
}
|
||||
else
|
||||
{
|
||||
IgnoreError(mDataPollSender.StartPolling());
|
||||
mDataPollSender.StartPolling();
|
||||
Get<Utils::SupervisionListener>().Start();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user