Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.9, 5.10, 5.11.1, 5.11
-
None
-
Mac OS X host, android device (Tablet with Android 6.0.1)
Description
I'm doing a simple application which uses bluetooth connection but I'm getting all kind of errors when disconnecting the sockets, I don't know if these are innocuous errors (stuff qt is handling but just warning) but this thread on the qt forums https://forum.qt.io/topic/92241/bluetooth-on-android/5 seemed to indicate it was indeed a bug. I added an example that reproduces the error. Mind you'll need a device acting as server/receiver (If needed I might do one, don't have one currently).
You can trigger this by just opening and closing the socket, or if you send data you'll get a different error.
When just opening and closing the socket
D libQtBluetoothBug.so: ../QtBluetoothBug/test_class.h:29 (void test_class::onConnected()): connected W System.err: java.io.IOException: socket closed W System.err: at android.net.LocalSocketImpl$SocketInputStream.read(LocalSocketImpl.java:95) W System.err: at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:570) W System.err: at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:96) W System.err: at java.io.InputStream.read(InputStream.java:162) W System.err: at org.qtproject.qt5.android.bluetooth.QtBluetoothInputStreamThread.run(QtBluetoothInputStreamThread.java:86) W libQtBluetoothBug.so: (null):0 ((null)): QMutex: destroying locked mutex
After sending data and closing the socket, seems like it tries to read again?
D libQtBluetoothBug.so: ../QtBluetoothBug/test_class.h:30 (void test_class::onConnected()): connected W System.err: java.io.IOException: bt socket closed, read return: -1 W System.err: at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:573) W System.err: at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:96) W System.err: at java.io.InputStream.read(InputStream.java:162) W System.err: at org.qtproject.qt5.android.bluetooth.QtBluetoothInputStreamThread.run(QtBluetoothInputStreamThread.java:86)