disconnect method

Future<void> disconnect()

Disconnect from the device

Disconnects from the device and cancels the connection subscription.

Implementation

Future<void> disconnect() async {
  if (state is! BleDeviceConnected) return;

  await _conStateSubs?.cancel();
  await (state as BleDeviceConnected).device.disconnect();
}