|
hidapi
|
#include <wchar.h>Go to the source code of this file.
Data Structures | |
| struct | hid_api_version |
| struct | hid_device_info |
Macros | |
| #define | HID_API_EXPORT |
| #define | HID_API_CALL |
| #define | HID_API_EXPORT_CALL HID_API_EXPORT HID_API_CALL |
| #define | HID_API_VERSION_MAJOR 0 |
| Static/compile-time major version of the library. | |
| #define | HID_API_VERSION_MINOR 16 |
| Static/compile-time minor version of the library. | |
| #define | HID_API_VERSION_PATCH 0 |
| Static/compile-time patch version of the library. | |
| #define | HID_API_MAKE_VERSION(mj, mn, p) |
| Coverts a version as Major/Minor/Patch into a number: <8 bit major><16 bit minor><8 bit patch>. | |
| #define | HID_API_VERSION HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH) |
| Static/compile-time version of the library. | |
| #define | HID_API_VERSION_STR HID_API_TO_VERSION_STR(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH) |
| Static/compile-time string version of the library. | |
| #define | HID_API_MAX_REPORT_DESCRIPTOR_SIZE 4096 |
| Maximum expected HID Report descriptor size in bytes. | |
| #define | HID_API_MAX_NUM_INPUT_BUFFERS 1024 |
| Upper bound for hid_set_num_input_buffers(). | |
Typedefs | |
| typedef struct hid_device_ | hid_device |
Enumerations | |
| enum | hid_bus_type { HID_API_BUS_UNKNOWN = 0x00 , HID_API_BUS_USB = 0x01 , HID_API_BUS_BLUETOOTH = 0x02 , HID_API_BUS_I2C = 0x03 , HID_API_BUS_SPI = 0x04 , HID_API_BUS_VIRTUAL = 0x05 } |
| HID underlying bus types. More... | |
Functions | |
| int HID_API_EXPORT HID_API_CALL | hid_init (void) |
| Initialize the HIDAPI library. | |
| int HID_API_EXPORT HID_API_CALL | hid_exit (void) |
| Finalize the HIDAPI library. | |
| struct hid_device_info HID_API_EXPORT *HID_API_CALL | hid_enumerate (unsigned short vendor_id, unsigned short product_id) |
| Enumerate the HID Devices. | |
| void HID_API_EXPORT HID_API_CALL | hid_free_enumeration (struct hid_device_info *devs) |
| Free an enumeration Linked List. | |
| HID_API_EXPORT hid_device *HID_API_CALL | hid_open (unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number) |
| Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number. | |
| HID_API_EXPORT hid_device *HID_API_CALL | hid_open_path (const char *path) |
| Open a HID device by its path name. | |
| int HID_API_EXPORT HID_API_CALL | hid_write (hid_device *dev, const unsigned char *data, size_t length) |
| Write an Output report to a HID device. | |
| int HID_API_EXPORT HID_API_CALL | hid_read_timeout (hid_device *dev, unsigned char *data, size_t length, int milliseconds) |
| Read an Input report from a HID device with timeout. | |
| int HID_API_EXPORT HID_API_CALL | hid_read (hid_device *dev, unsigned char *data, size_t length) |
| Read an Input report from a HID device. | |
| HID_API_EXPORT const wchar_t *HID_API_CALL | hid_read_error (hid_device *dev) |
| Get a string describing the last error which occurred during hid_read/hid_read_timeout. | |
| int HID_API_EXPORT HID_API_CALL | hid_set_nonblocking (hid_device *dev, int nonblock) |
| Set the device handle to be non-blocking. | |
| int HID_API_EXPORT HID_API_CALL | hid_set_num_input_buffers (hid_device *dev, int num_buffers) |
| Set the number of input report buffers queued per device. | |
| void HID_API_EXPORT HID_API_CALL | hid_read_interrupt (hid_device *dev) |
| Asynchronously interrupt blocking hid_read/hid_read_timeout call. | |
| int HID_API_EXPORT HID_API_CALL | hid_is_read_interrupted (hid_device *dev) |
| Query whether the read pipeline is currently interrupted. | |
| void HID_API_EXPORT HID_API_CALL | hid_read_clear_interrupt (hid_device *dev) |
| Clear the read-interrupt state, allowing reads to resume. | |
| int HID_API_EXPORT HID_API_CALL | hid_send_feature_report (hid_device *dev, const unsigned char *data, size_t length) |
| Send a Feature report to the device. | |
| int HID_API_EXPORT HID_API_CALL | hid_get_feature_report (hid_device *dev, unsigned char *data, size_t length) |
| Get a feature report from a HID device. | |
| int HID_API_EXPORT HID_API_CALL | hid_send_output_report (hid_device *dev, const unsigned char *data, size_t length) |
| Send a Output report to the device. | |
| int HID_API_EXPORT HID_API_CALL | hid_get_input_report (hid_device *dev, unsigned char *data, size_t length) |
| Get a input report from a HID device. | |
| void HID_API_EXPORT HID_API_CALL | hid_close (hid_device *dev) |
| Close a HID device. | |
| int HID_API_EXPORT_CALL | hid_get_manufacturer_string (hid_device *dev, wchar_t *string, size_t maxlen) |
| Get The Manufacturer String from a HID device. | |
| int HID_API_EXPORT_CALL | hid_get_product_string (hid_device *dev, wchar_t *string, size_t maxlen) |
| Get The Product String from a HID device. | |
| int HID_API_EXPORT_CALL | hid_get_serial_number_string (hid_device *dev, wchar_t *string, size_t maxlen) |
| Get The Serial Number String from a HID device. | |
| struct hid_device_info HID_API_EXPORT *HID_API_CALL | hid_get_device_info (hid_device *dev) |
| Get The struct hid_device_info from a HID device. | |
| int HID_API_EXPORT_CALL | hid_get_indexed_string (hid_device *dev, int string_index, wchar_t *string, size_t maxlen) |
| Get a string from a HID device, based on its string index. | |
| int HID_API_EXPORT_CALL | hid_get_report_descriptor (hid_device *dev, unsigned char *buf, size_t buf_size) |
| Get a report descriptor from a HID device. | |
| HID_API_EXPORT const wchar_t *HID_API_CALL | hid_error (hid_device *dev) |
| Get a string describing the last error which occurred. | |
| HID_API_EXPORT const struct hid_api_version *HID_API_CALL | hid_version (void) |
| Get a runtime version of the library. | |
| HID_API_EXPORT const char *HID_API_CALL | hid_version_str (void) |
| Get a runtime version string of the library. | |
| #define HID_API_CALL |
API call macro
| #define HID_API_EXPORT |
API export macro
| #define HID_API_EXPORT_CALL HID_API_EXPORT HID_API_CALL |
API export and call macro
| #define HID_API_MAX_NUM_INPUT_BUFFERS 1024 |
Upper bound for hid_set_num_input_buffers().
Values passed above this limit are rejected by hid_set_num_input_buffers(). Guards against memory-exhaustion via unbounded input report queue growth.
May be overridden at build time via -DHID_API_MAX_NUM_INPUT_BUFFERS=
. The library enforces the value used when it was built; redefining this macro only in an application does not change that limit. Build the library and application with the same value to keep the declaration and enforced limit consistent.
| typedef struct hid_device_ hid_device |
opaque hidapi structure