From: Lei C. <Raymond.Chen@Sun.COM> - 2008-04-30 03:04:21
|
adamlah wrote: > Hi, > > I have recently started working on upgrading a project from libusb to > openusb in order to use its isochronous transfer capabilities. > > I notice there is no equivalent way in openusb of getting a char* > representation of a manufacturer, product or serialnumber, like there is in > libusb. > > usb_string_desc_t *manufacturer; > printf("%s", (char*)manufacturer->bString); > > This prints only the first char of the manufacturer string. This is because > the bString is stored as uint32_t. I have no experience of casting from > uint32_t* (widechar?) into normal char*, please could someone advise? > You can take a look at the openusb_get_device_data() API. This function will return strings of LANGID=0x0409(US English). If you want to get other langid strings, use the openusb_get_raw_desc(). In testopenusb.c, you can also get an example(convert_string function) of converting unicode strings. Regards, Lei Chen > Thanks a lot > Adam > > |