From 564f4c9ad0ef6d8abf812fcbce5df243f44cd35b Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Wed, 21 Dec 2022 21:40:00 +0000 Subject: [PATCH] Scan for serial AMBE devices on Windows --- plugins/feature/ambe/ambeengine.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/plugins/feature/ambe/ambeengine.cpp b/plugins/feature/ambe/ambeengine.cpp index 6e925736a..8fe7064c4 100644 --- a/plugins/feature/ambe/ambeengine.cpp +++ b/plugins/feature/ambe/ambeengine.cpp @@ -78,10 +78,27 @@ void AMBEEngine::getComList() } } -// Do not activate serial support at all for windows void AMBEEngine::scan(QList& ambeDevices) { - (void) ambeDevices; + qDebug("AMBEEngine::scan"); + AMBEEngine::getComList(); + std::vector::const_iterator it = m_comList.begin(); + ambeDevices.clear(); + + while (it != m_comList.end()) + { + AMBEWorker *worker = new AMBEWorker(); + qDebug("AMBEEngine::scan: com: %s", it->c_str()); + + if (worker->open(*it)) + { + ambeDevices.push_back(QString(it->c_str())); + worker->close(); + } + + delete worker; + ++it; + } } #elif defined(__APPLE__) void AMBEEngine::getComList()