From 096a4694427d34dd3a0ce5a7aeb8d2011fb96c8b Mon Sep 17 00:00:00 2001 From: Christian Wassmuth Date: Tue, 10 Jan 2017 10:31:11 +0100 Subject: Add characteristic even if the read fails If during discovery the read of a characteristic fails, then this characteristic was not added to the service. This happens in a special case and not always, when we try to read from a notify only characteristic. Now the characteristic will be added even if the read fails. Task-number: QTBUG-58056 Change-Id: Ib802eeb66aeae92da690c296faf57331123353e6 Reviewed-by: Alex Blasche --- .../src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/android/bluetooth') diff --git a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java index 4d9e0d46..3348e4de 100644 --- a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java +++ b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java @@ -254,8 +254,13 @@ public class QtBluetoothLE { characteristic.getProperties(), characteristic.getValue()); } else { if (isServiceDiscoveryRun) { - //do nothing just continue with queue Log.w(TAG, "onCharacteristicRead during discovery error: " + status); + + Log.d(TAG, "Non-readable characteristic " + characteristic.getUuid() + + " for service " + characteristic.getService().getUuid()); + leCharacteristicRead(qtObject, characteristic.getService().getUuid().toString(), + foundHandle + 1, characteristic.getUuid().toString(), + characteristic.getProperties(), characteristic.getValue()); } else { // This must be in sync with QLowEnergyService::CharacteristicReadError final int characteristicReadError = 5; -- cgit v1.2.3