Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.4
-
None
-
Qt App on Android
-
-
7390de230e3c86049824bef756e4af623a547d61 (qt/qtconnectivity/5.13) 5f6187cb9e17b55cd2a68ac3094ae6a1879b50a2 (qt/qtconnectivity/5.12)
Description
In a Qt App running on android There is a case where a read/notify characteristic's QBluetoothUuid::ClientCharacteristicConfiguration descriptor is invalid.
This happens whenever the following error appears:
W QtBluetoothGatt: onDescriptorcRead during discovery error: 11
I created a patch, which adds the descriptor even if the reading fails in the file QtBluetoothLE.java
There was a similar bug related to characteristic was raised earlier: QTBUG-58056
Now the same happens for descriptor.
Fix applied as below after the line Log.w(TAG, "onDescriptorcRead during discovery error: " + status);
if (status == BluetoothGatt.GATT_SUCCESS) { //TODO avoid sending service and characteristic uuid -> handles should be sufficient leDescriptorRead(qtObject, descriptor.getCharacteristic().getService().getUuid().toString(), descriptor.getCharacteristic().getUuid().toString(), foundHandle + 1, descriptor.getUuid().toString(), descriptor.getValue()); } else { if (isServiceDiscoveryRun) { //ignore Log.w(TAG, "onDescriptorcRead during discovery error: " + status); leDescriptorRead(qtObject, descriptor.getCharacteristic().getService().getUuid().toString(), descriptor.getCharacteristic().getUuid().toString(), foundHandle + 1, descriptor.getUuid().toString(), descriptor.getValue()); } else { // This must be in sync with QLowEnergyService::DescriptorReadError final int descriptorReadError = 6; leServiceError(qtObject, foundHandle + 1, descriptorReadError); } }