-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
40 lines (29 loc) · 983 Bytes
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
title: "USBDevice: configuration property"
short-title: configuration
slug: Web/API/USBDevice/configuration
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.USBDevice.configuration
---
{{SeeCompatTable}}{{APIRef("WebUSB API")}}{{SecureContext_Header}}
The **`configuration`** read only property of the
{{domxref("USBDevice")}} interface returns a {{domxref("USBConfiguration")}} object for
the currently selected interface for a paired USB device.
## Value
A {{domxref("USBConfiguration")}} object.
## Examples
The following example uses this property to test for the existence of a
USBConfiguration property to select a configuration before claiming an interface.
```js
async function connectDevice(usbDevice) {
await usbDevice.open();
if (usbDevice.configuration === null) await usbDevice.selectConfiguration(1);
await usbDevice.claimInterface(0);
}
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}