create method

Future<UsbPort?> create([
  1. String? type,
  2. int? portNum
])

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. returns the new UsbPort or throws an error on open failure.

Implementation

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