Problem Bluetooth on Android (RFCOMM)
-
Hi,
I have developed an application with SPP connection.
It's works fine on Nexus 5, nexus 4 and galaxy note 10.1
But it's not work on SAMSUNG Galaxy Core Prime (SM-G360F). The connection is OK only 1 time out of 30 (on average)I have the following errors:
W/System.err(26847): at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:644)
W/System.err(26847): at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:655)
W/System.err(26847): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:418)
W/System.err(26847): at dalvik.system.NativeStart.run(Native Method)
W/libTerm-V1_41.so(26847): (null):0 ((null)): qt.bluetooth.android: Falling back to workaround.
W/libTerm-V1_41.so(26847): (null):0 ((null)): qt.bluetooth.android: Cannot determine RFCOMM service channel.
W/libTerm-V1_41.so(26847): (null):0 ((null)): qt.bluetooth.android: Workaround thread invoked.My code is the following:
QBluetoothUuid Uuid=QBluetoothUuid::SerialPort;
socket->connectToService(ListeAdresse[NobjetItemSelected],Uuid);if you have ideas, they are welcome
Thank you.
-
@Ross Just to add my .02.. back then Qt's Serial and bluetooth support was really bad. And I mean really bad.
I dug through a lot of the Qt code when I was having problems and there were sections that were completely unfinished. The code didn't handle every path that it could take. It would literally just end in places with empty curly braces for certain situations.
It may be better now, but I tried it about a year ago with credit card terminals and bluetooth and it was still just as bad as before.
I don't know how it is now-a-days but I would factor that information in to any decision to use QtBluetooth or Serial on a project with any sort of tight deadline. ;)