How does a USB HID report work using input and output?

The USB HID descriptor descriptor can describe both input and output in a single report. What exactly does this mean?

Is the entire report sent during device polling, including the (unused) output usage bits? Or does it depend on the device to create the input report without using output bits, despite what is described in the report descriptor?

+4
source share
2 answers

The report descriptor is requested by the OS @ enumeration. This is the only way the OS should know its customs and associated identifiers for reports and bit / byte locations. There are more details than this, but all the information there is used to use the devices and whether they are inputs, outputs or functions. Inputs are usage data / data sent to the device. Outputs are usage data / data output from the device. Features are functions that can be read and installed; setFeature and getFeature.

Report descriptors can and often contain input, output, and function data mixed in one report descriptor.

See the @ 6.2.2 Report Descriptor section in “Defining a Device Class for User Interface Devices (HIDs)” @ usb.org, and also see sample report descriptors in the same document to get an idea of ​​how it works.

edit: What I said correctly concerns: "Report descriptors can and often contain input, output, and functions mixed in one report descriptor." Oleg Mazurov said that this is not true. I think it is misleading "report descriptors" with "report identifiers".

+4
source

This is not true. You cannot have mixed input, output, and function in the same report descriptor. Usb.org has a free report verification tool, you can take a look at it.

+2
source

All Articles