|
From: Xiaofan C. <xia...@gm...> - 2012-12-13 01:50:18
|
On Thu, Dec 13, 2012 at 5:57 AM, Walker, Richard <Wal...@co...> wrote: >> Are you fetching descriptor type 7, or are you fetching string (type 3) >> descriptor number 7? Those are two different things. Rather than >> subvert the meaning of the actual OTHER_SPEED_CONFIGURATION descriptor... > > I'm not sure. I know that the value we need is an ascii-encoded string, > so I suspect it will be a string type. I've included the technical description > from the data sheet, so that maybe the implementation will be obvious to > someone more familiar with the USB protocol. > > Currently the debug info that I need to access is described in the data sheet as: > > 2.3.5.17: String Descriptor for Other Speed Configuration String > > offset field value in byte order > -------- ------- ------------------------------ > 0 bDescLength 0x4e > 1 bDesciptorType 0x03 > 2 wLangID debug information encoded ascii string > > The ascii string uses a base 32 ascii encoding which uses the > characters from '@'-'O' to encode > the received optical power and some of the bit error rate registers. I think you are confusing the "Other Speed Configuration descriptor" (which is descriptor type 7) with the "String Descriptor for Other Speed Configuration" (which is probably a device specific string descriptor, descriptor type 3). Ref: http://www.usbmadesimple.co.uk/ums_4.htm > Is this enough info to determine if libusb can recover this information? > The data sheet is quite detailed, so I can probably find any other required > information that might be needed. > > I've got the device identified, with a valid handle and device structure. > What functions would I use next to access this information? If it helps, > I can post the code I've written so far. For "String Descriptor for Other Speed Configuration" (descriptor type 3), you should be able to use libusb_get_string_descriptor_ascii(). What you need to find out is the index of this string descriptor. http://libusb.sourceforge.net/api-1.0/group__desc.html#gaf3f92d0a7465d49a5e61eb3f8689fae4 int libusb_get_string_descriptor_ascii (libusb_device_handle * dev, uint8_t desc_index, unsigned char * data, int length ) Retrieve a string descriptor in C style ASCII. Wrapper around libusb_get_string_descriptor(). Uses the first language supported by the device. Parameters: dev a device handle desc_index the index of the descriptor to retrieve data output buffer for ASCII string descriptor length size of data buffer Returns: number of bytes returned in data, or LIBUSB_ERROR code on failure -- Xiaofan |