ESP32S3 as usb host, how to get device's PROD_STR
Posted: Fri Nov 10, 2023 6:29 am
My ESP32S3 works as usb host, connected with a usb device. The device's information:
I want to get the iProduct string "Symbol Bar Code Scanner", how should I do?
I found a function declaration at "esp-idf-v5.1.1/components/esp_rom/include/esp32s3/rom/usb/usb_descriptor.h" :
It seems that this function can meets my need, but it has no definition.
I try to add log out at "hub.c" as follows: but only get problem unicode:
- ---------------------- 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 ..
I found a function declaration at "esp-idf-v5.1.1/components/esp_rom/include/esp32s3/rom/usb/usb_descriptor.h" :
- bool usb_get_descriptor(uint16_t type_index, uint16_t lang_id,
- int32_t *len, uint8_t **data);
I try to add log out at "hub.c" as follows: but only get problem unicode: