1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-20 07:21:40 +02:00

Don't do any cleanup if disconnected before fully connected

Hopefully this fixes #245.
This commit is contained in:
Erik Johansson
2018-04-18 20:52:55 +02:00
parent 7188effbec
commit 0965f67a55

View File

@@ -332,6 +332,9 @@ public abstract class BluetoothCommunication {
public void connect(String hwAddress) {
btAdapter.cancelDiscovery();
// Don't do any cleanup if disconnected before fully connected
btMachineState = BT_MACHINE_STATE.BT_CLEANUP_STATE;
BluetoothDevice device = btAdapter.getRemoteDevice(hwAddress);
bluetoothGatt = device.connectGatt(context, false, gattCallback);
}