草案
此页面不完整。

安全上下文
此特征只可用于 安全上下文 (HTTPS),在某些或所有 支持浏览器 .

USBAlternateInterface 接口在 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.

构造函数

USBAlternateInterface.USBAlternateInterface
创建新的 USBAlternateInterface object which will be populated with information about the alternate interface of the provided USBInterface with the given alternate setting number.

特性

USBAlternateInterface.alternateSetting 只读
Returns the alternate setting number of this interface. This is equal to the bAlternateSetting field of the interface descriptor defining this interface.
USBAlternateInterface.interfaceClass 只读
Returns the class of this interface. This is equal to the bInterfaceClass field of the interface descriptor defining this interface. Standardized values for this field are defined by the USB Implementers Forum. A value of 0xFF indicates a vendor-defined interface.
USBAlternateInterface.interfaceSubclass 只读
Returns the subclass of this interface. This is equal to the bInterfaceSubClass field of the interface descriptor defining this interface. The meaning of this value depends on the interfaceClass 字段。
USBAlternateInterface.interfaceProtocol 只读
Returns the protocol supported by this interface. This is equal to the bInterfaceProtocol field of the interface descriptor defining this interface. The meaning of this value depends on the interfaceClass and interfaceSubclass 字段。
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 iInterface field of the interface descriptor defining this interface.
USBAlternateInterface.endpoints 只读
Returns an array containing instances of the USBEndpoint interface describing each of the endpoints that are part of this interface.

规范

规范 状态 注释
WebUSB
The definition of 'USBAlternateInterface' in that specification.
草案 初始定义。

浏览器兼容性

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. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
USBAlternateInterface Chrome 61 Edge 79 Firefox No IE No Opera 48 Safari No WebView Android No Chrome Android 61 Firefox Android No Opera Android 45 Safari iOS No Samsung Internet Android 8.0
USBAlternateInterface() 构造函数 Chrome 61 Edge 79 Firefox No IE No Opera 48 Safari No WebView Android No Chrome Android 61 Firefox Android No Opera Android 45 Safari iOS No Samsung Internet Android 8.0
alternateSetting Chrome 61 Edge 79 Firefox No IE No Opera 48 Safari No WebView Android No Chrome Android 61 Firefox Android No Opera Android 45 Safari iOS No Samsung Internet Android 8.0
endpoints Chrome 61 Edge 79 Firefox No IE No Opera 48 Safari No WebView Android No Chrome Android 61 Firefox Android No Opera Android 45 Safari iOS No Samsung Internet Android 8.0
interfaceClass Chrome 61 Edge 79 Firefox No IE No Opera 48 Safari No WebView Android No Chrome Android 61 Firefox Android No Opera Android 45 Safari iOS No Samsung Internet Android 8.0
interfaceName Chrome 61 Edge 79 Firefox No IE No Opera 48 Safari No WebView Android No Chrome Android 61 Firefox Android No Opera Android 45 Safari iOS No Samsung Internet Android 8.0
interfaceProtocol Chrome 61 Edge 79 Firefox No IE No Opera 48 Safari No WebView Android No Chrome Android 61 Firefox Android No Opera Android 45 Safari iOS No Samsung Internet Android 8.0
interfaceSubclass Chrome 61 Edge 79 Firefox No IE No Opera 48 Safari No WebView Android No Chrome Android 61 Firefox Android No Opera Android 45 Safari iOS No Samsung Internet Android 8.0

图例

完整支持

完整支持

不支持

不支持

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

元数据

  • 最后修改: