4
votes

A USB HID report descriptor may describe both an input and an output usage within the same report. What exactly does this mean?

Does the entire report get sent whenever the device is polled, including the (unused) output usage bits? Or is it up to the device to construct an input report without the output usage bits, despite those being described in the report descriptor?

2

2 Answers

4
votes

The report descriptor is requested by the OS @ enumeration. This is the only way that the OS has to know the usages and their associated report IDs and bit/byte locations. There are more details than that, but all of the info is in there to use the device usages and whether they are input, output, or features. Inputs are usages/data directed to the device. Outputs are usages/data output from the device. Features are features that can be read and set; setFeature and getFeature.

Report Descriptors can and frequently do contain input, output, and features mixed in a single report descriptor.

Look @ section "6.2.2 Report Descriptor" in the "Device Class Definition for Human Interface Devices (HID)" @ usb.org and also look at sample report descriptors in the same document to get an idea how it works.

edit: What I said is correct, regarding, "Report Descriptors can and frequently do contain input, output, and features mixed in a single report descriptor." Oleg Mazurov stated that it's not true. I think he is confusing "report descriptors" with "report IDs".

1
votes

This is incorrect. You can't have input, output, and feature mixed in a single report descriptor. Usb.org has a free report checking tool, you may want to take a look at it.