summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2017-04-07 19:40:34 +0300
committerAlex Blasche <alexander.blasche@qt.io>2017-07-10 05:52:08 +0000
commitd901c65f6a3629c470a05be81d5810a59b7bdd69 (patch)
treed6402cdcd066086abd64fb6ef1f32de0a5315883 /src/android
parent1a6a18b9132e8b82d3b91f9ccbd7405599003fe3 (diff)
LE/Android: Handle "connection reset by remote device" errors
Change-Id: Iaaa79b2f14e7abd5d849895301ed404efa079f07 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java6
1 files changed, 6 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 305359aa..9571ffdc 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
@@ -193,6 +193,12 @@ public class QtBluetoothLE {
case 22: // BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION
Log.w(TAG, "Connection Error: Try to delay connect() call after previous activity");
errorCode = 5; break; //QLowEnergyController::ConnectionError
+ case 19: // BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION
+ case 20: // BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES
+ case 21: // BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF
+ Log.w(TAG, "The remote host closed the connection");
+ errorCode = 7; //QLowEnergyController::RemoteHostClosedError
+ break;
default:
Log.w(TAG, "Unhandled error code on connectionStateChanged: " + status + " " + newState);
errorCode = status; break; //TODO deal with all errors