1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-15 13:14:22 +02:00

Disconnect from scale if no GATT services are found

May fix exception seen in #330
This commit is contained in:
Erik Johansson
2018-10-06 19:51:28 +02:00
parent 97f954f548
commit b765b775cb

View File

@@ -667,6 +667,12 @@ public abstract class BluetoothCommunication {
Timber.d("onServicesDiscovered: status=%d (%d services)",
status, gatt.getServices().size());
if (gatt.getServices().isEmpty()) {
setBtStatus(BT_STATUS_CODE.BT_UNEXPECTED_ERROR, "No services found");
disconnect(false);
return;
}
synchronized (lock) {
cmdStepNr = 0;
initStepNr = 0;