在usb_descriptor.h中有函数声明:
请问如何根据index、langid来得到描述符字符串?
比如我的USB设备为:
---------------------- Device Descriptor ----------------------
bLength : 0x12 (18 bytes)
bDescriptorType : 0x01 (Device Descriptor)
bcdUSB : 0x200 (USB Version 2.0) -> but device is Full-Speed only
bDeviceClass : 0x00 (defined by the interface descriptors)
bDeviceSubClass : 0x00
bDeviceProtocol : 0x00
bMaxPacketSize0 : 0x08 (8 bytes)
idVendor : 0x05E0 (Zebra Technologies)
idProduct : 0x1200
bcdDevice : 0x0201
iManufacturer : 0x01 (String Descriptor 1)
Language 0x0409 : "ᄅSymbol Technologies, Inc, 2002"
iProduct : 0x02 (String Descriptor 2)
Language 0x0409 : "Symbol Bar Code Scanner"
iSerialNumber : 0x03 (String Descriptor 3)
Language 0x0409 : "S/N:C8820020FD115541B46BDB1CBA3D5E16 Rev:NBRPPAAQ3"
bNumConfigurations : 0x01 (1 Configuration)
Data (HexDump) : 12 01 00 02 00 00 00 08 E0 05 00 12 01 02 01 02 ................
03 01 ..
想要获得"Symbol Bar Code Scanner"这个字符串。
尝试增加如下打印:
得到乱码:
但是并没有对应的函数定义。usb host如何获得 USB设备的描述字符串
-
- Posts: 4
- Joined: Fri Nov 10, 2023 3:52 am
Re: usb host如何获得 USB设备的描述字符串
解决了 在test_hid_basic.c中有相关示例
利用hid_host_get_device_info()
利用hid_host_get_device_info()
Who is online
Users browsing this forum: Google [Bot] and 71 guests