summaryrefslogtreecommitdiffstats
path: root/core/btdiscovery.cpp
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2018-12-23 15:35:21 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-01-22 12:58:52 +1300
commit873a4c8f07c7004481ed0a1a29380feaa13195aa (patch)
treea60ddeb9757674422554639876be68e55c7f5702 /core/btdiscovery.cpp
parent3865c1ec0a844af624507b66c8af13e498895e8c (diff)
downloadsubsurface-873a4c8f07c7004481ed0a1a29380feaa13195aa.tar.gz
Bluetooth: all states other than HostPoweredOff qualify as valid
This is an attempt to fix issue #1896. While this seems a Qt issue in combination with very specific Android devices, this might be a fix. Do not check for a very specific state of the local BT controller, but just check if it is powered on. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'core/btdiscovery.cpp')
-rw-r--r--core/btdiscovery.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp
index 207dfacf8..b9ef687ac 100644
--- a/core/btdiscovery.cpp
+++ b/core/btdiscovery.cpp
@@ -102,10 +102,11 @@ BTDiscovery::BTDiscovery(QObject*) : m_btValid(false),
void BTDiscovery::BTDiscoveryReDiscover()
{
#if !defined(Q_OS_IOS)
+ qDebug() << "BTDiscoveryReDiscover: localBtDevice.isValid()" << localBtDevice.isValid();
if (localBtDevice.isValid() &&
- localBtDevice.hostMode() == QBluetoothLocalDevice::HostConnectable) {
+ localBtDevice.hostMode() != QBluetoothLocalDevice::HostPoweredOff) {
btPairedDevices.clear();
- qDebug() << "localDevice " + localBtDevice.name() + " is valid, starting discovery";
+ qDebug() << "BTDiscoveryReDiscover: localDevice " + localBtDevice.name() + " is powered on, starting discovery";
#else
// for iOS we can't use the localBtDevice as iOS is BLE only
// we need to find some other way to test if Bluetooth is enabled, though