|
39 | 39 | //| not verified for correctness; it is up to you to make sure it is not malformed.
|
40 | 40 | //| :param int usage_page: The Usage Page value from the descriptor. Must match what is in the descriptor.
|
41 | 41 | //| :param int usage: The Usage value from the descriptor. Must match what is in the descriptor.
|
42 |
| -//| :param int report_ids: Sequence of report ids used by the descriptor. |
43 |
| -//| If the ``report_descriptor`` does not have a report ID, use 0. |
44 |
| -//| :param int in_report_lengths: Sequence of sizes in bytes of the HIDs report sent to the host. |
| 42 | +//| :param Sequence[int] report_ids: Sequence of report ids used by the descriptor. |
| 43 | +//| If the ``report_descriptor`` does not specify any report IDs, use ``(0,)``. |
| 44 | +//| :param Sequence[int] in_report_lengths: Sequence of sizes in bytes of the HID reports sent to the host. |
45 | 45 | //| The sizes are in order of the ``report_ids``.
|
| 46 | +//| Use a size of ``0`` for a report that is not an IN report. |
46 | 47 | //| "IN" is with respect to the host.
|
47 |
| -//| :param int out_report_lengths: Size in bytes of the HID report received from the host. |
| 48 | +//| :param int out_report_lengths: Sequence of sizes in bytes of the HID reports received from the host. |
48 | 49 | //| The sizes are in order of the ``report_ids``.
|
| 50 | +//| Use a size of ``0`` for a report that is not an OUT report. |
49 | 51 | //| "OUT" is with respect to the host.
|
50 | 52 | //|
|
51 | 53 | //| ``report_ids``, ``in_report_lengths``, and ``out_report_lengths`` must all be the same length.
|
| 54 | +//| |
| 55 | +//| Here is an example of a `Device` with a descriptor that specifies two report IDs, 3 and 4. |
| 56 | +//| Report ID 3 sends an IN report of length 5, and receives an OUT report of length 6. |
| 57 | +//| Report ID 4 sends an IN report of length 2, and does not receive an OUT report:: |
| 58 | +//| |
| 59 | +//| device = usb_hid.Device( |
| 60 | +//| descriptor=b"...", # Omitted for brevity. |
| 61 | +//| report_ids=(3, 4), |
| 62 | +//| in_report_lengths=(5, 2), |
| 63 | +//| out_report_lengths=(6, 0), |
| 64 | +//| ) |
52 | 65 | //| """
|
53 | 66 | //| ...
|
54 | 67 | //|
|
|
0 commit comments