30 int (*read)(
struct os_hid_device *hid_dev, uint8_t *data,
size_t size,
int milliseconds);
32 int (*write)(
struct os_hid_device *hid_dev,
const uint8_t *data,
size_t size);
34 int (*get_feature)(
struct os_hid_device *hid_dev, uint8_t report_num, uint8_t *data,
size_t size);
36 int (*get_feature_timeout)(
struct os_hid_device *hid_dev,
void *data,
size_t size, uint32_t timeout);
38 int (*set_feature)(
struct os_hid_device *hid_dev,
const uint8_t *data,
size_t size);
40 int (*get_physical_address)(
struct os_hid_device *hid_dev, uint8_t *data,
size_t size);
56 return hid_dev->read(hid_dev, data, size, milliseconds);
67 return hid_dev->write(hid_dev, data, size);
80 return hid_dev->get_feature(hid_dev, report_num, data, size);
91 return hid_dev->get_feature_timeout(hid_dev, data, size, timeout);
105 return hid_dev->set_feature(hid_dev, data, size);
120 return hid_dev->get_physical_address(hid_dev, data, size);
131 hid_dev->destroy(hid_dev);
Representing a single hid interface on a device.
Definition: os_hid.h:29
static void os_hid_destroy(struct os_hid_device *hid_dev)
Close and free the given device.
Definition: os_hid.h:129
static int os_hid_set_feature(struct os_hid_device *hid_dev, const uint8_t *data, size_t size)
Set a feature report.
Definition: os_hid.h:103
static int os_hid_get_feature(struct os_hid_device *hid_dev, uint8_t report_num, uint8_t *data, size_t size)
Get a numbered feature report.
Definition: os_hid.h:78
int os_hid_open_hidraw(const char *path, struct os_hid_device **out_hid)
Open the given path as a hidraw device.
Definition: os_hid_hidraw.c:139
static int os_hid_get_physical_address(struct os_hid_device *hid_dev, uint8_t *data, size_t size)
Get the physical address.
Definition: os_hid.h:118
static int os_hid_read(struct os_hid_device *hid_dev, uint8_t *data, size_t size, int milliseconds)
Read the next input report, if any, from the given hid device.
Definition: os_hid.h:54
static int os_hid_write(struct os_hid_device *hid_dev, const uint8_t *data, size_t size)
Write an output report to the given device.
Definition: os_hid.h:65
static int os_hid_get_feature_timeout(struct os_hid_device *hid_dev, void *data, size_t size, uint32_t timeout)
Get a feature report with a timeout.
Definition: os_hid.h:89
Auto detect OS and certain features.