Indentation
This commit is contained in:
@@ -27,24 +27,24 @@ timer(ioThread->getIoService())
|
|||||||
|
|
||||||
void DeviceReattacher::start()
|
void DeviceReattacher::start()
|
||||||
{
|
{
|
||||||
shouldContinue.store(true);
|
shouldContinue.store(true);
|
||||||
scheduleNextTimeout();
|
scheduleNextTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceReattacher::stop()
|
void DeviceReattacher::stop()
|
||||||
{
|
{
|
||||||
shouldContinue.store(false);
|
shouldContinue.store(false);
|
||||||
timer.cancel();
|
timer.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceReattacher::scheduleNextTimeout()
|
void DeviceReattacher::scheduleNextTimeout()
|
||||||
{
|
{
|
||||||
if (!shouldContinue.load()) {
|
if (!shouldContinue.load()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Schedule the next timeout using the configured period
|
// Schedule the next timeout using the configured period
|
||||||
timer.expires_from_now(
|
timer.expires_from_now(
|
||||||
boost::posix_time::milliseconds(
|
boost::posix_time::milliseconds(
|
||||||
CONFIG_MRNTT_DEVMGR_REATTACHER_PERIOD_MS));
|
CONFIG_MRNTT_DEVMGR_REATTACHER_PERIOD_MS));
|
||||||
|
|
||||||
@@ -56,27 +56,27 @@ void DeviceReattacher::onTimeout(const boost::system::error_code& error)
|
|||||||
{
|
{
|
||||||
// Timer was cancelled, which is expected when stopping
|
// Timer was cancelled, which is expected when stopping
|
||||||
if (error == boost::asio::error::operation_aborted) {
|
if (error == boost::asio::error::operation_aborted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
std::cerr << "DeviceReattacher: Timer error: " << error.message()
|
std::cerr << "DeviceReattacher: Timer error: " << error.message()
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!shouldContinue.load()) {
|
if (!shouldContinue.load()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempt to reattach all unattached devices from the known list
|
// Attempt to reattach all unattached devices from the known list
|
||||||
parent.attachAllUnattachedDevicesFromKnownListReq(
|
parent.attachAllUnattachedDevicesFromKnownListReq(
|
||||||
Callback<DeviceManager::attachAllUnattachedDevicesFromReqCbFn>(
|
Callback<DeviceManager::attachAllUnattachedDevicesFromReqCbFn>(
|
||||||
nullptr, reattachmentCb));
|
nullptr, reattachmentCb));
|
||||||
|
|
||||||
// Schedule the next timeout
|
// Schedule the next timeout
|
||||||
scheduleNextTimeout();
|
scheduleNextTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace device
|
} // namespace device
|
||||||
|
|||||||
Reference in New Issue
Block a user