getConnectedDevice method

Future<BluetoothDevice?> getConnectedDevice()

Implementation

Future<BluetoothDevice?> getConnectedDevice() async {
  final res = await _channel.invokeMethod('connectedDevice');
  if (res != null) {
    final device = BluetoothDevice._internal(
      name: res['name'],
      address: res['address'],
      type: res['type'],
      isConnected: res['is_connected'],
      printer: this,
    );
    return device;
  }

  return null;
}