mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-16 13:44:26 +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)",
|
Timber.d("onServicesDiscovered: status=%d (%d services)",
|
||||||
status, gatt.getServices().size());
|
status, gatt.getServices().size());
|
||||||
|
|
||||||
|
if (gatt.getServices().isEmpty()) {
|
||||||
|
setBtStatus(BT_STATUS_CODE.BT_UNEXPECTED_ERROR, "No services found");
|
||||||
|
disconnect(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
cmdStepNr = 0;
|
cmdStepNr = 0;
|
||||||
initStepNr = 0;
|
initStepNr = 0;
|
||||||
|
Reference in New Issue
Block a user