Jan,
I'm designing a Full-Speed USB 2.0 HID device which stores data in a 256-record, C-structure array. The USB host application must provide the device with an index into its array, and then the device will send that record to the host.
I'm favoring using control transfers because the requests will be sporadic, and because I don't want to read records out of their requested sequence. The report size is the same for all records in the array, but I'd rather not have 256 different report descriptors.
What is the best way to do this? Figure 3-2 in the 3rd edition of USB Complete depicts Control Read transfers. The Setup Transaction shows that the host sends 8 bytes of data to the device. Can I use one of those data bytes to send the array index to the device for that transfer?
If not, I may have to do it in two transfers. First I'd send the device the array index in one transfer, and then do a Control Read (Feature?) of the desired record in a second transfer. If I do it this way, is there a chance that the first transfer might not complete, leaving me to read the wrong record in the second transfer?