Hi, On 05/28/2013 10:38 PM, Ludovic Rousseau wrote: > 2013/5/28 Tim Roberts <t...@probo.com>: >> Hans de Goede wrote: >>> Sorry no code (yet), as I would first like to get some buy in for >>> the concept before spending time on coding this. >>> >>> For apps which show a list of usb devices to the user, it is useful >>> to have some userfriendly description of the device to show. >>> >>> I've code for this in spice-gtk, which I think really should be in >>> libusb, as it is useful for other apps too. >>> >>> Therefor I would like to suggest to add these functions: >>> >>> char *libusb_get_vendor_string(libusb_device *device); >>> char *libusb_get_product_string(libusb_device *device); >> >> I'm not fond of this concept. In USB terms, the "vendor string" is the >> string descriptor designated by iManufacturer in the device descriptor, >> and "product string" is the string descriptor designated by iProduct in >> the device descriptor. This is extending the meaning of those terms in >> a possibly unexpected way. > > I agree. > Why libusb_get_string_descriptor_ascii() can't be used to get the > vendor string? I use that in my code and it works well.
I would like to give libusb using applications to os cached string descriptors, so that those can be accessed without the need to open a device and do io on it. > > r = libusb_get_string_descriptor_ascii(handle, desc.iManufacturer, > buffer, sizeof(buffer)); > > The only problem is with devices that do not return any string for > iManufacturer. But they are a minority and can be considered bogus. I'm afraid they are not as much of a minority as you may think, I've amassed a large collection of usb devices and many don't have string descriptors I'm afraid. > >> Apps that need the usb.ids lookup should go do the lookup. Beyond that, >> this becomes a maintenance headache. > > Maybe it is time to start a new library that would be a libusb > companion with "higher" level functions or helper functions. I believe that offering access to OS cached string descriptors to me surely belongs in libusb. I thought that usb.ids parsing would give us a nice fallback, but if people feel it does not belong in libusb I'm fine with not having it in libusb. Regards, Hans ------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with <2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel