recursal/MDN huggingface dataset:
USBDevice: isochronousTransferOut() method
==========================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`isochronousTransferOut()`** method of the
 `USBDevice` interface returns a `Promise` that resolves with a `USBIsochronousOutTransferResult` when time sensitive information has been transmitted from the USB device.

Syntax
------


```js
isochronousTransferOut(endpointNumber, data, packetLengths)
```

### Parameters

`endpointNumber`

The number of a device-specific endpoint (buffer).

`data`

A `TypedArray` containing the data to send to the device.

`packetLengths`

An array of lengths for the packets being transferred.

### Return value

A `Promise` that resolves with a `USBIsochronousOutTransferResult`.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-isochronoustransferout |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: open() method
========================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`open()`** method of the `USBDevice`
 interface returns a `promise` that resolves when a device session has
 started.

Syntax
------


```js
open()
```

### Parameters

None.

### Return value

A `promise`.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-open① |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: releaseInterface() method
====================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`releaseInterface()`** method of the
 `USBDevice` interface returns a `promise` that resolves when a
 claimed interface is released from exclusive access.

Syntax
------


```js
releaseInterface(interfaceNumber)
```

### Parameters

`interfaceNumber`

The device-specific index of the currently-claimed interface.

### Return value

A `promise`.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-releaseinterface① |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: productId property
=============================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`productId`** read only property of the
 `USBDevice` interface the manufacturer-defined code that identifies a USB
 device.

Value
-----

The manufacturer-defined code that identifies a USB device.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-productid |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: deviceVersionMajor property
======================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`deviceVersionMajor`** read only property of the
 `USBDevice` interface he major version number of the device in a semantic
 versioning scheme.

Value
-----

A number.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-deviceversionmajor |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: transferOut() method
===============================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`transferOut()`** method of the `USBDevice`
 interface returns a `promise` that resolves with a
 `USBOutTransferResult` when bulk or interrupt data is sent to the USB
 device.

Syntax
------


```js
transferOut(endpointNumber, data)
```

### Parameters

`endpointNumber`

The number of a device-specific endpoint (buffer).

`data`

A `TypedArray` containing the data to send to the device.

### Return value

A `promise` that resolves with a `USBOutTransferResult`.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-transferout |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: usbVersionMinor property
===================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`usbVersionMinor`** read only property of the
 `USBDevice` interface is one of three properties that declare the USB
 protocol version supported by the device. The other two properties
 are USBDevice.usbVersionMajor and USBDevice.usbVersionSubminor.

Value
-----

 The second of three properties that declare the USB protocol version supported by the
 device.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # dom-usbdevice-usbversionminor |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: manufacturerName property
====================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`manufacturerName`** read only property of the
 `USBDevice` interface the of the organization that manufactured the USB
 device.

Value
-----

A string.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-manufacturername |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: configurations property
==================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`configurations`** read only property of the
 `USBDevice` interface an `array` of device-specific interfaces
 for controlling a paired USB device.

Value
-----

An `array` of `USBConfiguration` objects.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-configurations① |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: deviceClass property
===============================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`deviceClass`** read only property of the
 `USBDevice` interface one of three properties that identify USB devices for
 the purpose of loading a USB driver that will work with that device. The other two
 properties are USBDevice.deviceSubclass and USBDevice.deviceprotocol.

Value
-----

A number.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-deviceclass |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: selectAlternateInterface() method
============================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`selectAlternateInterface()`** method of the
 `USBDevice` interface returns a `promise` that resolves when
 the specified alternative endpoint is selected.

Syntax
------


```js
selectAlternateInterface(interfaceNumber, alternateSetting)
```

### Parameters

`interfaceNumber`

 The index of one of the interfaces supported by the device. Interfaces are
 device-specific.


`alternateSetting`

The configuration of the selected interface.

### Return value

A `promise`.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-selectalternateinterface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: clearHalt() method
=============================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`clearHalt()`** method of the `USBDevice`
 interface returns a `promise` that resolves when a halt condition is
 cleared. A halt condition is when a data transfer to or from the device has a status
 of `'stall'`, which requires the web page (the *host* system, in USB
 terminology) to clear that condition. See the for details.

Syntax
------


```js
clearHalt(direction, endpointNumber)
```

### Parameters

`direction`

 Indicates whether the devices input or output should be cleared. Valid values
 are `'in'` or `'out'`.


`endpointNumber`

 Indicates the number of the endpoint to clear. The promise will reject if an invalid
 endpoint is supplied.


### Return value

A `promise`.

Examples
--------

 The following example shows how to test for and clear a `'stall'` condition
 in the result of a data transfer.


**Note:** What data can be passed to a USB device and how it is passed is particular and unique
 to each device.



```js
while (true) {
  let result = await data.transferIn(1, 6);

  if (result.data && result.data.byteLength === 6) {
    console.log(`Channel 1: ${result.data.getUint16(0)}`);
    console.log(`Channel 2: ${result.data.getUint16(2)}`);
    console.log(`Channel 5: ${result.data.getUint16(4)}`);
  }

  if (result.status === "stall") {
    console.warn("Endpoint stalled. Clearing.");
    await device.clearHalt("in", 1);
  }
}
```

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-clearhalt① |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: controlTransferOut() method
======================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`controlTransferOut()`** method of the `USBDevice` interface returns a `Promise` that resolves with a `USBOutTransferResult` when a command or status operation has been transmitted from the USB device.

Syntax
------


```js
controlTransferOut(setup, data)
```

### Parameters

`setup`

An object that sets options for. The available options are:

`requestType`

