summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <Timur.Pocheptsov@digia.com>2015-03-23 17:51:35 +0100
committerTimur Pocheptsov <Timur.Pocheptsov@digia.com>2015-03-24 14:28:17 +0000
commitcd37c6bbc6ad4368bf9f4bc5fb3b8462f2b10cab (patch)
tree3805c69e9d6b2ab49f3e2c38bac7bf8b31409668
parent4103cc487bb92c375fdf4c0b9ab064435320e0a5 (diff)
Bluetooth (classic) service discovery - skip LE devices (OS X)
LE scan on OS X can find LE devices, but CoreBluetooth does not expose hardware addresses and as a result we can not run (and should not) SDP scan on such devices - just skip them. Change-Id: Iaa5c47e1d317c39918d13830c9c6eeab398bc7a5 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_osx.mm7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm b/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm
index 572e445e..64723dd1 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm
@@ -171,6 +171,13 @@ void QBluetoothServiceDiscoveryAgentPrivate::startServiceDiscovery()
state = ServiceDiscovery;
const QBluetoothAddress &address(discoveredDevices.at(0).address());
+ if (address.isNull()) {
+ // This can happen: LE scan works with CoreBluetooth, but CBPeripherals
+ // do not expose hardware addresses.
+ // Pop the current QBluetoothDeviceInfo and decide what to do next.
+ return serviceDiscoveryFinished();
+ }
+
// Autoreleased object.
IOBluetoothHostController *const hc = [IOBluetoothHostController defaultController];
if (![hc powerState]) {