@@ -333,6 +333,9 @@ bool tuh_descriptor_string_manufacturer_get(uint8_t daddr, uint16_t language_id,
333
333
{
334
334
TU_VERIFY (tuh_mounted (daddr ));
335
335
usbh_device_t const * dev = get_device (daddr );
336
+ if (dev -> i_manufacturer == 0 ) {
337
+ return false;
338
+ }
336
339
return tuh_descriptor_string_get (daddr , language_id , dev -> i_manufacturer , buffer , len , complete_cb );
337
340
}
338
341
@@ -341,6 +344,9 @@ bool tuh_descriptor_string_product_get(uint8_t daddr, uint16_t language_id, void
341
344
{
342
345
TU_VERIFY (tuh_mounted (daddr ));
343
346
usbh_device_t const * dev = get_device (daddr );
347
+ if (dev -> i_product == 0 ) {
348
+ return false;
349
+ }
344
350
return tuh_descriptor_string_get (daddr , language_id , dev -> i_product , buffer , len , complete_cb );
345
351
}
346
352
@@ -349,6 +355,9 @@ bool tuh_descriptor_string_serial_get(uint8_t daddr, uint16_t language_id, void*
349
355
{
350
356
TU_VERIFY (tuh_mounted (daddr ));
351
357
usbh_device_t const * dev = get_device (daddr );
358
+ if (dev -> i_serial == 0 ) {
359
+ return false;
360
+ }
352
361
return tuh_descriptor_string_get (daddr , language_id , dev -> i_serial , buffer , len , complete_cb );
353
362
}
354
363
@@ -960,9 +969,9 @@ static bool enum_get_device_desc_complete(uint8_t dev_addr, tusb_control_request
960
969
961
970
dev -> vid = desc_device -> idVendor ;
962
971
dev -> pid = desc_device -> idProduct ;
963
- // dev->i_manufacturer = desc_device->iManufacturer;
964
- // dev->i_product = desc_device->iProduct;
965
- // dev->i_serial = desc_device->iSerialNumber;
972
+ dev -> i_manufacturer = desc_device -> iManufacturer ;
973
+ dev -> i_product = desc_device -> iProduct ;
974
+ dev -> i_serial = desc_device -> iSerialNumber ;
966
975
967
976
// if (tuh_attach_cb) tuh_attach_cb((tusb_desc_device_t*) _usbh_ctrl_buf);
968
977
0 commit comments