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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user