ratbag_emu.firmware module

class ratbag_emu.firmware.Firmware(owner)

Bases: object

Represents the firmware of the device

This is the “brain” of the device, it is here where we custom logic is implemented.

hid_receive(data, size, rtype, endpoint)

Receive data

Callback called when we receive a HID report.

Parameters
  • data (List[int]) – Received data

  • size (int) – Received data size

  • rtype (int) – Report type

  • endpoint (int) – Endpoint number

Return type

List[int]

hid_send(data, endpoint)

Send data to endpoint

Routine used to send a HID report to a certain endpoint. Feel free to overwrite this and hardcode the endpoint number.

Parameters
  • data (List[int]) – Data to send

  • endpoint (int) – Endpoint number

Return type

None