1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-20 07:21:40 +02:00

Log and handle discoverServices() returning false

This commit is contained in:
Erik Johansson
2018-05-26 23:07:04 +02:00
parent 3f11e55a99
commit ced597c07c

View File

@@ -553,7 +553,11 @@ public abstract class BluetoothCommunication {
catch (Exception e) {
// Empty
}
gatt.discoverServices();
if (!gatt.discoverServices()) {
Timber.e("Could not start service discovery");
setBtStatus(BT_STATUS_CODE.BT_CONNECTION_LOST);
disconnect(false);
}
}
else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
setBtStatus(connectionEstablished