summaryrefslogtreecommitdiff
path: root/liveview/liveviewscanner.cpp
blob: 3aee19d5dc7a4cff67267b3a3e2848f321e19645 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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);
	}
}