summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/osx
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/osx')
-rw-r--r--src/bluetooth/osx/corebluetoothwrapper_p.h11
-rw-r--r--src/bluetooth/osx/osxbtcentralmanager.mm19
-rw-r--r--src/bluetooth/osx/osxbtcentralmanager_p.h11
-rw-r--r--src/bluetooth/osx/osxbtchanneldelegate_p.h11
-rw-r--r--src/bluetooth/osx/osxbtconnectionmonitor_p.h11
-rw-r--r--src/bluetooth/osx/osxbtdeviceinquiry_p.h11
-rw-r--r--src/bluetooth/osx/osxbtdevicepair_p.h11
-rw-r--r--src/bluetooth/osx/osxbtl2capchannel_p.h11
-rw-r--r--src/bluetooth/osx/osxbtledeviceinquiry.mm22
-rw-r--r--src/bluetooth/osx/osxbtledeviceinquiry_p.h11
-rw-r--r--src/bluetooth/osx/osxbtrfcommchannel_p.h11
-rw-r--r--src/bluetooth/osx/osxbtsdpinquiry_p.h11
-rw-r--r--src/bluetooth/osx/osxbtservicerecord_p.h11
-rw-r--r--src/bluetooth/osx/osxbtsocketlistener_p.h11
-rw-r--r--src/bluetooth/osx/osxbtutility_p.h11
-rw-r--r--src/bluetooth/osx/uistrings_p.h11
16 files changed, 185 insertions, 10 deletions
diff --git a/src/bluetooth/osx/corebluetoothwrapper_p.h b/src/bluetooth/osx/corebluetoothwrapper_p.h
index d0b6f23c..fe057681 100644
--- a/src/bluetooth/osx/corebluetoothwrapper_p.h
+++ b/src/bluetooth/osx/corebluetoothwrapper_p.h
@@ -34,6 +34,17 @@
#ifndef COREBLUETOOTHWRAPPER_P_H
#define COREBLUETOOTHWRAPPER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#ifndef QT_OSX_BLUETOOTH
#import <CoreBluetooth/CoreBluetooth.h>
diff --git a/src/bluetooth/osx/osxbtcentralmanager.mm b/src/bluetooth/osx/osxbtcentralmanager.mm
index 08905da8..614e4ae5 100644
--- a/src/bluetooth/osx/osxbtcentralmanager.mm
+++ b/src/bluetooth/osx/osxbtcentralmanager.mm
@@ -201,8 +201,8 @@ using namespace QT_NAMESPACE;
return QLowEnergyController::ConnectionError;
}
-#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_9, __IPHONE_6_0)
- if (QSysInfo::MacintoshVersion >= qt_OS_limit(QSysInfo::MV_10_9, QSysInfo::MV_IOS_6_0)) {
+#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_9, __IPHONE_7_0)
+ if (QSysInfo::MacintoshVersion >= qt_OS_limit(QSysInfo::MV_10_9, QSysInfo::MV_IOS_7_0)) {
const quint128 qtUuidData(deviceUuid.toUInt128());
// STATIC_ASSERT on sizes would be handy!
uuid_t uuidData = {};
@@ -229,6 +229,12 @@ using namespace QT_NAMESPACE;
return QLowEnergyController::NoError;
}
#endif
+ // Either SDK or the target is below 10.9/7.0
+ if (![manager respondsToSelector:@selector(retrievePeripherals:)]) {
+ qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "failed to retrive a peripheral";
+ return QLowEnergyController::UnknownRemoteDeviceError;
+ }
+
OSXBluetooth::CFStrongReference<CFUUIDRef> cfUuid(OSXBluetooth::cf_uuid(deviceUuid));
if (!cfUuid) {
qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "failed to create CFUUID object";
@@ -238,7 +244,7 @@ using namespace QT_NAMESPACE;
[uuids addObject:(id)cfUuid.data()];
// Unfortunately, with old Core Bluetooth this call is asynchronous ...
managerState = OSXBluetooth::CentralManagerConnecting;
- [manager retrievePeripherals:uuids];
+ [manager performSelector:@selector(retrievePeripherals:) withObject:uuids.data()];
return QLowEnergyController::NoError;
}
@@ -272,7 +278,12 @@ using namespace QT_NAMESPACE;
if (QSysInfo::MacintoshVersion >= qt_OS_limit(QSysInfo::MV_10_9, QSysInfo::MV_IOS_7_0))
return peripheral.state == CBPeripheralStateConnected;
#endif
- return peripheral.isConnected;
+ // Either SDK or the target is below 10.9/7.0 ...
+ if (![peripheral respondsToSelector:@selector(isConnected)])
+ return false;
+
+ // Ugly cast to deal with id being a pointer ...
+ return reinterpret_cast<quintptr>([peripheral performSelector:@selector(isConnected)]);
}
- (void)disconnectFromDevice
diff --git a/src/bluetooth/osx/osxbtcentralmanager_p.h b/src/bluetooth/osx/osxbtcentralmanager_p.h
index e8d7d234..429bae91 100644
--- a/src/bluetooth/osx/osxbtcentralmanager_p.h
+++ b/src/bluetooth/osx/osxbtcentralmanager_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTCENTRALMANAGER_P_H
#define OSXBTCENTRALMANAGER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qlowenergycontroller.h"
#include "qlowenergyservice.h"
#include "qbluetoothuuid.h"
diff --git a/src/bluetooth/osx/osxbtchanneldelegate_p.h b/src/bluetooth/osx/osxbtchanneldelegate_p.h
index edcf6950..d489ce4e 100644
--- a/src/bluetooth/osx/osxbtchanneldelegate_p.h
+++ b/src/bluetooth/osx/osxbtchanneldelegate_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTCHANNELDELEGATE_P_H
#define OSXBTCHANNELDELEGATE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#include <IOKit/IOReturn.h>
diff --git a/src/bluetooth/osx/osxbtconnectionmonitor_p.h b/src/bluetooth/osx/osxbtconnectionmonitor_p.h
index 4ad28885..38403ca5 100644
--- a/src/bluetooth/osx/osxbtconnectionmonitor_p.h
+++ b/src/bluetooth/osx/osxbtconnectionmonitor_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTCONNECTIONMONITOR_P_H
#define OSXBTCONNECTIONMONITOR_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothaddress.h"
#include <QtCore/qglobal.h>
diff --git a/src/bluetooth/osx/osxbtdeviceinquiry_p.h b/src/bluetooth/osx/osxbtdeviceinquiry_p.h
index 4397b45d..9589eaff 100644
--- a/src/bluetooth/osx/osxbtdeviceinquiry_p.h
+++ b/src/bluetooth/osx/osxbtdeviceinquiry_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTDEVICEINQUIRY_P_H
#define OSXBTDEVICEINQUIRY_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
// We have to import objc code (it does not have inclusion guards).
diff --git a/src/bluetooth/osx/osxbtdevicepair_p.h b/src/bluetooth/osx/osxbtdevicepair_p.h
index a2aa2de0..6a297eff 100644
--- a/src/bluetooth/osx/osxbtdevicepair_p.h
+++ b/src/bluetooth/osx/osxbtdevicepair_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTDEVICEPAIR_P_H
#define OSXBTDEVICEPAIR_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothaddress.h"
#include "osxbtutility_p.h"
diff --git a/src/bluetooth/osx/osxbtl2capchannel_p.h b/src/bluetooth/osx/osxbtl2capchannel_p.h
index 9736bd1d..d46584cf 100644
--- a/src/bluetooth/osx/osxbtl2capchannel_p.h
+++ b/src/bluetooth/osx/osxbtl2capchannel_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTL2CAPCHANNEL_P_H
#define OSXBTL2CAPCHANNEL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#include <Foundation/Foundation.h>
diff --git a/src/bluetooth/osx/osxbtledeviceinquiry.mm b/src/bluetooth/osx/osxbtledeviceinquiry.mm
index af304d8d..c46c68fc 100644
--- a/src/bluetooth/osx/osxbtledeviceinquiry.mm
+++ b/src/bluetooth/osx/osxbtledeviceinquiry.mm
@@ -295,8 +295,8 @@ using namespace QT_NAMESPACE;
Q_ASSERT_X(delegate, Q_FUNC_INFO, "invalid delegate (null)");
-#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_9, __IPHONE_6_0)
- if (QSysInfo::MacintoshVersion >= qt_OS_limit(QSysInfo::MV_10_9, QSysInfo::MV_IOS_6_0)) {
+#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_9, __IPHONE_7_0)
+ if (QSysInfo::MacintoshVersion >= qt_OS_limit(QSysInfo::MV_10_9, QSysInfo::MV_IOS_7_0)) {
if (!peripheral.identifier) {
qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "peripheral without NSUUID";
return;
@@ -310,15 +310,25 @@ using namespace QT_NAMESPACE;
return;
}
#endif
- if (!peripheral.UUID) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "peripheral without UUID";
+ // Either SDK or the target is below 10.9/7.0:
+ // The property UUID was finally removed in iOS 9, we have
+ // to avoid compilation errors ...
+ CFUUIDRef cfUUID = Q_NULLPTR;
+
+ if ([peripheral respondsToSelector:@selector(UUID)]) {
+ // This will require a bridged cast if we switch to ARC ...
+ cfUUID = reinterpret_cast<CFUUIDRef>([peripheral performSelector:@selector(UUID)]);
+ }
+
+ if (!cfUUID) {
+ qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "peripheral without CFUUID";
return;
}
- StringStrongReference key(uuid_as_nsstring(peripheral.UUID));
+ StringStrongReference key(uuid_as_nsstring(cfUUID));
if (![peripherals objectForKey:key.data()]) {
[peripherals setObject:peripheral forKey:key.data()];
- const QBluetoothUuid deviceUuid(OSXBluetooth::qt_uuid(peripheral.UUID));
+ const QBluetoothUuid deviceUuid(OSXBluetooth::qt_uuid(cfUUID));
delegate->LEdeviceFound(peripheral, deviceUuid, advertisementData, RSSI);
}
}
diff --git a/src/bluetooth/osx/osxbtledeviceinquiry_p.h b/src/bluetooth/osx/osxbtledeviceinquiry_p.h
index 7e6d0c8f..ca70bcc1 100644
--- a/src/bluetooth/osx/osxbtledeviceinquiry_p.h
+++ b/src/bluetooth/osx/osxbtledeviceinquiry_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTLEDEVICEINQUIRY_P_H
#define OSXBTLEDEVICEINQUIRY_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothdevicediscoveryagent.h"
#include <QtCore/qdatetime.h>
diff --git a/src/bluetooth/osx/osxbtrfcommchannel_p.h b/src/bluetooth/osx/osxbtrfcommchannel_p.h
index 80758ab0..5da685b2 100644
--- a/src/bluetooth/osx/osxbtrfcommchannel_p.h
+++ b/src/bluetooth/osx/osxbtrfcommchannel_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTRFCOMMCHANNEL_P_H
#define OSXBTRFCOMMCHANNEL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#include <Foundation/Foundation.h>
diff --git a/src/bluetooth/osx/osxbtsdpinquiry_p.h b/src/bluetooth/osx/osxbtsdpinquiry_p.h
index 20b6c66c..1744c3f5 100644
--- a/src/bluetooth/osx/osxbtsdpinquiry_p.h
+++ b/src/bluetooth/osx/osxbtsdpinquiry_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTSDPINQUIRY_H
#define OSXBTSDPINQUIRY_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothaddress.h"
#include "qbluetoothuuid.h"
diff --git a/src/bluetooth/osx/osxbtservicerecord_p.h b/src/bluetooth/osx/osxbtservicerecord_p.h
index fa84147b..dd45953d 100644
--- a/src/bluetooth/osx/osxbtservicerecord_p.h
+++ b/src/bluetooth/osx/osxbtservicerecord_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTSERVICERECORD_P_H
#define OSXBTSERVICERECORD_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "osxbtutility_p.h"
#include <QtCore/qglobal.h>
diff --git a/src/bluetooth/osx/osxbtsocketlistener_p.h b/src/bluetooth/osx/osxbtsocketlistener_p.h
index e4fd8882..535153c7 100644
--- a/src/bluetooth/osx/osxbtsocketlistener_p.h
+++ b/src/bluetooth/osx/osxbtsocketlistener_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTSOCKETLISTENER_P_H
#define OSXBTSOCKETLISTENER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#include <Foundation/Foundation.h>
diff --git a/src/bluetooth/osx/osxbtutility_p.h b/src/bluetooth/osx/osxbtutility_p.h
index 18d8732a..a69e05c2 100644
--- a/src/bluetooth/osx/osxbtutility_p.h
+++ b/src/bluetooth/osx/osxbtutility_p.h
@@ -34,6 +34,17 @@
#ifndef OSXBTUTILITY_P_H
#define OSXBTUTILITY_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qloggingcategory.h>
#include <QtCore/qscopedpointer.h>
#include <QtCore/qsysinfo.h>
diff --git a/src/bluetooth/osx/uistrings_p.h b/src/bluetooth/osx/uistrings_p.h
index 303bad89..f5b1b695 100644
--- a/src/bluetooth/osx/uistrings_p.h
+++ b/src/bluetooth/osx/uistrings_p.h
@@ -34,6 +34,17 @@
#ifndef TRANSLATIONS_H
#define TRANSLATIONS_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QCoreApplication>
#include <QtCore/QString>