listInterfaces method

Future<List<InterfaceDescriptor>> listInterfaces(
  1. ConnectionHandle handle
)

Lists all interfaces on a USB device. |handle|: An open connection to the device.

Implementation

Future<List<InterfaceDescriptor>> listInterfaces(
    ConnectionHandle handle) async {
  var $res = await promiseToFuture<JSArray>(
      $js.chrome.usb.listInterfaces(handle.toJS));
  return $res.toDart
      .cast<$js.InterfaceDescriptor>()
      .map((e) => InterfaceDescriptor.fromJS(e))
      .toList();
}