USB(Universal Serial BUS,通用串行总线)协议规定,所有的USB设备都有VID(Vendor ID,供应商识别码)和PID(Product ID,产品识别码)。VID由供应商向USB-IF(Implementers Forum,应用者论坛)申请。每个供应商的VID是唯一的,PID由供应商自行决定。主机通过VID和PID来识别不同设备,根据它们(以及设备的版本号),可以给设备加载或安装相应的驱动程序。VID和PID的长度都是两个字节的。
常见的各大供应商的VID和PID,可以在这里查询到:http://www.linux-usb.org/usb.ids
USB定义了种类代码信息,它被用来识别设备的功能,根据这些功能,以加载设备驱动。这种信息包含在名为基类,子类和协议的3个字节里(注意:“基类”在本文中,用来标识三个字节的种类代码的的首字节;在USB规范中没有使用这个术语)。设备中有两个地方可以存放种类代码信息,一个是设备描述符,另一个是接口描述符。已经定义的种类代码,有些只能用在设备描述符里,有些只能用在接口描述符里,有些两种描述符里都可用。下表给出现在已经定了的基类的值的集合,通常用法是什么,基类用在什么场合(设备描述符或接口描述符)。
其具体定义参见USB官方网址:http://www.usb.org/developers/defined_class
各种类的定义参见:http://www.usb.org/developers/devclass_docs
Base Class | Descriptor Usage | Description |
00h | Device | Use class information in the Interface Descriptors 种类信息定义在接口描述符中 |
01h | Interface | Audio 音频设备 |
02h | Both | Communications & CDC 通信设备(手机,Class_02&SubClass_02&Prot_01) |
03h | Interface | HID (Human Interface Device) 人机接口设备 |
05h | Interface | Physical 物理设备 |
06h | Interface | Image 图像设备(可能是IPhone手机,Class_06&SubClass_01&Prot_01) |
07h | Interface | Printer 打印机 |
08h | Interface | Mass Storage 大容量存储(可能是手机,Class_08&SubClass_06&Prot_50) |
09h | Device | Hub 集线器 |
0Ah | Interface | CDC-Data 通信设备(手机,Class_0A&SubClass_00&Prot_00) |
0Bh | Interface | Smart Card 智能卡 |
0Dh | Interface | Content Security 内容安全设备 |
0Eh | Interface | Video 视频设备(摄像头,Class_0e&SubClass_03&Prot_00) |
0Fh | Interface | Personal Healthcare 个人健康设备 |
10h | Interface | Audio/Video Devices 音频/视频设备 |
DCh | Both | Diagnostic Device 诊断设备(USB2兼容设备) |
E0h | Interface | Wireless Controller 无线控制器(蓝牙设备等) |
EFh | Both | Miscellaneous 杂项(ActiveSync,PalmSync,各种协会等) |
FEh | Interface | Application Specific 应用专有规范(固件升级,红外,USB测试与测量等) |
FFh | Both | Vendor Specific 供应商自定义规范(手机,Class_FF&SubClass_FF&Prot_FF) |
参考了
https://developer.mbed.org/users/k4zuki/notebook/usb-cdcmsd-compositeDevice/
点击(此处)折叠或打开
- Bus 001 Device 050: ID 1f00:2012
- Device Descriptor:
- bLength 18
- bDescriptorType 1
- bcdUSB 1.10
- bDeviceClass 239 Miscellaneous Device
- bDeviceSubClass 2 ?
- bDeviceProtocol 1 Interface Association
- bMaxPacketSize0 64
- idVendor 0x1f00
- idProduct 0x2012
- bcdDevice 1.00
- iManufacturer 1 mbed.org
- iProduct 2 CDCMSC DEVICE
- iSerial 3 0123456789
- bNumConfigurations 1
- Configuration Descriptor:
- bLength 9
- bDescriptorType 2
- wTotalLength 98
- bNumInterfaces 3
- bConfigurationValue 1
- iConfiguration 0
- bmAttributes 0xc0
- Self Powered
- MaxPower 100mA
- Interface Association:
- bLength 8
- bDescriptorType 11
- bFirstInterface 0
- bInterfaceCount 2
- bFunctionClass 2 Communications
- bFunctionSubClass 2 Abstract (modem)
- bFunctionProtocol 1 AT-commands (v.25ter)
- iFunction 0
- Interface Descriptor:
- bLength 9
- bDescriptorType 4
- bInterfaceNumber 0
- bAlternateSetting 0
- bNumEndpoints 1
- bInterfaceClass 2 Communications
- bInterfaceSubClass 2 Abstract (modem)
- bInterfaceProtocol 1 AT-commands (v.25ter)
- iInterface 0
- CDC Header:
- bcdCDC 1.10
- CDC Call Management:
- bmCapabilities 0x03
- call management
- use DataInterface
- bDataInterface 1
- CDC ACM:
- bmCapabilities 0x06
- sends break
- line coding and serial state
- CDC Union:
- bMasterInterface 0
- bSlaveInterface 1
- Endpoint Descriptor:
- bLength 7
- bDescriptorType 5
- bEndpointAddress 0x81 EP 1 IN
- bmAttributes 3
- Transfer Type Interrupt
- Synch Type None
- Usage Type Data
- wMaxPacketSize 0x0040 1x 64 bytes
- bInterval 16
- Interface Descriptor:
- bLength 9
- bDescriptorType 4
- bInterfaceNumber 1
- bAlternateSetting 0
- bNumEndpoints 2
- bInterfaceClass 10 CDC Data
- bInterfaceSubClass 0 Unused
- bInterfaceProtocol 0
- iInterface 0
- Endpoint Descriptor:
- bLength 7
- bDescriptorType 5
- bEndpointAddress 0x82 EP 2 IN
- bmAttributes 2
- Transfer Type Bulk
- Synch Type None
- Usage Type Data
- wMaxPacketSize 0x0040 1x 64 bytes
- bInterval 0
- Endpoint Descriptor:
- bLength 7
- bDescriptorType 5
- bEndpointAddress 0x02 EP 2 OUT
- bmAttributes 2
- Transfer Type Bulk
- Synch Type None
- Usage Type Data
- wMaxPacketSize 0x0040 1x 64 bytes
- bInterval 0
- Interface Descriptor:
- bLength 9
- bDescriptorType 4
- bInterfaceNumber 2
- bAlternateSetting 0
- bNumEndpoints 2
- bInterfaceClass 8 Mass Storage
- bInterfaceSubClass 6 SCSI
- bInterfaceProtocol 80 Bulk-Only
- iInterface 4 01
- Endpoint Descriptor:
- bLength 7
- bDescriptorType 5
- bEndpointAddress 0x83 EP 3 IN
- bmAttributes 2
- Transfer Type Bulk
- Synch Type None
- Usage Type Data
- wMaxPacketSize 0x0040 1x 64 bytes
- bInterval 0
- Endpoint Descriptor:
- bLength 7
- bDescriptorType 5
- bEndpointAddress 0x03 EP 3 OUT
- bmAttributes 2
- Transfer Type Bulk
- Synch Type None
- Usage Type Data
- wMaxPacketSize 0x0040 1x 64 bytes
- bInterval 0
- Device Status: 0x0001
- Self Powered