bluetoothConnectDevice method

  1. @override
Future<int> bluetoothConnectDevice({
  1. required BluetoothDevice device,
})
override

new connection bluetooth device

Implementation

@override
Future<int> bluetoothConnectDevice({required BluetoothDevice device}) async {
  btCtr = Completer();
  await DtbLinkStorage.instance.saveLastConnectedDevice(device);
  methodChannel.invokeMethod(
    "bluetooth.connect_device",
    {"device_id": device.deviceId, "device_name": device.deviceName},
  );
  return await btCtr?.future;
}