create method

Future<UsbPort?> create([
  1. String type = "",
  2. int iface = -1
])

Creates a UsbPort from the UsbDevice.

type can be any of the UsbSerial.CDC, UsbSerial.CH34x, UsbSerial.CP210x, UsbSerial.FTDI or USBSerial.PL2303 values or empty for auto detection. iface is the USB interface to use or -1 to auto detect. returns the new UsbPort or throws an error on open failure.

Implementation

Future<UsbPort?> create([String type = "", int iface = -1]) async {
  _port = await UsbSerial.createFromDeviceId(deviceId, type, iface);
  return _port;
}