summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2017-06-16 08:46:29 +0200
committerAlex Blasche <alexander.blasche@qt.io>2017-06-16 07:52:18 +0000
commit1d1b133fa86c0874e8fe3bc9320dd2c3b02de9c3 (patch)
treecf860ed6dc44efdeacb90f0ef19443b613feb517 /src/android
parent2acddda12f98a5022613d05bd62a3133c7de212b (diff)
Handle Android's BluetoothGatt.GATT_FAILURE in QLowEnergyController
The above error code is the equivalent of Android's Unknown error. Therefore we map the code to QLowEnergyController::UnknownError. Task-number: QTBUG-61321 Change-Id: I614c1557c453cd5426f5fa0af69011c4e768657b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java2
1 files changed, 2 insertions, 0 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 35680c82..305359aa 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
@@ -187,6 +187,8 @@ public class QtBluetoothLE {
switch (status) {
case BluetoothGatt.GATT_SUCCESS:
errorCode = 0; break; //QLowEnergyController::NoError
+ case BluetoothGatt.GATT_FAILURE: // Android's equivalent of "do not know what error it is"
+ errorCode = 1; break; //QLowEnergyController::UnknownError
case 8: // BLE_HCI_CONNECTION_TIMEOUT
case 22: // BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION
Log.w(TAG, "Connection Error: Try to delay connect() call after previous activity");