claimInterface method

Future<void> claimInterface(
  1. ConnectionHandle handle,
  2. int interfaceNumber
)

Claims an interface on a USB device. Before data can be transfered to an interface or associated endpoints the interface must be claimed. Only one connection handle can claim an interface at any given time. If the interface is already claimed, this call will fail.

releaseInterface should be called when the interface is no longer needed.

|handle|: An open connection to the device. |interfaceNumber|: The interface to be claimed.

Implementation

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