Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.9.0
-
None
Description
When running a service discovery on Android and a non-standard Bluetooth UUID is found, the returned UUID is not correct. To take an example, the custom UUID
e8e10f95-1a70-4b27-9ccf-02010264e9c8
is used by QtBluetooth's btchat example or the bttestui example. Android version 6.0.1 or above return/discover the following incorrect UUID though:
c8e96402-0102-cf9c-274b-701a950fe1e8
The individual bytes have been incorrectly swapped around. This bug is tracked as
https://issuetracker.google.com/issues/37076498
This is an Android bug and QtBluetooth can only work around the issue. User code may use the following code to reverse the byte order:
quint128 buffer = QBluetoothUuid(...).toUInt128(); quint128 correctedUuid = {}; for (int i = 0; i < 16; i++) correctedUuid.data[15 - i] = buffer.data[i]; result = QBluetoothUuid(correctedUuid);
The bug does not happen when the service's uuid is a standard UUID derived from the Bluetooth base UUID (00000000-0000-1000-8000-00805F9B34FB).
Attachments
Issue Links
- is duplicated by
-
QTBUG-63085 QBluetooth
- Closed
- relates to
-
QTBUG-61542 bluetooth scan services cant find any service on android
- Closed
For Gerrit Dashboard: QTBUG-61392 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
197376,6 | Workaround for Android SDP discovery bug | 5.9 | qt/qtconnectivity | Status: MERGED | +2 | 0 |
197377,3 | Adjust bttestui to Android's SDP discovery problems | 5.9 | qt/qtconnectivity | Status: MERGED | +2 | 0 |
198106,2 | Adjust qml chat example to workaround required to Android SDP bug | 5.9 | qt/qtconnectivity | Status: MERGED | +2 | 0 |
198314,3 | Adjust pingpong example to Android UUID SDP discovery bug | 5.9 | qt/qtconnectivity | Status: MERGED | +2 | 0 |
198727,2 | Adjust btchat example to Android UUID SDP discovery bug | 5.9 | qt/qtconnectivity | Status: MERGED | +2 | 0 |