4

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 Answers 2

5

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
  • 1
    I would like to make the correction that “input” is directed from function to host, and “output” is the other way around. The answer has it backwards. Also I would like to add that no one answered his actual question
    – ElSnowman
    Commented Mar 21, 2022 at 1:02
1

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.

2
  • 5
    This is incorrect. You absolutely can have input, output and feature descriptions mixed in a single descriptor. For example, you might have a game controller that also supports force feedback, and thus both input and output in the HID descriptor. I use a mix of all three myself to allow on-the-fly reprogramming of a custom controller I built.
    – user1522973
    Commented Oct 27, 2015 at 15:13
  • I'd like to add that having a report designated as both input and output has worked for me in the past on a Windows 10 machine when using the regular Windows HID interface. Commented May 19, 2023 at 18:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.