summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/osx/osxbtcentralmanager.mm
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2016-10-11 15:36:14 +0200
committerAlex Blasche <alexander.blasche@qt.io>2016-10-12 11:30:14 +0200
commit515ff5b0f9a2245a13cec6f2d37edd1715cdae8c (patch)
tree3a7748f578d772a5a4e9bcd8b09168657146d695 /src/bluetooth/osx/osxbtcentralmanager.mm
parentca661f332886760f2154ed7ed14550722c554943 (diff)
parent7b443cd0fdd1940a8bfaad73df5e309a52b7669f (diff)
Merge remote-tracking branch 'gerrit/5.7' into 5.8v5.8.0-beta1
Conflicts: src/bluetooth/osx/osxbtledeviceinquiry.mm src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm Change-Id: I7dc75c187af73917f31c28b9edfaf8bcf9652a3e
Diffstat (limited to 'src/bluetooth/osx/osxbtcentralmanager.mm')
-rw-r--r--src/bluetooth/osx/osxbtcentralmanager.mm21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/bluetooth/osx/osxbtcentralmanager.mm b/src/bluetooth/osx/osxbtcentralmanager.mm
index 55a06021..f7218ca6 100644
--- a/src/bluetooth/osx/osxbtcentralmanager.mm
+++ b/src/bluetooth/osx/osxbtcentralmanager.mm
@@ -1032,10 +1032,19 @@ QT_END_NAMESPACE
{
using namespace OSXBluetooth;
+#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0)
+ const CBManagerState state = central.state;
+#else
const CBCentralManagerState state = central.state;
+#endif
+#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0)
+ if (state == CBManagerStateUnknown
+ || state == CBManagerStateResetting) {
+#else
if (state == CBCentralManagerStateUnknown
|| state == CBCentralManagerStateResetting) {
+#endif
// We still have to wait, docs say:
// "The current state of the central manager is unknown;
// an update is imminent." or
@@ -1045,7 +1054,11 @@ QT_END_NAMESPACE
}
// Let's check some states we do not like first:
+#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0)
+ if (state == CBManagerStateUnsupported || state == CBManagerStateUnauthorized) {
+#else
if (state == CBCentralManagerStateUnsupported || state == CBCentralManagerStateUnauthorized) {
+#endif
if (managerState == CentralManagerUpdating) {
// We tried to connect just to realize, LE is not supported. Report this.
managerState = CentralManagerIdle;
@@ -1061,7 +1074,11 @@ QT_END_NAMESPACE
return;
}
+#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0)
+ if (state == CBManagerStatePoweredOff) {
+#else
if (state == CBCentralManagerStatePoweredOff) {
+#endif
managerState = CentralManagerIdle;
if (managerState == CentralManagerUpdating) {
// I've seen this instead of Unsupported on OS X.
@@ -1076,7 +1093,11 @@ QT_END_NAMESPACE
return;
}
+#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0)
+ if (state == CBManagerStatePoweredOn) {
+#else
if (state == CBCentralManagerStatePoweredOn) {
+#endif
if (managerState == CentralManagerUpdating && !disconnectPending) {
managerState = CentralManagerIdle;
[self retrievePeripheralAndConnect];