diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-05-16 18:16:37 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-05-16 18:16:37 +0300 |
commit | 15f809f2a7f555c2bdb8ac152bd187e313a2838c (patch) | |
tree | 81e1b646fc591390df518190b3ba6e7fdc040f4b /src/bluetooth/osx/osxbtledeviceinquiry.mm | |
parent | 83ca3a2471560f09d723157322adc0b5c33ed914 (diff) | |
parent | 42bef3553361d7e56c0d6dea8604f795c815bcee (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.5' into tqtc/lts-5.15-opensourcev5.15.5-lts-lgpl
Change-Id: If90eb1db8f874742b028a258d582bdd0a5fd5322
Diffstat (limited to 'src/bluetooth/osx/osxbtledeviceinquiry.mm')
-rw-r--r-- | src/bluetooth/osx/osxbtledeviceinquiry.mm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bluetooth/osx/osxbtledeviceinquiry.mm b/src/bluetooth/osx/osxbtledeviceinquiry.mm index 70b96ab7..e64ac1db 100644 --- a/src/bluetooth/osx/osxbtledeviceinquiry.mm +++ b/src/bluetooth/osx/osxbtledeviceinquiry.mm @@ -218,7 +218,15 @@ QT_USE_NAMESPACE [elapsedTimer startWithTimeout:inquiryTimeoutMS step:timeStepMS]; } - [manager scanForPeripheralsWithServices:nil options:nil]; + // ### Qt 6.x: remove the use of env. variable, as soon as a proper public API is in place. + bool envOk = false; + const int env = qEnvironmentVariableIntValue("QT_BLUETOOTH_SCAN_ENABLE_DUPLICATES", &envOk); + if (envOk && env) { + [manager scanForPeripheralsWithServices:nil + options:@{CBCentralManagerScanOptionAllowDuplicatesKey : @YES}]; + } else { + [manager scanForPeripheralsWithServices:nil options:nil]; + } } // Else we ignore. #if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) } else if (state == CBManagerStateUnsupported || state == CBManagerStateUnauthorized) { |