summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergycontroller_bluez.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_bluez.cpp')
-rw-r--r--src/bluetooth/qlowenergycontroller_bluez.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp
index 0744bcc4..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
@@ -753,6 +753,10 @@ void QLowEnergyControllerPrivate::l2cpErrorChanged(QBluetoothSocket::SocketError
setError(QLowEnergyController::NetworkError);
qCDebug(QT_BT_BLUEZ) << "Network IO error while talking to LE device";
break;
+ case QBluetoothSocket::RemoteHostClosedError:
+ setError(QLowEnergyController::RemoteHostClosedError);
+ qCDebug(QT_BT_BLUEZ) << "Remote host closed the connection";
+ break;
case QBluetoothSocket::UnknownSocketError:
case QBluetoothSocket::UnsupportedProtocolError:
case QBluetoothSocket::OperationError: