diff options
author | Christian Wassmuth <c.wassmuth@oculus.de> | 2017-01-10 10:31:11 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2017-01-12 15:47:41 +0000 |
commit | 096a4694427d34dd3a0ce5a7aeb8d2011fb96c8b (patch) | |
tree | 840a4f4bb41a4d06561b7ce80b2ffa82e7dd6d27 | |
parent | 60f2f09fa5c402cff7a84f0c56cfa6880968b814 (diff) |
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 <alexander.blasche@qt.io>
-rw-r--r-- | src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java | 7 |
1 files changed, 6 insertions, 1 deletions
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; |