getDevices method

Future<List<Device>> getDevices(
  1. EnumerateDevicesOptions options
)

Enumerates connected USB devices. |options|: The properties to search for on target devices.

Implementation

Future<List<Device>> getDevices(EnumerateDevicesOptions options) async {
  var $res =
      await promiseToFuture<JSArray>($js.chrome.usb.getDevices(options.toJS));
  return $res.toDart.cast<$js.Device>().map((e) => Device.fromJS(e)).toList();
}