Skip to content

Specific device classes have now been separated from tests. Replay has been refactored to utilize known devices.

First commit

Devices now have their own separate folder under hidtools/devices. The inheritance hierarchy has been changed for this purpose. There is now a Base device from which base gamepad inherits (and other gamepads in turn inherit from the base gamepad. However, UHIDTestDevice now also inherits from that base device, adding only the few lines to init that are test specific. Base device inherits from UHIDDevice.

Second commit

Device creation is postponed until after we're finished parsing the file. This allows for devices to be created via factory method in the future.

Third commit

Replay has been refactored. There is now a known devices dictionary with a tuple of (vendor_id, product_id) as the keys and the device classes as the values. If there is a device in this dictionary corresponding to the info read from recording.hid then that will be used instead of the basic UHIDDevice class. This helps for devices which do not use /dev/input nodes, which hangs the program. The device with which this has been tested so far is the dual shock 3 controller.

Edited by José Torreguitar

Merge request reports