From 5695ef956b9395dbe924b097a96359c5acacb53f Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 16 Sep 2017 20:15:15 -0700 Subject: 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 --- core/btdiscovery.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'core/btdiscovery.cpp') 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) -- cgit v1.2.3-70-g09d2