如何通过USB设备描述符获取USB类型(phone、U盘等)?

How to get the type of USB(phone,USB flash disk,ect.) through the USB device descriptor?

我可以获得设备描述符:

bcdUSB:             0x0200
bDeviceClass:         0xEF
bDeviceSubClass:      0x02
bDeviceProtocol:      0x01
bMaxPacketSize0:      0x40 (64)
idVendor:           0x045E (Microsoft Corporation)
idProduct:          0x0728
bcdDevice:          0x0100
iManufacturer:        0x01
0x0409: "Microsoft"
iProduct:             0x02
0x0409: "Microsoft LifeCam VX-5000"
0x0409: "Microsoft LifeCam VX-5000"
iSerialNumber:        0x00
bNumConfigurations:   0x01,

如何通过USB设备描述符获取USB(phone、U盘、无线网卡等)的类型? (原谅我的笨拙English.My母语不是英语。)

这是我的iphone和我的U盘的参数。我应该使用什么参数来区分不同的设备? BDeviceClass 似乎不起作用?

针对 https://usb-ids.gowdy.us/read/UC/ 查找 bDeviceClass - 设备 类。 0xEF 是 杂项设备

idVendoridProduct对抗https://usb-ids.gowdy.us/read/UD/ - specific devices. There 0x045E is Microsoft and 0x0728 is LifeCam VX-5000 - https://usb-ids.gowdy.us/read/UD/045e/0728

BDeviceClass的值为00表示设备最终定义在interface.We上需要找到对应的配置描述符然后通过配置获取对应的接口描述符descriptor.Then我们可以得到'bInterfaceClass',表示设备.enter image description here