diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2017-07-18 17:15:51 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2017-07-20 11:49:07 +0000 |
commit | d206d1e4182f6e1a79c05bd1c11a5acf5ec80c22 (patch) | |
tree | b8ba404dbb96a0997bd7d129003fc6f087d0804d | |
parent | 7d5ff0b74b29dac8c413b5707e18453876b608cd (diff) |
Enable default services for all central use cases on BlueZ
Qt 5.9 introduced this behavior change as part of a bug fix. Qt 5.10
will force the new behavior unless otherwise requested by the user.
Task-number: QTBUG-61554
Change-Id: I75a2107c64e0eaaf03490658669c9a23ac7dcf63
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r-- | src/bluetooth/qlowenergycontroller_bluez.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp index 8eee2ab2..ca3f7760 100644 --- a/src/bluetooth/qlowenergycontroller_bluez.cpp +++ b/src/bluetooth/qlowenergycontroller_bluez.cpp @@ -648,9 +648,9 @@ void QLowEnergyControllerPrivate::establishL2cpClientSocket() void QLowEnergyControllerPrivate::createServicesForCentralIfRequired() { - //only enable when requested - //for now we use env variable to activate the feature - if (Q_LIKELY(!qEnvironmentVariableIsSet("QT_DEFAULT_CENTRAL_SERVICES"))) + bool ok = false; + int value = qEnvironmentVariableIntValue("QT_DEFAULT_CENTRAL_SERVICES", &ok); + if (Q_UNLIKELY(ok && value == 0)) return; //nothing to do //do not add the services each time we start a connection |