2024年4月8日发(作者:)

USB的VID和PID,以及分类(Class,

SubClass,Protocol)

USB(Universal Serial BUS,通用串行总线)协议规定,所有的USB

设备都有VID(Vendor ID,供应商识别码)和PID(Product ID,产

品识别码)。VID由供应商向USB-IF(Implementers Forum,应用者

论坛)申请。每个供应商的VID是唯一的,PID由供应商自行决定。

主机通过VID和PID来识别不同设备,根据它们(以及设备的版本号),

可以给设备加载或安装相应的驱动程序。VID和PID的长度都是两个

字节的。

常见的各大供应商的VID和PID,可以在这里查询到:

/

USB定义了种类代码信息,它被用来识别设备的功能,根据这些功能,

以加载设备驱动。这种信息包含在名为基类,子类和协议的3个字节

里(注意:“基类”在本文中,用来标识三个字节的种类代码的的首

字节;在USB规范中没有使用这个术语)。设备中有两个地方可以存

放种类代码信息,一个是设备描述符,另一个是接口描述符。已经定

义的种类代码,有些只能用在设备描述符里,有些只能用在接口描述

符里,有些两种描述符里都可用。下表给出现在已经定了的基类的值

的集合,通常用法是什么,基类用在什么场合(设备描述符或接口描

述符)。

其具体定义参见USB官方网址:

/developers/defined_class

各种类的定义参见:

/developers/devclass_docs

Base Descriptor Description

Class Usage

00h

01h

02h

03h

05h

06h

07h

08h

09h

0Ah

0Bh

0Dh

0Eh

0Fh

10h

DCh

E0h

EFh

FEh

FFh

Device

Interface

Both

Interface

Interface

Interface

Interface

Interface

Device

Interface

Interface

Interface

Interface

Interface

Interface

Both

Interface

Both

Interface

Both

Use class information in the Interface Descriptors 种

类信息定义在接口描述符中

Audio 音频设备

Communications & CDC 通信设备(手机,

Class_02&SubClass_02&Prot_01)

HID (Human Interface Device) 人机接口设备

Physical 物理设备

Image 图像设备(可能是

Class_06&SubClass_01&Prot_01)

Printer 打印机

Mass Storage 大容量存储(可能是手机,

Class_08&SubClass_06&Prot_50)

Hub 集线器

CDC-Data 通信设备(手机,Class_0A&SubClass_00&Prot_00)

Smart Card 智能卡

Content Security 内容安全设备

Video 视频设备(摄像头,Class_0e&SubClass_03&Prot_00)

Personal Healthcare 个人健康设备

Audio/Video Devices 音频/视频设备

Diagnostic Device 诊断设备(USB2兼容设备)

Wireless Controller 无线控制器(蓝牙设备等)

Miscellaneous 杂项(ActiveSync,PalmSync,各种协会等)

Application Specific 应用专有规范(固件升级,红外,USB

测试与测量等)

Vendor Specific 供应商自定义规范(手机,

Class_FF&SubClass_FF&Prot_FF)

IPhone手机,