summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothsocket_bluez.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2017-07-07 10:47:21 +0200
committerAlex Blasche <alexander.blasche@qt.io>2017-07-12 13:57:02 +0000
commitbe5af68f8194ab0c59ca3f4a5bcafd3c71100b52 (patch)
tree611b95e52afef68a1d0c6895199745a8a5e5b2c6 /src/bluetooth/qbluetoothsocket_bluez.cpp
parent0c3cc5374d2703fde6a99d301fcff974122d057d (diff)
Add support for QBluetoothSocket::RemoteHostClosedError on BlueZ
Change-Id: I88ff16001280dea4967887ae711c463304c7ec7d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothsocket_bluez.cpp')
-rw-r--r--src/bluetooth/qbluetoothsocket_bluez.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothsocket_bluez.cpp b/src/bluetooth/qbluetoothsocket_bluez.cpp
index 6aef811a..17b8e738 100644
--- a/src/bluetooth/qbluetoothsocket_bluez.cpp
+++ b/src/bluetooth/qbluetoothsocket_bluez.cpp
@@ -290,7 +290,9 @@ void QBluetoothSocketPrivate::_q_readNotify()
qCWarning(QT_BT_BLUEZ) << Q_FUNC_INFO << socket << "error:" << readFromDevice << errorString;
if (errsv == EHOSTDOWN)
q->setSocketError(QBluetoothSocket::HostNotFoundError);
- else if (errsv != ECONNRESET) // The other side closing the connection is not an error.
+ else if (errsv == ECONNRESET)
+ q->setSocketError(QBluetoothSocket::RemoteHostClosedError);
+ else
q->setSocketError(QBluetoothSocket::UnknownSocketError);
q->disconnectFromService();