summaryrefslogtreecommitdiffstats
path: root/core/btdiscovery.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-09-16 20:15:15 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-09-17 09:54:04 -0700
commit5695ef956b9395dbe924b097a96359c5acacb53f (patch)
tree6a5f6d5bda7fddcddfeabb895dcb51f3cd9eef28 /core/btdiscovery.cpp
parent08e4d2dc5ec4c3ca9eca7d56bb380ae124088b06 (diff)
downloadsubsurface-5695ef956b9395dbe924b097a96359c5acacb53f.tar.gz
BLE: if there's no address, use the UUID instead
This is not just for IOS, the same applies on a Mac. But I see no issue with enabling that for all OSs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/btdiscovery.cpp')
-rw-r--r--core/btdiscovery.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp
index cab44b4a6..90eb2e844 100644
--- a/core/btdiscovery.cpp
+++ b/core/btdiscovery.cpp
@@ -174,11 +174,10 @@ QString markBLEAddress(const QBluetoothDeviceInfo *device)
flags = device->coreConfigurations();
if (flags == QBluetoothDeviceInfo::LowEnergyCoreConfiguration)
prefix = "LE:";
-#if defined(Q_OS_IOS)
- return prefix + device->deviceUuid().toString();
-#else
- return prefix + device->address().toString();
-#endif
+ if (device->address().isNull())
+ return prefix + device->deviceUuid().toString();
+ else
+ return prefix + device->address().toString();
}
void BTDiscovery::btDeviceDiscovered(const QBluetoothDeviceInfo &device)