libratbag / libratbag

A DBus daemon to configure input devices, mainly high-end and gaming mice
MIT License
2.08k stars 253 forks source link

Have virtual FW emulation for unit-testing devices #574

Open bentiss opened 5 years ago

bentiss commented 5 years ago

This is a thought that came up with a discussion with @whot today.

Basically, it's hard to work on libratbag because we are never sure that a change we are introducing will not break existing devices that we do not have.

It would be really nice to be able to have reversed engineered firmwares that behave in the way we are expecting them to be.

Writing such thing is possible with uhid for devices that are using hidraw, and we now have a wrapper in python in hid-tools.

I am not saying it will be easy, but there are things that could be easily done:

I don't think we need to write all part of the firmware, some could be just dumped from a particular device. But at least, we might be able to have regression tests.

whot commented 5 years ago

Just a thought: should this tool be a separate entity if it ends up being generic enough? With libratbag using it to emulate a firmware, but not necessarily containing the actual work? I have no answer for this, just to keep in mind as a potential option.

FFY00 commented 5 years ago

I think so, it will be helpful for more that just libratbag.