Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
hidapi.h File Reference
#include <wchar.h>
+ Include dependency graph for hidapi.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hid_device_info
 

Macros

#define HID_API_EXPORT
 
#define HID_API_CALL
 
#define HID_API_EXPORT_CALL   HID_API_EXPORT HID_API_CALL
 

Typedefs

typedef struct hid_device_ hid_device
 

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.
 
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_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.
 
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.
 
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.
 
HID_API_EXPORT const wchar_t *HID_API_CALL hid_error (hid_device *dev)
 Get a string describing the last error which occurred.
 

Class Documentation

◆ hid_device_info

struct hid_device_info

hidapi info structure

+ Collaboration diagram for hid_device_info:
Class Members
int interface_number

The USB interface which this logical device represents.

Valid on both Linux implementations in all cases. Valid on the Windows implementation only if the device contains more than one interface. Valid on the Mac implementation if and only if the device is a USB HID device.

wchar_t * manufacturer_string

Manufacturer String

struct hid_device_info * next

Pointer to the next device

char * path

Platform-specific device path

unsigned short product_id

Device Product ID

wchar_t * product_string

Product string

unsigned short release_number

Device Release Number in binary-coded decimal, also known as Device Version Number

wchar_t * serial_number

Serial Number

unsigned short usage

Usage for this Device/Interface (Windows/Mac only).

unsigned short usage_page

Usage Page for this Device/Interface (Windows/Mac only).

unsigned short vendor_id

Device Vendor ID

Macro Definition Documentation

◆ HID_API_CALL

#define HID_API_CALL

API call macro

◆ HID_API_EXPORT

#define HID_API_EXPORT

API export macro

◆ HID_API_EXPORT_CALL

#define HID_API_EXPORT_CALL   HID_API_EXPORT HID_API_CALL

API export and call macro

Typedef Documentation

◆ hid_device

typedef struct hid_device_ hid_device

opaque hidapi structure