diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2015-02-06 09:57:35 +0100 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2015-02-06 11:40:26 +0000 |
commit | 3a443d269bdb0b5becfe36069bdff40bdff42277 (patch) | |
tree | 9f73fdb915bf4bc8cc2702b29154093b431d7df3 | |
parent | a59972b02fd2c67c41245e76769489bfa887b3e7 (diff) |
Bluetooth - check OS X/iOS version in runtime
Add runtime version checks, compile time can be not enough.
Change-Id: If59131b3a9039a7fe15ccba0346fa71d58f36736
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
-rw-r--r-- | src/bluetooth/qlowenergycontroller_osx.mm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/bluetooth/qlowenergycontroller_osx.mm b/src/bluetooth/qlowenergycontroller_osx.mm index a0ad49de..5b4b24aa 100644 --- a/src/bluetooth/qlowenergycontroller_osx.mm +++ b/src/bluetooth/qlowenergycontroller_osx.mm @@ -44,6 +44,7 @@ #include <QtCore/qloggingcategory.h> #include <QtCore/qsharedpointer.h> #include <QtCore/qbytearray.h> +#include <QtCore/qsysinfo.h> #include <QtCore/qglobal.h> #include <QtCore/qstring.h> #include <QtCore/qlist.h> @@ -95,10 +96,13 @@ ServicePrivate qt_createLEService(QLowEnergyControllerPrivateOSX *controller, CB // TODO: isPrimary is ... always 'NO' - to be investigated. /* #if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_9, __IPHONE_6_0) - if (!cbService.isPrimary) { - // Our guess included/not was probably wrong. - newService->type &= ~QLowEnergyService::PrimaryService; - newService->type |= QLowEnergyService::IncludedService; + using OSXBluetooth::qt_OS_limit; + if (QSysInfo::MacintoshVersion >= qt_OS_limit(QSysInfo::MV_10_9, QSysInfo::MV_IOS_6_0)) { + if (!cbService.isPrimary) { + // Our guess included/not was probably wrong. + newService->type &= ~QLowEnergyService::PrimaryService; + newService->type |= QLowEnergyService::IncludedService; + } } #endif */ |