diff --git a/smocore/deviceManager/deviceManager.cpp b/smocore/deviceManager/deviceManager.cpp index 92c4530..3e8c58f 100644 --- a/smocore/deviceManager/deviceManager.cpp +++ b/smocore/deviceManager/deviceManager.cpp @@ -589,7 +589,8 @@ void DeviceManager::attachAllUnattachedDevicesFromKnownListReq( ) { // Create a vector to hold unattached device specs - auto unattachedSpecs = std::make_shared>(); + auto unattachedSpecs = std::make_shared< + std::vector>(); // Cycle through all DA specs in deviceAttachmentSpecs for (const auto& spec : deviceAttachmentSpecs) diff --git a/smocore/deviceManager/deviceReattacher.cpp b/smocore/deviceManager/deviceReattacher.cpp index 7c8f970..729476d 100644 --- a/smocore/deviceManager/deviceReattacher.cpp +++ b/smocore/deviceManager/deviceReattacher.cpp @@ -2,12 +2,22 @@ #include #include #include +#include #include #include namespace smo { namespace device { +static void reattachmentCb(AsynchronousLoop& results) +{ + if (results.nTotal == 0) { return; } + + std::cout << "DeviceReattacher: Successfully reattached " + << results.nSucceeded << " of " << results.nTotal << " devices" + << std::endl; +} + DeviceReattacher::DeviceReattacher( DeviceManager& parent, std::shared_ptr ioThread) : parent(parent), ioThread(ioThread), shouldContinue(false), @@ -60,6 +70,11 @@ void DeviceReattacher::onTimeout(const boost::system::error_code& error) return; } + // Attempt to reattach all unattached devices from the known list + parent.attachAllUnattachedDevicesFromKnownListReq( + Callback( + nullptr, reattachmentCb)); + // Schedule the next timeout scheduleNextTimeout(); }