From 4723243eaab00121cbe2ff1016d84eea57ec5e3e Mon Sep 17 00:00:00 2001 From: OliE Date: Sun, 14 Jul 2019 17:06:17 +0200 Subject: [PATCH] wait if services are discovered, see issue #472 (#482) --- .../health/openscale/core/bluetooth/BluetoothCommunication.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java index 1c1ed840..82f731c7 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java @@ -306,6 +306,7 @@ public abstract class BluetoothCommunication { public void onServicesDiscovered(BluetoothPeripheral peripheral) { Timber.d("Successful Bluetooth services discovered"); onBluetoothDiscovery(peripheral); + resumeMachineState(); } @Override @@ -390,6 +391,7 @@ public abstract class BluetoothCommunication { ) { Timber.d("Do LE scan before connecting to device"); central.scanForPeripheralsWithAddresses(new String[]{macAddress}); + stopMachineState(); } else { Timber.d("No location permission, connecting without LE scan");