I'm working with a AMOLED screen. The vendor exposes the screen's brightness control to USB HID, and only give me an example webpage that uses Chrome's navigator.hid
. I read the JavaScript code and find I need to do following things:
- find a USB HID device whose vendor ID is 1810 and product ID is 10;
- at each time I need to set brightness, I have to send a report with report ID of 9 and four bytes of data containing formatted brightness value.
Although it looks really clear and simple, I still don't know how to do these with Linux and C. Especially:
- When I plugged the control USB port, I found there are two new device files:
/dev/hidraw0
and/dev/usb/hiddev0
. What are difference between them and which one should I use? - How to do the USB-specific things i.e. fetch vendor ID and product ID, send the report with report ID? Is there a specific header file for
ioctl
flags?