Using HIDAPI, how can you request a raw report descriptor?

I would like to deconstruct the raw reports received from the hid_read hidapi function.

As I understand it, this can be achieved using information from the report descriptors of the device. But when I try to request these descriptors, I get lost somewhere between the HID Spec and using the methods available in hidapi .

I would like to see a concrete example based on C or node-hidapi that requests and lists all report descriptors for a device - perhaps a mouse, to make things simpler?

+4
source share
3 answers

I asked Alan Ott via e-mail about this, and he answered no as follows:

HIDAPI does not provide functions for retrieving or analyzing a descriptor report. Since HIDAPI is designed to communicate with user devices, these devices are likely to contain all or mainly vendor-specific report data in any case.

+5
source

This is not exactly what you are looking for, but it will do the same job. I highly recommend you use libusbx over any other hidden library. If you are ready to do this, here is a very clear example of enumerating devices.

Edit:

It looks like libusbx has been merged back into libusb. That's cool! Since the above link is broken, here is a new link.

+3
source

I had success using https://github.com/Orochimarufan/HIDRAW/tree/master/HIDRAW_test (this is hopefully the C code example you asked for) and RDD! USB HID Report Descriptor Decoder for more detailed output.

0
source

Source: https://habr.com/ru/post/1491947/


All Articles