setConfiguration method

Future<void> setConfiguration(
  1. ConnectionHandle handle,
  2. int configurationValue
)

Select a device configuration.

This function effectively resets the device by selecting one of the device's available configurations. Only configuration values greater than 0 are valid however some buggy devices have a working configuration 0 and so this value is allowed. |handle|: An open connection to the device.

Implementation

Future<void> setConfiguration(
  ConnectionHandle handle,
  int configurationValue,
) async {
  await promiseToFuture<void>($js.chrome.usb.setConfiguration(
    handle.toJS,
    configurationValue,
  ));
}