diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-07-18 14:49:14 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-19 06:21:23 -0700 |
commit | 526da269cc59f55a96f8819cb71265649727f0e0 (patch) | |
tree | 283e3022b143de3b3d12ac4ac11e9d591edb9428 /core/btdiscovery.cpp | |
parent | f940104a3398d587dba8c6655aee27c286cfd6e9 (diff) | |
download | subsurface-526da269cc59f55a96f8819cb71265649727f0e0.tar.gz |
iOS BLE support: no localBtDevice, go straight to discovery
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/btdiscovery.cpp')
-rw-r--r-- | core/btdiscovery.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp index cacb0ac9a..914d71861 100644 --- a/core/btdiscovery.cpp +++ b/core/btdiscovery.cpp @@ -100,14 +100,19 @@ BTDiscovery::BTDiscovery(QObject *parent) } m_instance = this; #if defined(BT_SUPPORT) +#if !defined(Q_OS_IOS) if (localBtDevice.isValid() && localBtDevice.hostMode() == QBluetoothLocalDevice::HostConnectable) { btPairedDevices.clear(); qDebug() << "localDevice " + localBtDevice.name() + " is valid, starting discovery"; m_btValid = true; -#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) +#else + m_btValid = false; +#endif +#if defined(Q_OS_IOS) || (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) discoveryAgent = new QBluetoothDeviceDiscoveryAgent(this); connect(discoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered, this, &BTDiscovery::btDeviceDiscovered); + qDebug() << "starting BLE discovery"; discoveryAgent->start(); #endif #if defined(Q_OS_ANDROID) && defined(BT_SUPPORT) @@ -126,11 +131,13 @@ BTDiscovery::BTDiscovery(QObject *parent) #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) discoveryAgent->stop(); #endif +#if !defined(Q_OS_IOS) } else { qDebug() << "localBtDevice isn't valid"; m_btValid = false; } #endif +#endif } BTDiscovery::~BTDiscovery() |