third_party/libusb/webport/src/libusb-to-webusb-adaptor.js
/**
   * Performs a bulk or an interrupt transfer (this is determined by the type of
   * the endpoint specified via `parameters.endpointAddress`).
   * @private
   * @param {number} deviceId
   * @param {number} deviceHandle
   * @param {!LibusbJsGenericTransferParameters} parameters
   * @return {!Promise<!LibusbJsTransferResult>}
   */
Performs a bulk or an interrupt transfer (this is determined by the type of
the endpoint specified via `parameters.endpointAddress`).
Performs a bulk or an interrupt transfer ( this is determined by the type of the endpoint specified via ` parameters . endpointAddress ` ) .
async genericTransfer_(deviceId, deviceHandle, parameters) {
    const deviceState =
        this.getDeviceByIdAndHandleOrThrow_(deviceId, deviceHandle);
    const endpointNumber = parameters['endpointAddress'] & 0xF;
    let transferResult;
    if (parameters['dataToSend']) {
      transferResult = await callWebusbDeviceTransferOut(
          deviceState.webusbDevice, endpointNumber, parameters['dataToSend']);
    } else {
      transferResult = await callWebusbDeviceTransferIn(
          deviceState.webusbDevice, endpointNumber,
          parameters['lengthToReceive']);
    }
    return getLibusbJsTransferResultOrThrow(transferResult);
  }
async genericTransfer_ ( deviceId , deviceHandle , parameters ) { const deviceState = this . getDeviceByIdAndHandleOrThrow_ ( deviceId , deviceHandle ) ; const endpointNumber = parameters [ 'endpointAddress' ] & 0xF ; let transferResult ; if ( parameters [ 'dataToSend' ] ) { transferResult = await callWebusbDeviceTransferOut ( deviceState . webusbDevice , endpointNumber , parameters [ 'dataToSend' ] ) ; } else { transferResult = await callWebusbDeviceTransferIn ( deviceState . webusbDevice , endpointNumber , parameters [ 'lengthToReceive' ] ) ; } return getLibusbJsTransferResultOrThrow ( transferResult ) ; }
Performs a bulk or an interrupt transfer (this is determined by the type of
 the endpoint specified via `parameters.endpointAddress`).
Performs a bulk or an interrupt transfer ( this is determined by the type of the endpoint specified via ` parameters . endpointAddress ` ) .
// According to the USB specification, the endpoint address contains the // endpoint number in bits 0..3.