USB(Universal Serial BUS,通用串行总线)协议规定,所有的USB设备都有VID(Vendor ID,供应商识别码)和PID(Product ID,产品识别码),有的还有PVN(Product Version Number)。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) |