ratbag_emu.endpoint module

class ratbag_emu.endpoint.Endpoint(owner, rdesc, number)

Bases: hidtools.uhid.UHIDDevice

Represents a device endpoint

A HID device is created for each endpoint. The enpoint can be used to receive and send data

Parameters
  • owner (Device) – Endpoint owner

  • rdesc (List[int]) – Report descriptor

  • number (int) – Endpoint number

create_report(action, global_data=None, skip_empty=True)

Converts action into HID report

Converts action in HID report according to the report descriptor and sends it.

Parameters
  • action (object) – Object holding the desired actions as attributes

  • global_data (Optional[int]) –

    ?

  • skip_empty (bool) – Enables skipping empty actions

Return type

List[int]

send(data)

Send data

Routine used to send a HID report.

Parameters

data (List[int]) – Data to send

Return type

None

property uhid_dev_is_ready
Return type

bool