|
USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
|
Per-instance configuration for a generic HID interface. More...
#include <classes/hid.h>
Data Fields | |
| const uint8_t * | report_desc |
| The Report descriptor bytes (required) | |
| uint16_t | report_desc_len |
| Length of report_desc | |
| uint8_t | subclass |
| HID_SUBCLASS_NONE or HID_SUBCLASS_BOOT | |
| uint8_t | protocol |
| HID_PROTOCOL_NONE/HID_PROTOCOL_KEYBOARD/HID_PROTOCOL_MOUSE (boot) | |
| uint8_t | in_ep |
| Interrupt IN address (0 -> 0x81) | |
| uint16_t | in_mps |
| 0 -> 64 | |
| uint8_t | in_interval |
| 0 -> 10 | |
| uint8_t | out_ep |
| Interrupt OUT address (0 = none, e.g. | |
| uint16_t | out_mps |
| 0 -> 64 | |
| uint8_t | out_interval |
| 0 -> 10 | |
| uint8_t | country |
| bCountryCode (usually 0) | |
| const char * | name |
| iInterface string (optional) | |
| int(* | get_report )(hid_iface *iface, void *user, uint8_t type, uint8_t id, uint8_t *buf, uint16_t len) |
| Answer a host GET_REPORT (optional). | |
| void(* | set_report )(hid_iface *iface, void *user, uint8_t type, uint8_t id, const void *data, int len) |
| Receive a host SET_REPORT on endpoint 0 (optional). | |
| void(* | on_output )(hid_iface *iface, void *user, const void *data, int len) |
Receive an Output report (optional) - from the interrupt-OUT pipe, or via SET_REPORT(Output) when set_report is NULL (e.g. | |
| void * | user |
| Opaque pointer passed to every callback above. | |
Per-instance configuration for a generic HID interface.
Zero-fields take the documented defaults. Any callback may be NULL.
| const uint8_t* hid_opts::report_desc |
The Report descriptor bytes (required)
| uint16_t hid_opts::report_desc_len |
Length of report_desc
| uint8_t hid_opts::subclass |
| uint8_t hid_opts::protocol |
HID_PROTOCOL_NONE/HID_PROTOCOL_KEYBOARD/HID_PROTOCOL_MOUSE (boot)
| uint8_t hid_opts::in_ep |
Interrupt IN address (0 -> 0x81)
| uint16_t hid_opts::in_mps |
0 -> 64
| uint8_t hid_opts::in_interval |
0 -> 10
| uint8_t hid_opts::out_ep |
Interrupt OUT address (0 = none, e.g.
0x01)
| uint16_t hid_opts::out_mps |
0 -> 64
| uint8_t hid_opts::out_interval |
0 -> 10
| uint8_t hid_opts::country |
bCountryCode (usually 0)
| const char* hid_opts::name |
iInterface string (optional)
| int(* hid_opts::get_report) (hid_iface *iface, void *user, uint8_t type, uint8_t id, uint8_t *buf, uint16_t len) |
Answer a host GET_REPORT (optional).
| iface | the HID interface. |
| user | the user pointer. |
| type | report type - 1 Input, 2 Output, 3 Feature (see HID_REPORT_INPUT). |
| id | report ID (0 when report IDs are not used). |
| buf | buffer to fill with the report (up to len bytes). |
| len | capacity of buf. |
| void(* hid_opts::set_report) (hid_iface *iface, void *user, uint8_t type, uint8_t id, const void *data, int len) |
Receive a host SET_REPORT on endpoint 0 (optional).
If NULL while on_output is set, Output reports are delivered to on_output instead.
| iface | the HID interface. |
| user | the user pointer. |
| type | report type (1 Input, 2 Output, 3 Feature). |
| id | report ID. |
| data | the report bytes from the host. |
| len | number of bytes in data. |
Receive an Output report (optional) - from the interrupt-OUT pipe, or via SET_REPORT(Output) when set_report is NULL (e.g.
keyboard LED reports).
| iface | the HID interface. |
| user | the user pointer. |
| data | the Output report bytes. |
| len | number of bytes in data. |
| void* hid_opts::user |
Opaque pointer passed to every callback above.