diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-11-05 13:21:21 +0100 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-11-05 13:29:23 +0100 |
commit | c627c076b10ca88e2a1e1853eafc8ca6e609422d (patch) | |
tree | 6d07f8e2a54bdbc6564fd2c74833a912b22ddfe1 /src/bluetooth/qbluetoothservicediscoveryagent_osx.mm | |
parent | 873546691bdd9f67988b8599941c2b52e0003dc4 (diff) |
Bluetooth - service discovery bugfix/test update on OS X
SDP inquiry either fails to start, or ends with an error. The failure at
start was not handled correctly (probably messing with failing tests as a result).
Print the original IOKit return code, set an error (thus emitting signal) +
also make a test case verbose to see these error codes.
Change-Id: Ica3cc5681b91f02a6b7f7e2681a653b5a9dbfd46
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothservicediscoveryagent_osx.mm')
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent_osx.mm | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm b/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm index 117f3880..9311df55 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm +++ b/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm @@ -195,8 +195,16 @@ void QBluetoothServiceDiscoveryAgentPrivate::startServiceDiscovery() if (DiscoveryMode() == QBluetoothServiceDiscoveryAgent::MinimalDiscovery) { performMinimalServiceDiscovery(address); } else { - uuidFilter.size() ? [serviceInquiry performSDPQueryWithDevice:address filters:uuidFilter] - : [serviceInquiry performSDPQueryWithDevice:address]; + IOReturn result = kIOReturnSuccess; + if (uuidFilter.size()) + result = [serviceInquiry performSDPQueryWithDevice:address filters:uuidFilter]; + else + result = [serviceInquiry performSDPQueryWithDevice:address]; + + if (result != kIOReturnSuccess) { + // Failed immediately to perform an SDP inquiry on IOBluetoothDevice: + SDPInquiryError(nil, result); + } } } @@ -322,7 +330,9 @@ void QBluetoothServiceDiscoveryAgentPrivate::SDPInquiryFinished(IOBluetoothDevic void QBluetoothServiceDiscoveryAgentPrivate::SDPInquiryError(IOBluetoothDevice *device, IOReturn errorCode) { Q_UNUSED(device) - Q_UNUSED(errorCode) + + qCWarning(QT_BT_OSX) << "QBluetoothServiceDiscoveryAgentPrivate::SDPInquiryError(), " + "inquiry failed with IOKit code: " << int(errorCode); discoveredDevices.clear(); // TODO: find a better mapping from IOReturn to QBluetoothServiceDiscoveryAgent::Error. |