forked from trezor/cython-hidapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chid.pxd
40 lines (35 loc) · 1.67 KB
/
chid.pxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from libc.stddef cimport wchar_t, size_t
cdef extern from "hidapi.h":
ctypedef struct hid_device:
pass
cdef struct hid_device_info:
char *path
unsigned short vendor_id
unsigned short product_id
wchar_t *serial_number
unsigned short release_number
wchar_t *manufacturer_string
wchar_t *product_string
unsigned short usage_page
unsigned short usage
int interface_number
hid_device_info *next
hid_device_info* hid_enumerate(unsigned short, unsigned short) nogil
void hid_free_enumeration(hid_device_info*)
hid_device* hid_open(unsigned short, unsigned short, const wchar_t*)
hid_device* hid_open_path(char *path)
void hid_close(hid_device *)
int hid_exit()
int hid_write(hid_device* device, unsigned char *data, int length) nogil
int hid_read(hid_device* device, unsigned char* data, int max_length) nogil
int hid_read_timeout(hid_device* device, unsigned char* data, int max_length, int milliseconds) nogil
int hid_set_nonblocking(hid_device* device, int value)
int hid_send_feature_report(hid_device* device, unsigned char *data, int length) nogil
int hid_get_feature_report(hid_device* device, unsigned char *data, int length) nogil
int hid_get_input_report(hid_device* device, unsigned char *data, int length) nogil
int hid_get_manufacturer_string(hid_device*, wchar_t *, size_t)
int hid_get_product_string(hid_device*, wchar_t *, size_t)
int hid_get_serial_number_string(hid_device*, wchar_t *, size_t)
int hid_get_indexed_string(hid_device*, int, wchar_t *, size_t)
wchar_t *hid_error(hid_device *)
char* hid_version_str()