如何通过USB设备描述符获取USB(手机,USB闪存盘等)的类型?

时间:2018-05-02 08:23:10

标签: windows usb

我可以获得设备描述符:

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(手机,USB闪存盘,无线网卡等)的类型? (原谅我笨拙的英语。我的母语不是英语。)

这是我的iphone和USB驱动器的参数。我应该使用哪些参数来区分不同的设备? BDeviceClass似乎不起作用?

enter image description here

2 个答案:

答案 0 :(得分:0)

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

idVendoridProduct针对https://usb-ids.gowdy.us/read/UD/特定设备。有0x045E是微软,0x0728是LifeCam VX-5000 - https://usb-ids.gowdy.us/read/UD/045e/0728

答案 1 :(得分:0)

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