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 cd8f6887..ceb82a5e 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 @@ -491,6 +491,15 @@ public abstract class BluetoothCommunication { descriptorRequestQueue = new LinkedList<>(); openRequest = false; + try { + // Sleeping a while after discovering services fixes connection problems. + // See https://github.com/NordicSemiconductor/Android-DFU-Library/issues/10 + // for some technical background. + Thread.sleep(1000); + } + catch (Exception e) { + // Empty + } btMachineState = BT_MACHINE_STATE.BT_INIT_STATE; nextMachineStateStep();