summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothlocaldevice_osx.mm
diff options
context:
space:
mode:
authorTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-09-30 15:41:06 +0200
committerTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-09-30 15:54:01 +0200
commitbc64db71004f2e3c92c3a6975047845e5b92c2ba (patch)
treed5f1f88aa8bf61235b9962204cfbd4e98170b2c6 /src/bluetooth/qbluetoothlocaldevice_osx.mm
parent3c98a82f2c1769578637b28658b124c5e1ee07c5 (diff)
QBluetoothLocalDevice - bug fix for OS X.
It was a very stupid idea to compare a string from IOBluetooth with QString, representing Bluetooth address - IOBluetooth uses '-' as a separator + the hex digits can be in lower case :) - making strings not equal :) Compare two QBluetoothAddresses instead. Change-Id: If4a43d254f766efd9f935a7633a4274aa6708e59 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothlocaldevice_osx.mm')
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_osx.mm10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice_osx.mm b/src/bluetooth/qbluetoothlocaldevice_osx.mm
index 56a7fb7e..38f15b8c 100644
--- a/src/bluetooth/qbluetoothlocaldevice_osx.mm
+++ b/src/bluetooth/qbluetoothlocaldevice_osx.mm
@@ -50,6 +50,7 @@
#include <QtCore/qdebug.h>
#include <QtCore/qmap.h>
+#include <IOBluetooth/IOBluetoothUtilities.h>
// We have to import, not include. Obj-C headers are not protected
// against a multiple inclusion.
#import <IOBluetooth/objc/IOBluetoothHostController.h>
@@ -133,7 +134,14 @@ QBluetoothLocalDevicePrivate::QBluetoothLocalDevicePrivate(QBluetoothLocalDevice
return;
}
- if (address.toString() != QString::fromNSString(hciAddress)) {
+ BluetoothDeviceAddress iobtAddress = {};
+ if (IOBluetoothNSStringToDeviceAddress(hciAddress, &iobtAddress) != kIOReturnSuccess) {
+ qCCritical(QT_BT_OSX) << "QBluetoothLocalDevicePrivate(), "
+ "invalid local device's address";
+ return;
+ }
+
+ if (address != OSXBluetooth::qt_address(&iobtAddress)) {
qCCritical(QT_BT_OSX) << "QBluetoothLocalDevicePrivate(), "
"invalid local device's address";
return;