hidapi.h
Go to the documentation of this file.
1 /*******************************************************
2  HIDAPI - Multi-Platform library for
3  communication with HID devices.
4 
5  Alan Ott
6  Signal 11 Software
7 
8  8/22/2009
9 
10  Copyright 2009, All Rights Reserved.
11 
12  At the discretion of the user of this library,
13  this software may be licensed under the terms of the
14  GNU General Public License v3, a BSD-Style license, or the
15  original HIDAPI license as outlined in the LICENSE.txt,
16  LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt
17  files located at the root of the source distribution.
18  These files may also be found in the public source
19  code repository located at:
20  http://github.com/signal11/hidapi .
21 ********************************************************/
22 
27 #ifndef HIDAPI_H__
28 #define HIDAPI_H__
29 
30 #include <wchar.h>
31 
32 #ifdef _WIN32
33  #define HID_API_EXPORT __declspec(dllexport)
34  #define HID_API_CALL
35 #else
36  #define HID_API_EXPORT
37  #define HID_API_CALL
38 #endif
39 
40 #define HID_API_EXPORT_CALL HID_API_EXPORT HID_API_CALL
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45  struct hid_device_;
46  typedef struct hid_device_ hidapi_device;
51  char *path;
53  unsigned short vendor_id;
55  unsigned short product_id;
57  wchar_t *serial_number;
60  unsigned short release_number;
64  wchar_t *product_string;
67  unsigned short usage_page;
70  unsigned short usage;
76 
79  };
80 
81 
97 
110 
132  struct hidapi_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id);
133 
143 
160  HID_API_EXPORT hidapi_device * HID_API_CALL hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number);
161 
176 
203  int HID_API_EXPORT HID_API_CALL hid_write(hidapi_device *device, const unsigned char *data, size_t length);
204 
224  int HID_API_EXPORT HID_API_CALL hid_read_timeout(hidapi_device *dev, unsigned char *data, size_t length, int milliseconds);
225 
244  int HID_API_EXPORT HID_API_CALL hid_read(hidapi_device *device, unsigned char *data, size_t length);
245 
265 
293 
318 
325 
336  int HID_API_EXPORT_CALL hid_get_manufacturer_string(hidapi_device *device, wchar_t *string, size_t maxlen);
337 
348  int HID_API_EXPORT_CALL hid_get_product_string(hidapi_device *device, wchar_t *string, size_t maxlen);
349 
360  int HID_API_EXPORT_CALL hid_get_serial_number_string(hidapi_device *device, wchar_t *string, size_t maxlen);
361 
373  int HID_API_EXPORT_CALL hid_get_indexed_string(hidapi_device *device, int string_index, wchar_t *string, size_t maxlen);
374 
385 
386 #ifdef __cplusplus
387 }
388 #endif
389 
390 #endif
391 
unsigned short usage
Definition: hidapi.h:70
void HID_API_EXPORT HID_API_CALL hid_free_enumeration(struct hidapi_device_info *devs)
Free an enumeration Linked List.
Definition: hidapi.cpp:471
struct hidapi_device_info * next
Definition: hidapi.h:78
int HID_API_EXPORT_CALL hid_get_serial_number_string(hidapi_device *device, wchar_t *string, size_t maxlen)
Get The Serial Number String from a HID device.
Definition: hidapi.cpp:1001
int HID_API_EXPORT HID_API_CALL hid_write(hidapi_device *device, const unsigned char *data, size_t length)
Write an Output report to a HID device.
Definition: hidapi.cpp:773
#define HID_API_EXPORT
Definition: hidapi.h:36
GLsizei const GLchar *const * path
Definition: glext.h:4276
int HID_API_EXPORT HID_API_CALL hid_read_timeout(hidapi_device *dev, unsigned char *data, size_t length, int milliseconds)
Read an Input report from a HID device with timeout.
Definition: hidapi.cpp:833
void HID_API_EXPORT HID_API_CALL hid_close(hidapi_device *device)
Close a HID device.
Definition: hidapi.cpp:945
unsigned short product_id
Definition: hidapi.h:55
wchar_t * serial_number
Definition: hidapi.h:57
int HID_API_EXPORT_CALL hid_get_manufacturer_string(hidapi_device *device, wchar_t *string, size_t maxlen)
Get The Manufacturer String from a HID device.
Definition: hidapi.cpp:991
int HID_API_EXPORT_CALL hid_get_indexed_string(hidapi_device *device, int string_index, wchar_t *string, size_t maxlen)
Get a string from a HID device, based on its string index.
Definition: hidapi.cpp:1006
int HID_API_EXPORT HID_API_CALL hid_exit(void)
Finalize the HIDAPI library.
Definition: hidapi.cpp:353
wchar_t * product_string
Definition: hidapi.h:64
int HID_API_EXPORT HID_API_CALL hid_set_nonblocking(hidapi_device *device, int nonblock)
Set the device handle to be non-blocking.
Definition: hidapi.cpp:912
unsigned short release_number
Definition: hidapi.h:60
int HID_API_EXPORT HID_API_CALL hid_read(hidapi_device *device, unsigned char *data, size_t length)
Read an Input report from a HID device.
Definition: hidapi.cpp:907
int HID_API_EXPORT HID_API_CALL hid_init(void)
Initialize the HIDAPI library.
Definition: hidapi.cpp:343
HID_API_EXPORT hidapi_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...
Definition: hidapi.cpp:486
#define HID_API_EXPORT_CALL
Definition: hidapi.h:40
unsigned short usage_page
Definition: hidapi.h:67
int HID_API_EXPORT_CALL hid_get_product_string(hidapi_device *device, wchar_t *string, size_t maxlen)
Get The Product String from a HID device.
Definition: hidapi.cpp:996
GLenum GLuint GLenum GLsizei length
unsigned short vendor_id
Definition: hidapi.h:53
HID_API_EXPORT const wchar_t *HID_API_CALL hid_error(hidapi_device *device)
Get a string describing the last error which occurred.
Definition: hidapi.cpp:1014
struct hidapi_device_info HID_API_EXPORT *HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id)
Enumerate the HID Devices.
Definition: hidapi.cpp:372
int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hidapi_device *device, unsigned char *data, size_t length)
Get a feature report from a HID device.
Definition: hidapi.cpp:925
int HID_API_EXPORT HID_API_CALL hid_send_feature_report(hidapi_device *device, const unsigned char *data, size_t length)
Send a Feature report to the device.
Definition: hidapi.cpp:920
int interface_number
Definition: hidapi.h:75
auto device
Definition: pyrs_net.cpp:17
HID_API_EXPORT hidapi_device *HID_API_CALL hid_open_path(const char *path)
Open a HID device by its path name.
Definition: hidapi.cpp:660
#define HID_API_CALL
Definition: hidapi.h:37
Definition: parser.hpp:150
wchar_t * manufacturer_string
Definition: hidapi.h:62


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:16