From 75c7421a1081d9d6637d0a5d76ee91db4a0a146d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Tue, 17 Jul 2018 13:45:34 +0200 Subject: [PATCH] Add iOS bluetooth verfifcation --- libnymea-app-core/wifisetup/bluetoothdiscovery.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libnymea-app-core/wifisetup/bluetoothdiscovery.cpp b/libnymea-app-core/wifisetup/bluetoothdiscovery.cpp index e3bf1f26..1978713b 100644 --- a/libnymea-app-core/wifisetup/bluetoothdiscovery.cpp +++ b/libnymea-app-core/wifisetup/bluetoothdiscovery.cpp @@ -30,6 +30,7 @@ BluetoothDiscovery::BluetoothDiscovery(QObject *parent) : m_deviceInfos(new BluetoothDeviceInfos(this)) { +#ifndef Q_OS_IOS // Check if bluetooth is available QBluetoothLocalDevice localDevice; if (!localDevice.isValid()) { @@ -57,6 +58,11 @@ BluetoothDiscovery::BluetoothDiscovery(QObject *parent) : } m_discoveryAgent = new QBluetoothDeviceDiscoveryAgent(m_localDevice->address(), this); +#else + setBluetoothAvailable(true); + m_discoveryAgent = new QBluetoothDeviceDiscoveryAgent(this); +#endif + connect(m_discoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered, this, &BluetoothDiscovery::deviceDiscovered); connect(m_discoveryAgent, &QBluetoothDeviceDiscoveryAgent::finished, this, &BluetoothDiscovery::discoveryFinished); connect(m_discoveryAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error)), this, SLOT(onError(QBluetoothDeviceDiscoveryAgent::Error))); @@ -130,7 +136,6 @@ void BluetoothDiscovery::deviceDiscovered(const QBluetoothDeviceInfo &deviceInfo qDebug() << "BluetoothDiscovery: [+]" << deviceInformation->name() << "(" << deviceInformation->address() << ")" << (isLowEnergy ? "LE" : ""); - if (!isLowEnergy || deviceInformation->name().isEmpty()) { delete deviceInformation; return;