summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/osx/osxbtledeviceinquiry.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/osx/osxbtledeviceinquiry.mm')
-rw-r--r--src/bluetooth/osx/osxbtledeviceinquiry.mm13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bluetooth/osx/osxbtledeviceinquiry.mm b/src/bluetooth/osx/osxbtledeviceinquiry.mm
index f3a95820..5cf9b193 100644
--- a/src/bluetooth/osx/osxbtledeviceinquiry.mm
+++ b/src/bluetooth/osx/osxbtledeviceinquiry.mm
@@ -204,8 +204,13 @@ using namespace QT_NAMESPACE;
dispatch_queue_t leQueue(qt_LE_queue());
Q_ASSERT(leQueue);
+#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0)
+ const CBManagerState cbState(central.state);
+ if (cbState == CBManagerStatePoweredOn) {
+#else
const CBCentralManagerState cbState(central.state);
if (cbState == CBCentralManagerStatePoweredOn) {
+#endif
if (internalState == InquiryStarting) {
internalState = InquiryActive;
// Scan time is actually 10 seconds. Having a block with such delay can prevent
@@ -220,7 +225,11 @@ using namespace QT_NAMESPACE;
});
[manager scanForPeripheralsWithServices:nil options:nil];
} // Else we ignore.
+#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0)
+ } else if (state == CBManagerStateUnsupported || state == CBManagerStateUnauthorized) {
+#else
} else if (state == CBCentralManagerStateUnsupported || state == CBCentralManagerStateUnauthorized) {
+#endif
if (internalState == InquiryActive) {
[manager stopScan];
// Not sure how this is possible at all, probably, can never happen.
@@ -230,7 +239,11 @@ using namespace QT_NAMESPACE;
}
[manager setDelegate:nil];
+#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0)
+ } else if (cbState == CBManagerStatePoweredOff) {
+#else
} else if (cbState == CBCentralManagerStatePoweredOff) {
+#endif
if (internalState == InquiryStarting) {
#ifndef Q_OS_OSX
// On iOS a user can see at this point an alert asking to enable