Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
5.3.2
-
None
-
Architecture armhf, Emdebian Wheezy, bluez 4.99, Qt 5.3.2
Description
When trying to listen on a port that is already registered, the behaviour of QBluetoothServer::listen on android and bluez differs as far as I can see from the source:
Android: set lastError to ServiceAlreadyRegisteredError
bluez: set lastError to InputOutputError
https://qt.gitorious.org/qt/qtconnectivity/source/167faeec86ed4d9c9f099f5180784c7b0cb9aa42:src/bluetooth/qbluetoothserver_bluez.cpp#L164
https://qt.gitorious.org/qt/qtconnectivity/source/167faeec86ed4d9c9f099f5180784c7b0cb9aa42:src/bluetooth/qbluetoothserver_android.cpp#L200
When using bluez it's also possible to set lastError to ServiceAlreadyRegisteredError, since bind returns EADDRINUSE when the port is already in use.
http://lxr.free-electrons.com/source/net/bluetooth/rfcomm/sock.c#L362
I tested this with bluez 4.99 and it works fine.