open method

Future<UsbDevice> open({
  1. int? deviceId,
  2. int? vendorId,
  3. int? productId,
})

Opens connection to device with specified deviceId, or with specified VendorId and ProductId

Implementation

Future<UsbDevice> open({
  int? deviceId,
  int? vendorId,
  int? productId,
}) async {
  Map<String, dynamic> args = {
    "vid": vendorId,
    "pid": productId,
    "deviceId": deviceId
  };
  try {
    dynamic result = await _methodChannel!.invokeMethod("open", args);
    return UsbDevice.fromJSON(result);
  } on PlatformException catch (e) {
    throw _getTypedException(e);
  }
}