summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2017-07-11 14:49:41 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2017-07-16 15:18:56 +0000
commit746187ad9ef1f8c9a3d797879bb3771377ae4bca (patch)
treec8c158d27a1b9652d3a444f7fb83794d5420c2d4
parentb0089abb05e6f60cc252068be1ba40be32e29bd3 (diff)
BTLE (CoreBluetooth) - prospective fix
The type of manage.state has changed on macOS (like on iOS before), making an declataion invalid. (cherry-picked from qtconnectivity/0c3cc5374d2703fde6a99d301fcff974122d057d) Change-Id: I55caa32fa9f0a85090506cfbd788c1a80d41e8ce Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/bluetooth/osx/osxbtcentralmanager.mm7
-rw-r--r--src/bluetooth/osx/osxbtledeviceinquiry.mm3
2 files changed, 2 insertions, 8 deletions
diff --git a/src/bluetooth/osx/osxbtcentralmanager.mm b/src/bluetooth/osx/osxbtcentralmanager.mm
index f7218ca6..9e5128c4 100644
--- a/src/bluetooth/osx/osxbtcentralmanager.mm
+++ b/src/bluetooth/osx/osxbtcentralmanager.mm
@@ -1032,12 +1032,7 @@ 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
-
+ const auto state = central.state;
#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0)
if (state == CBManagerStateUnknown
|| state == CBManagerStateResetting) {
diff --git a/src/bluetooth/osx/osxbtledeviceinquiry.mm b/src/bluetooth/osx/osxbtledeviceinquiry.mm
index 3ce66d49..05b20167 100644
--- a/src/bluetooth/osx/osxbtledeviceinquiry.mm
+++ b/src/bluetooth/osx/osxbtledeviceinquiry.mm
@@ -233,11 +233,10 @@ QT_USE_NAMESPACE
dispatch_queue_t leQueue(qt_LE_queue());
Q_ASSERT(leQueue);
+ const auto state = central.state;
#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0)
- const CBManagerState state(central.state);
if (state == CBManagerStatePoweredOn) {
#else
- const CBCentralManagerState state(central.state);
if (state == CBCentralManagerStatePoweredOn) {
#endif
if (internalState == InquiryStarting) {