diff options
Diffstat (limited to 'liveview/liveviewscanner.cpp')
-rw-r--r-- | liveview/liveviewscanner.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/liveview/liveviewscanner.cpp b/liveview/liveviewscanner.cpp new file mode 100644 index 0000000..3aee19d --- /dev/null +++ b/liveview/liveviewscanner.cpp @@ -0,0 +1,26 @@ +#include <QtConnectivity/QBluetoothDeviceInfo> +#include <QtConnectivity/QBluetoothAddress> + +#include "liveviewscanner.h" + +QTM_USE_NAMESPACE +using namespace sowatch; + +LiveViewScanner::LiveViewScanner(QObject *parent) : + BluetoothWatchScanner(parent) +{ + setUuidFilter(QBluetoothUuid::SerialPort); +} + +void LiveViewScanner::handleDiscoveredService(const QBluetoothServiceInfo &info) +{ + const QBluetoothDeviceInfo dev = info.device(); + QString deviceName = dev.name(); + if (deviceName == "LiveView") { + QVariantMap foundInfo; + foundInfo["driver"] = QString("liveview"); + foundInfo["address"] = dev.address().toString(); + foundInfo["name"] = deviceName; + emit watchFound(foundInfo); + } +} |