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.mm10
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) {