Naming what a USB device reports back: rpm, flags and modes from the vendor app's screen
In the first article I showed how usb-rea diffs USB captures per labelled click and works out what a Windows-only gadget's commands look like. That gets you a driver that can send . A useful driver also has to read : fan speed, temperature, whether the pump is running, which profile is active. Since v0.4.0 usb-rea pairs every host query with the reply the device sends back and decodes the parts…
This report explains how the usb-rea tool decodes USB device reports to reveal important device information like fan speed, temperature, pump status and operational modes. The tool captures both the inbound commands to the device and the outbound replies it sends back. By comparing the device's replies to what the vendor's application displays on its screen, usb-rea can identify the meaning of raw bytes and assign meaningful names to them.
Key observations include:
- Fan speed is reported as a 16-bit little-endian number that ranges between 794 and 4012.
- Temperature is reported as an 8-bit or 16-bit value with a simple offset to convert to actual temperature reading.
- Pump status is reported as an 8-bit flag, where 1 means "on" and 0 means "off".
- The device can operate in different "modes", which are reported as a single byte. The possible mode values are auto, silent, balanced or turbo.
- The tool identifies patterns in the reply bytes to determine which bits correspond to which named observations.
The synthetic fan controller used as an example shows how the tool produces a readable summary of the device's current status, mapping raw byte values to meaningful names like "rpm 1180", "temp 34" and "mode turbo". The generated driver uses these named values in its API functions.
In summary, usb-rea enables developers to interpret USB device reports by identifying the real-world meaning behind raw bytes, making it easier to build drivers and applications that interact with those devices.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.