Draft
This page is not complete.
Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The USBAlternateInterface interface of the WebUSB API provides information about a particular configuration of an interface provided by the USB device. An interface includes one or more alternate settings which can configure a set of endpoints based on the operating mode of the device.
Constructor
USBAlternateInterface.USBAlternateInterface- Creates a new
USBAlternateInterfaceobject which will be populated with information about the alternate interface of the providedUSBInterfacewith the given alternate setting number.
Properties
USBAlternateInterface.alternateSettingRead only- Returns the alternate setting number of this interface. This is equal to the
bAlternateSettingfield of the interface descriptor defining this interface. USBAlternateInterface.interfaceClassRead only- Returns the class of this interface. This is equal to the
bInterfaceClassfield of the interface descriptor defining this interface. Standardized values for this field are defined by the USB Implementers Forum. A value of0xFFindicates a vendor-defined interface. USBAlternateInterface.interfaceSubclassRead only- Returns the subclass of this interface. This is equal to the
bInterfaceSubClassfield of the interface descriptor defining this interface. The meaning of this value depends on theinterfaceClassfield. USBAlternateInterface.interfaceProtocolRead only- Returns the protocol supported by this interface. This is equal to the
bInterfaceProtocolfield of the interface descriptor defining this interface. The meaning of this value depends on theinterfaceClassandinterfaceSubclassfields. USBAlternateInterface.interfaceNameRead only- Returns the name of the interface, if one is provided by the device. This is the value of the string descriptor with the index specified by the
iInterfacefield of the interface descriptor defining this interface. USBAlternateInterface.endpointsRead only- Returns an array containing instances of the
USBEndpointinterface describing each of the endpoints that are part of this interface.
Specifications
| Specification | Status | Comment |
|---|---|---|
| WebUSB The definition of 'USBAlternateInterface' in that specification. |
Draft | Initial definition. |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
USBAlternateInterface | Chrome Full support 61 | Edge Full support 79 | Firefox No support No | IE No support No | Opera Full support 48 | Safari No support No | WebView Android No support No | Chrome Android Full support 61 | Firefox Android No support No | Opera Android Full support 45 | Safari iOS No support No | Samsung Internet Android Full support 8.0 |
USBAlternateInterface() constructor | Chrome Full support 61 | Edge Full support 79 | Firefox No support No | IE No support No | Opera Full support 48 | Safari No support No | WebView Android No support No | Chrome Android Full support 61 | Firefox Android No support No | Opera Android Full support 45 | Safari iOS No support No | Samsung Internet Android Full support 8.0 |
alternateSetting | Chrome Full support 61 | Edge Full support 79 | Firefox No support No | IE No support No | Opera Full support 48 | Safari No support No | WebView Android No support No | Chrome Android Full support 61 | Firefox Android No support No | Opera Android Full support 45 | Safari iOS No support No | Samsung Internet Android Full support 8.0 |
endpoints | Chrome Full support 61 | Edge Full support 79 | Firefox No support No | IE No support No | Opera Full support 48 | Safari No support No | WebView Android No support No | Chrome Android Full support 61 | Firefox Android No support No | Opera Android Full support 45 | Safari iOS No support No | Samsung Internet Android Full support 8.0 |
interfaceClass | Chrome Full support 61 | Edge Full support 79 | Firefox No support No | IE No support No | Opera Full support 48 | Safari No support No | WebView Android No support No | Chrome Android Full support 61 | Firefox Android No support No | Opera Android Full support 45 | Safari iOS No support No | Samsung Internet Android Full support 8.0 |
interfaceName | Chrome Full support 61 | Edge Full support 79 | Firefox No support No | IE No support No | Opera Full support 48 | Safari No support No | WebView Android No support No | Chrome Android Full support 61 | Firefox Android No support No | Opera Android Full support 45 | Safari iOS No support No | Samsung Internet Android Full support 8.0 |
interfaceProtocol | Chrome Full support 61 | Edge Full support 79 | Firefox No support No | IE No support No | Opera Full support 48 | Safari No support No | WebView Android No support No | Chrome Android Full support 61 | Firefox Android No support No | Opera Android Full support 45 | Safari iOS No support No | Samsung Internet Android Full support 8.0 |
interfaceSubclass | Chrome Full support 61 | Edge Full support 79 | Firefox No support No | IE No support No | Opera Full support 48 | Safari No support No | WebView Android No support No | Chrome Android Full support 61 | Firefox Android No support No | Opera Android Full support 45 | Safari iOS No support No | Samsung Internet Android Full support 8.0 |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