Must be one of three values specifying whether the transfer is `"standard"` (common to all USB devices) `"class"` (common to an industry-standard class of devices) or `"vendor"`.

`recipient`

Specifies the target of the transfer on the device, one of `"device"`, `"interface"`, `"endpoint"`, or `"other"`.

`request`

A vendor-specific command.

`value`

Vendor-specific request parameters.

`index`

The interface number of the recipient.


`data`

 A `TypedArray` containing the data that will be transferred to the device.
 Not all commands require data; some commands can send data just through the value parameter.
 Check with your device to see what the specific request requires.


### Return value

A `promise` that resolves with a `USBOutTransferResult`.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-controltransferout① |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: opened property
==========================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`opened`** read only property of the
 `USBDevice` interface indicates whether a session has been started with a
 paired USB device. A device must be opened before it can be controlled by a web page.

Value
-----

A `boolean`.

Examples
--------

 This example is for a hypothetical USB device with a multi-colored LED. It shows how to
 test that a device is open before calling `USBDevice.controlTransferOut` to
 set a specified LED color.


**Note:** What data can be passed to a USB device and how it is passed is particular and unique
 to each device.



```js
async function setDeviceColor(usbDevice, r, g, b) {
  if (device.opened) {
    // This hypothetical USB device requires that the data passed to
    // it be in a Uint8Array.
    const payload = new Uint8Array([r, g, b]);

    await usbDevice.controlTransferOut(
      {
        requestType: "vendor",
        recipient: "device",
        request: 1,
        value: 0,
        index: 0,
      },
      payload,
    );
  }
}
```

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-opened |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: deviceVersionMinor property
======================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`deviceVersionMinor`** read only property of the
 `USBDevice` interface the minor version number of the device in a semantic
 versioning scheme.

Value
-----

A number.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-deviceversionminor |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: selectConfiguration() method
=======================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`selectConfiguration()`** method of the
 `USBDevice` interface returns a `promise` that resolves when
 the specified configuration is selected.

Syntax
------


```js
selectConfiguration(configurationValue)
```

### Parameters

`configurationValue`

The number of a device-specific configuration.

### Return value

A `promise`.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # dom-usbdevice-selectconfiguration |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: usbVersionMajor property
===================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`usbVersionMajor`** read only property of the
 `USBDevice` interface is one of three properties that declare the USB
 protocol version supported by the device. The other two properties
 are USBDevice.usbVersionMinor and USBDevice.usbVersionSubminor.

Value
-----

 The last of three properties that declare the USB protocol version supported by the
 device.

Specifications
--------------

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-usbversionmajor |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Serial: requestPort() method
============================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`Serial.requestPort()`** method of the `Serial` interface returns a `Promise` that resolves with an instance of `SerialPort` representing the device chosen by the user or rejects if no device was selected.

Syntax
------


```js
requestPort()
requestPort(options)
```

### Parameters

`options`

An object with the following properties:

`filters`

A list of objects containing vendor and product IDs used to search for attached devices. The USB Implementors Forum assigns IDs to specific companies. Each company assigns IDs to its products. Filters contain the following values:

`usbVendorId`

An unsigned short integer that identifies a USB device vendor.

`usbProductId`

An unsigned short integer that identifies a USB device.


### Return value

A `Promise` that resolves with an instance of `SerialPort`.

### Exceptions

`SecurityError` `DOMException`

The returned `Promise` rejects with this error if a Permissions Policy blocks the use of this feature or a user permission prompt was denied.

`NotFoundError` `DOMException`

The returned `Promise` rejects with this if the user does not select a port when prompted.

Security
--------

Transient activation is required. The user has to interact with the page or a UI element in order for this feature to work.

Examples
--------

The following example shows a filter being passed to `requestPort()` with a USB vendor ID in order to limit the set of devices shown to the user to only USB devices built by a particular manufacturer. If this filter was omitted the user would be able to select any available port.


```js
button.addEventListener("click", () => {
  const usbVendorId = 0xabcd;
  navigator.serial
    .requestPort({ filters: [{ usbVendorId }] })
    .then((port) => {
      // Connect to `port` or add it to the list of available ports.
    })
    .catch((e) => {
      // The user didn't select a port.
    });
});
```

Specifications
--------------

| Specification |
| --- |
| Web Serial API # dom-serial-requestport |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Serial: getPorts() method
=========================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`getPorts()`** method of the `Serial` interface returns a `Promise` that resolves with an array of `SerialPort` objects representing serial ports connected to the host which the origin has permission to access.

Syntax
------


```js
getPorts()
```

### Parameters

None.

### Return value

A `Promise` that resolves with an array of `SerialPort` objects.

### Exceptions

`SecurityError` `DOMException`

The returned `Promise` rejects with this error if a Permissions Policy blocks the use of this feature or a user permission prompt was denied.

Examples
--------

The following example uses `getPorts()` to initialize a list of available ports.


```js
navigator.serial.getPorts().then((ports) => {
  // Initialize the list of available ports with `ports` on page load.
});
```

Specifications
--------------

| Specification |
| --- |
| Web Serial API # dom-serial-getports |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
GPUError: message property
==========================

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`message`** read-only property of the
 `GPUError` interface provides a human-readable message that explains why the error occurred.

Value
-----

A string.

Examples
--------

For usage examples of error objects based on `GPUError`, see:

* `GPUDevice.popErrorScope`
* The `GPUDevice uncapturederror` event
* `GPUInternalError`, `GPUOutOfMemoryError`, and `GPUValidationError`
Specifications
--------------

| Specification |
| --- |
| WebGPU # dom-gpuerror-message |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The WebGPU API
* WebGPU Error Handling best practices