IOUSBLib has nice friendly calls such as GetDevice<whatever> but
what about more generalised usage of bRequest fields for obtaining
other info. Using the example of USBGetManufacturerStringIndex, how
can you, in the user-space, issue a GET_DESCRIPTOR call to retrieve
the relevant info, specifying the bRequest, wValue, wIndex fields
etc. I guess you'd use something along the lines of
kUSBRqGetDescriptor (or kUSBRqGetStatus or whatever) I'm just not
entirely sure how to do this, or if ot's possible to, from the
user-space in
Nano has mentioned which API to use, if you're confused about what
the parameters should be, this is documented in the USB spec, chapter
9.
9.4.3 Get Descriptor
bmRequestType bRequest wValue wIndex wLength Data
10000000B GET_DESCRIPTOR Descriptor Zero or Descriptor Desc
Type and Language ID Length
Descriptor (refer to
Index Section 9.6.7)
bRequest is defined in table 9-4, kUSBRqGetDescriptor is in USBSpec.h.
The index mixed into the wValue is the number you got from
USBGetManufacturerStringIndex. The string descriptor type is defined
in table 9-5, kUSBStringDesc is also in USBSpec.h.
The wLength you supply is however long you expect the string to be.
You could supply 255, the maximum. However there is a common bug in
which devices can hang on this, so the normal way of doing this is to
ask for 2 bytes, which tells you the length of the descriptor (the
first byte). Then you ask for exactly the right number of bytes.
--
Barry Twycross
email@hidden
---
USB, it's not a Dyslexic BUS. (Thanks to TC.)
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
Do not post admin requests to the list. They will be ignored.