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