WebUSB API
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.
- : Creates a new
Instance properties
- USBAlternateInterface.alternateSetting
- : Returns the alternate setting number of this interface. This is equal to the
bAlternateSettingfield of the interface descriptor defining this interface.
- : Returns the alternate setting number of this interface. This is equal to the
- USBAlternateInterface.interfaceClass
- : 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.
- : Returns the class of this interface. This is equal to the
- USBAlternateInterface.interfaceSubclass
- : 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.
- : Returns the subclass of this interface. This is equal to the
- USBAlternateInterface.interfaceProtocol
- : 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.
- : Returns the protocol supported by this interface. This is equal to the
- USBAlternateInterface.interfaceName
- : 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.
- : 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
- USBAlternateInterface.endpoints
- : Returns an array containing instances of the
USBEndpointinterface describing each of the endpoints that are part of this interface.
- : Returns an array containing instances of the
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
