From b6bf84ed241a74d796a435163019c6a1c5af12af Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 5 Oct 2016 16:00:32 +0200 Subject: BTLE device discovery - fix incorrect comparisons (iOS/macOS) 'state' is an instance variable (the type is LEInquiryState), that holds the previous inquiry state, while testing manager's state, we must use a local variable 'cbState' (CBCentralManagerState) instead. Change-Id: Ie1c4dbdb4fae571c94d7565a8de78657e252de7b Reviewed-by: Alex Blasche --- src/bluetooth/osx/osxbtledeviceinquiry.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bluetooth/osx/osxbtledeviceinquiry.mm b/src/bluetooth/osx/osxbtledeviceinquiry.mm index df4dab69..4610ab88 100644 --- a/src/bluetooth/osx/osxbtledeviceinquiry.mm +++ b/src/bluetooth/osx/osxbtledeviceinquiry.mm @@ -220,9 +220,9 @@ QT_USE_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 if (cbState == CBManagerStateUnsupported || cbState == CBManagerStateUnauthorized) { #else - } else if (state == CBCentralManagerStateUnsupported || state == CBCentralManagerStateUnauthorized) { + } else if (cbState == CBCentralManagerStateUnsupported || cbState == CBCentralManagerStateUnauthorized) { #endif if (internalState == InquiryActive) { [manager stopScan]; -- cgit v1.2.3