【USB笔记】 标准设备请求Standard Device Requests
USB笔记 标准设备请求 Standard Device Requests
这里主要列举出所有设备定义的标准设备请求。分别概述了标准设备请求(Standard Device Requests)和给出了标准请求代码(Standard Request Codes)和描述符类型(Descriptor Types)。概念部分主要从各种USB协议中整理,涵盖范围从USB 2.0到 USB 3.2协议。注意并不是所有协议都支持所有的标准设备请求,具体不同协议的差异可以参照附录。
标准设备请求(Standard Device Requests),例如下图的Get Descriptor就是一个USB设备标准请求。
对于标准设备请求,设备要求即使在尚未分配地址或尚未配置的时候,也应该响应标准设备请求。如果标准请求定义了一个可以修改的持久性参数,该参数的重置值或默认值为零,除非该参数另有规定。
标准设备请求 Standard Device Requests
下表是标准设备请求,概述了标准设备请求的基本情况。
bmRequestType | bRequest | wValue | wIndex | wLength | Data | ||
00000000B 00000001B 00000010B |
CLEAR_FEATURE | Feature Selector |
Zero Interface Endpoint |
Zero | None | ||
10000000B | GET_CONFIGURATION | Zero | Zero | One | Configuration Value | ||
10000000B | GET_DESCRIPTOR | Descriptor Type and Descriptor Index | Zero or Language ID | Descriptor Length | Descriptor | ||
10000001B | GET_INTERFACE | Zero | Interface | One | Alternate Interface | ||
10000000B 10000001B 10000010B |
GET_STATUS | Zero | Status Type |
Zero Interface Endpoint |
Two | Device, Interface, or Endpoint Status | |
00000000B | SET_ADDRESS | Device Address | Zero | Zero | None | ||
00000000B | SET_CONFIGURATION | Configuration Value | Zero | Zero | None | ||
00000000B | SET_DESCRIPTOR | Descriptor Type and Descriptor Index | Zero or Language ID | Descriptor Length | Descriptor | ||
00000000B 00000001B 00000010B |
SET_FEATURE | Feature Selector | Options |
Zero Interface Endpoint |
Zero | None | |
00000001B | SET_INTERFACE | Alternate Setting | Interface | Zero | None | ||
00000000B | SET_ISOCH_DELAY | Delay in ns | Zero | Zero | None | ||
00000000B | SET_SEL | Zero | Zero | Six | Exit Latency Values | ||
10000010B | SYNCH_FRAME | Zero | Endpoint | Two | Frame Number | ||
标准请求代码 Standard Request Codes
下表是标准请求代码,对应着标准设备请求中的bRequest字段。
bRequest | Value |
---|---|
GET_STATUS | 0 |
CLEAR_FEATURE | 1 |
Reserved for future use | 2 |
SET_FEATURE | 3 |
Reserved for future use | 4 |
SET_ADDRESS | 5 |
GET_DESCRIPTOR | 6 |
SET_DESCRIPTOR | 7 |
GET_CONFIGURATION | 8 |
SET_CONFIGURATION | 9 |
GET_INTERFACE | 10 |
SET_INTERFACE | 11 |
SYNCH_FRAME | 12 |
SET_ENCRYPTION | 13 |
GET_ENCRYPTION | 14 |
SET_HANDSHAKE | 15 |
GET_HANDSHAKE | 16 |
SET_CONNECTION | 17 |
SET_SECURITY_DATA | 18 |
GET_SECURITY_DATA | 19 |
SET_WUSB_DATA | 20 |
LOOPBACK_DATA_WRITE | 21 |
LOOPBACK_DATA_READ | 22 |
SET_INTERFACE_DS | 23 |
SET_SEL | 48 |
SET_ISOCH_DELAY | 49 |
描述符类型 Descriptor Types
下表是描述符类型,对应着部分标准设备请求中的wValue字段中的Descriptor Type。
Descriptor Types | Value |
---|---|
DEVICE | 1 |
CONFIGURATION | 2 |
STRING | 3 |
INTERFACE | 4 |
ENDPOINT | 5 |
Reserved | 6 |
Reserved | 7 |
INTERFACE_POWER | 8 |
OTG | 9 |
DEBUG | 10 |
INTERFACE_ASSOCIATION | 11 |
BOS | 15 |
DEVICE CAPABILITY | 16 |
SUPERSPEED_USB_ENDPOINT_COMPANION | 48 |
SUPERSPEEDPLUS_ISOCHRONOUS_ENDPOINT_COMPANION | 49 |
标准特性选择器 Standard Feature Selectors
下表是标准特性选择器(feature selector),表中给出了feature selector的接收端(Recipient)和feature selector对应的数值(value),其中数值(value)就是对应着部分标准设备请求中的wValue字段中的Feature selector。
特性选择器(feature selectors)用于启用或设置特定于设备(device)、接口(interface)或端点(endpoint)的特性(features)。例如远程唤醒(remote wakeup)功能。
Feature Selector | Recipient | Value |
---|---|---|
ENDPOINT_HALT | Endpoint | 0 |
FUNCTION_SUSPEND | Interface | 0 |
DEVICE_REMOTE_WAKEUP | Device | 1 |
TEST_MODE | Device | 2 |
b_hnp_enable | Device | 3 |
a_hnp_support | Device | 4 |
a_alt_hnp_support | Device | 5 |
WUSB_DEVICE | Device | 6 |
U1_ENABLE | Device | 48 |
U2_ENABLE | Device | 49 |
LTM_ENABLE | Device | 50 |
B3_NTF_HOST_REL | Device | 51 |
B3_RSP_ENABLE | Device | 52 |
LDM_ENABLE | Device | 53 |
如果向设备发出了不支持或无效的请求(request),设备会在请求的数据阶段(Data stage)或状态阶段(Status stage)返回一个STALL事务包(STALL Transaction Packet)。如果设备在设置阶段(Setup stage)检测到错误,则设备最好在数据或状态阶段中较早的阶段返回一个STALL事务包。接收不支持或无效的请求不会导致控制管道(control pipe)上的停止特性(Halt feature)被设置。如果由于任何原因,设备因错误条件而无法通过其默认控制管道进行通信,则应重置设备以清除该条件并重新启动默认控制管道。
附录
USB2.0 Standard Device Requests
USB2.0所支持的Standard Device Requests会比上面的少,如下表:
USB2.0 Standard Device Requests
bmRequestType | bRequest | wValue | wIndex | wLength | Data |
---|---|---|---|---|---|
00000000B 00000001B 00000010B |
CLEAR_FEATURE | Feature Selector |
Zero Interface Endpoint |
Zero | None |
10000000B | GET_CONFIGURATION | Zero | Zero | One | Configuration Value |
10000000B | GET_DESCRIPTOR | Descriptor Type and Descriptor Index | Zero or Language ID | Descriptor Length | Descriptor |
10000001B | GET_INTERFACE | Zero | Interface | One | Alternate Interface |
10000000B 10000001B 10000010B |
GET_STATUS | Zero |
Zero Interface Endpoint |
Two | Device, Interface, or Endpoint Status |
00000000B | SET_ADDRESS | Device Address | Zero | Zero | None |
00000000B | SET_CONFIGURATION | Configuration Value | Zero | Zero | None |
00000000B | SET_DESCRIPTOR | Descriptor Type and Descriptor Index | Zero or Language ID | Descriptor Length | Descriptor |
00000000B 00000001B 00000010B |
SET_FEATURE | Feature Selector |
Zero Interface Endpoint |
Zero | None |
00000001B | SET_INTERFACE | Alternate Setting | Interface | Zero | None |
10000010B | SYNCH_FRAME | Zero | Endpoint | Two | Frame Number |
USB2.0 Standard Request Codes
bRequest | Value |
---|---|
GET_STATUS | 0 |
CLEAR_FEATURE | 1 |
Reserved for future use | 2 |
SET_FEATURE | 3 |
Reserved for future use | 4 |
SET_ADDRESS | 5 |
GET_DESCRIPTOR | 6 |
SET_DESCRIPTOR | 7 |
GET_CONFIGURATION | 8 |
SET_CONFIGURATION | 9 |
GET_INTERFACE | 10 |
SET_INTERFACE | 11 |
SYNCH_FRAME | 12 |
USB2.0 Descriptor Types
Descriptor Types | Value |
---|---|
DEVICE | 1 |
CONFIGURATION | 2 |
STRING | 3 |
INTERFACE | 4 |
ENDPOINT | 5 |
DEVICE_QUALIFIER | 6 |
OTHER_SPEED_CONFIGURATION | 7 |
INTERFACE_POWER | 8 |
USB2.0 Standard Feature Selectors
Feature Selector | Recipient | Value |
---|---|---|
DEVICE_REMOTE_WAKEUP | Device | 1 |
ENDPOINT_HALT | Endpoint | 0 |
TEST_MODE | Device | 2 |
USB3.0 Standard Device Requests
USB3.0 Standard Device Requests
bmRequestType | bRequest | wValue | wIndex | wLength | Data | ||
00000000B 00000001B 00000010B |
CLEAR_FEATURE | Feature Selector |
Zero Interface Endpoint |
Zero | None | ||
10000000B | GET_CONFIGURATION | Zero | Zero | One | Configuration Value | ||
10000000B | GET_DESCRIPTOR | Descriptor Type and Descriptor Index | Zero or Language ID | Descriptor Length | Descriptor | ||
10000001B | GET_INTERFACE | Zero | Interface | One | Alternate Interface | ||
10000000B 10000001B 10000010B |
GET_STATUS | Zero |
Zero Interface Endpoint |
Two | Device, Interface, or Endpoint Status | ||
00000000B | SET_ADDRESS | Device Address | Zero | Zero | None | ||
00000000B | SET_CONFIGURATION | Configuration Value | Zero | Zero | None | ||
00000000B | SET_DESCRIPTOR | Descriptor Type and Descriptor Index | Zero or Language ID | Descriptor Length | Descriptor | ||
00000000B 00000001B 00000010B |
SET_FEATURE | Feature Selector |
Zero Interface Endpoint |
Suspend Options | Zero | None | |
00000001B | SET_INTERFACE | Alternate Setting | Interface | Zero | None | ||
00000000B | SET_ISOCH_DELAY | Delay in ns | Zero | Zero | None | ||
00000000B | SET_SEL | Zero | Zero | Six | Exit Latency Values | ||
10000010B | SYNCH_FRAME | Zero | Endpoint | Two | Frame Number | ||
USB3.0 Standard Request Codes
bRequest | Value |
---|---|
GET_STATUS | 0 |
CLEAR_FEATURE | 1 |
Reserved for future use | 2 |
SET_FEATURE | 3 |
Reserved for future use | 4 |
SET_ADDRESS | 5 |
GET_DESCRIPTOR | 6 |
SET_DESCRIPTOR | 7 |
GET_CONFIGURATION | 8 |
SET_CONFIGURATION | 9 |
GET_INTERFACE | 10 |
SET_INTERFACE | 11 |
SYNCH_FRAME | 12 |
SET_SEL | 48 |
SET_ISOCH_DELAY | 49 |
USB3.0 Descriptor Types
Descriptor Types | Value |
---|---|
DEVICE | 1 |
CONFIGURATION | 2 |
STRING | 3 |
INTERFACE | 4 |
ENDPOINT | 5 |
Reserved | 6 |
Reserved | 7 |
INTERFACE_POWER | 8 |
OTG | 9 |
DEBUG | 10 |
INTERFACE_ASSOCIATION | 11 |
BOS | 15 |
DEVICE CAPABILITY | 16 |
SUPERSPEED_USB_ENDPOINT_COMPANION | 48 |
USB3.0 Standard Feature Selectors
Feature Selector | Recipient | Value |
---|---|---|
ENDPOINT_HALT | Endpoint | 0 |
FUNCTION_SUSPEND | Interface | 0 |
U1_ENABLE | Device | 48 |
U2_ENABLE | Device | 49 |
LTM_ENABLE | Device | 50 |
USB3.1 & USB3.2 Standard Device Requests
同正文部分。
USB1.1 Standard Device Requests
USB1.1 Standard Device Requests
bmRequestType | bRequest | wValue | wIndex | wLength | Data |
---|---|---|---|---|---|
00000000B 00000001B 00000010B |
CLEAR_FEATURE | Feature Selector |
Zero Interface Endpoint |
Zero | None |
10000000B | GET_CONFIGURATION | Zero | Zero | One | Configuration Value |
10000000B | GET_DESCRIPTOR | Descriptor Type and Descriptor Index | Zero or Language ID | Descriptor Length | Descriptor |
10000001B | GET_INTERFACE | Zero | Interface | One | Alternate Interface |
10000000B 10000001B 10000010B |
GET_STATUS | Zero |
Zero Interface Endpoint |
Two | Device, Interface, or Endpoint Status |
00000000B | SET_ADDRESS | Device Address | Zero | Zero | None |
00000000B | SET_CONFIGURATION | Configuration Value | Zero | Zero | None |
00000000B | SET_DESCRIPTOR | Descriptor Type and Descriptor Index | Zero or Language ID | Descriptor Length | Descriptor |
00000000B 00000001B 00000010B |
SET_FEATURE | Feature Selector |
Zero Interface Endpoint |
Zero | None |
00000001B | SET_INTERFACE | Alternate Setting | Interface | Zero | None |
10000010B | SYNCH_FRAME | Zero | Endpoint | Two | Frame Number |
USB1.1 Standard Request Codes
bRequest | Value |
---|---|
GET_STATUS | 0 |
CLEAR_FEATURE | 1 |
Reserved for future use | 2 |
SET_FEATURE | 3 |
Reserved for future use | 4 |
SET_ADDRESS | 5 |
GET_DESCRIPTOR | 6 |
SET_DESCRIPTOR | 7 |
GET_CONFIGURATION | 8 |
SET_CONFIGURATION | 9 |
GET_INTERFACE | 10 |
SET_INTERFACE | 11 |
SYNCH_FRAME | 12 |
USB1.1 Descriptor Types
Descriptor Types | Value |
---|---|
DEVICE | 1 |
CONFIGURATION | 2 |
STRING | 3 |
INTERFACE | 4 |
ENDPOINT | 5 |
USB1.1 Standard Feature Selectors
Feature Selector | Recipient | Value |
---|---|---|
DEVICE_REMOTE_WAKEUP | Device | 1 |
ENDPOINT_HALT | Endpoint | 0 |
[参考资料]
Universal Serial Bus Specification Revision 1.1
Universal Serial Bus Specification Revision 2.0
Universal Serial Bus 3.0 Specification
Universal Serial Bus 3.1 Specification
Universal Serial Bus 3.2 Specification
USB Complete, 5th Edition
本文链接:https://blog.csdn.net/u012028275/article/details/114712631
【USB笔记】 标准设备请求Standard Device Requests相关推荐
- 【USB笔记】 设备描述符Device Descriptor
USB笔记 设备描述符(Device Descriptor) 设备描述符(Device Descriptor)说明了USB设备的通用信息,包含应用到全部设备和所有设备配置的信息.USB设备只有一个设备 ...
- 【USB笔记】 USB设备请求USB Device Requests
USB笔记 USB设备请求USB Device Requests 所有USB设备都会响应主机向设备默认控制管道(Control Pipe)上发送的请求(requests). 这些请求是使用控制传输(c ...
- 【USB笔记】接口描述符Interface Descriptor
USB笔记 接口描述符 (Interface Descriptor) 接口描述符(Interface Descriptor)描述了配置中一个特定的接口.配置提供了一个或多个接口,每个接口都含有类(Cl ...
- 【USB笔记】端点描述符Endpoint Descriptor
USB笔记 端点描述符 (Endpoint Descriptor) 端点描述符 (Endpoint Descriptor)描述了USB规范定义的端点信息,包含有端点的带宽等信息.每一个端点都有自己的端 ...
- usb通信时HOST和DEVICE要做的事情
usb通信时HOST和DEVICE要做的事情 转载 zinnc 最后发布于2016-06-16 13:46:15 阅读数 3525 收藏 转自:http://blog.chinaunix.net/ui ...
- 【USB笔记】配置描述符Configuration Descriptor
USB笔记 配置描述符(Configuration Descriptor) 配置描述符(Configuration Descriptor)说明了一个特定配置的相关信息.取得设备描述符(Device D ...
- 【USB笔记】 USB2.0 包格式 握手包Handshake Packets
USB笔记 USB2.0 包格式Packet Formats 握手包Handshake Packets 说明 介绍的是USB 2.0协议中包格式(Packet Formats)的握手包(Handsha ...
- 【USB笔记】查询VID对应的USB设备厂商
查询VID对应的USB设备厂商 USB笔记 VID查询 1.USB-IF 2.Linux USB Project 3.Device Hunt USB笔记 VID查询 USB设备的VID(Vendor ...
- python网络爬虫学习笔记(六):Requests库的使用
文章目录 1.基础操作 1.1 GET请求 1.2 post请求 1.3 响应 2.高级用法 1.1 文件上传 2.2 Cookies 2.3 会话维持 2.4 SSL证书验证 2.5 代理设置 2. ...
最新文章
- 不用再找换脸教程了,飞桨PaddleGAN给你一键式体验
- 实战SSM_O2O商铺_24【商铺列表】View层开发
- 速看|万豪数据泄漏门再敲警钟 酒店集团7步安全建议
- js中window.onload 与 jquery中$(document.ready()) 测试
- linux之gzip命令
- 线程的故事:3 位“母亲”成就了优秀的我!
- linux uvc协议_USB摄像头的UVC协议
- 数字档案馆子系统划分与功能
- 网站优化的关键词选择的重要性
- 老电脑换Linux系统是否会更快,旧电脑不要装Windows!Bodhi Linux系统,小巧强悍,运行更流畅...
- 在Python中安装meta模块
- 海明码的编码和校验方法
- 整屏滚动效果插件 fullpage详解
- IC验证培训——SystemVerilog通用程序库(上)
- dicom 的mm换算成像素Pixel
- 1.27 Watermelon
- 接收后台数据并向后台发送数据
- 比尔-盖茨2010年年信:世界首富的幸福观
- 【TVM帮助文档学习】使用TVMC编译和优化模型
- 【题解】洛谷P2331 最大子矩阵(dp 前缀和)