【问题标题】:How to get the type of USB(phone,USB flash disk,ect.) through the USB device descriptor?如何通过 USB 设备描述符获取 USB(手机、U 盘等)的类型?
【发布时间】:2018-10-12 07:05:43
【问题描述】:

我可以得到设备描述符:

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

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

【问题讨论】:

    标签: windows usb


    【解决方案1】:

    根据https://usb-ids.gowdy.us/read/UC/ 查找bDeviceClass - 设备类。有0xEF是Miscellaneous Device

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

    【讨论】:

    • 我从手机和U盘得到的bDeviceClass是一样的(都是0 Per Interface)...,那我怎么知道呢?但是其他一些参数是不同的,比如bcdDevice ,bcdUSB,我能区分这些吗?
    • 有关 USB 描述符的详细信息,请参阅 beyondlogic.org/usbnutshell/usb5.shtml
    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-15
      • 1970-01-01
      • 2011-10-02
      • 2018-06-09
      • 2014-12-19
      相关资源
      最近更新 更多