|
1 |
| -/**************************************************************************** |
2 |
| - Copyright (c) 2015 Osspial All Rights Reserved. |
3 |
| -
|
4 |
| - This file is part of hidapi-rs, based on hidapi_rust by Roland Ruckerbauer. |
5 |
| -
|
6 |
| - hidapi-rs is free software: you can redistribute it and/or modify |
7 |
| - it under the terms of the GNU General Public License as published by |
8 |
| - the Free Software Foundation, either version 3 of the License, or |
9 |
| - (at your option) any later version. |
10 |
| -
|
11 |
| - hidapi-rs is distributed in the hope that it will be useful, |
12 |
| - but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
| - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
| - GNU General Public License for more details. |
15 |
| -
|
16 |
| - You should have received a copy of the GNU General Public License |
17 |
| - along with hidapi-rs. If not, see <http://www.gnu.org/licenses/>. |
18 |
| -****************************************************************************/ |
| 1 | +/// ************************************************************************** |
| 2 | +/// Copyright (c) 2015 Osspial All Rights Reserved. |
| 3 | +/// |
| 4 | +/// This file is part of hidapi-rs, based on hidapi_rust by Roland Ruckerbauer. |
| 5 | +/// |
| 6 | +/// hidapi-rs is free software: you can redistribute it and/or modify |
| 7 | +/// it under the terms of the GNU General Public License as published by |
| 8 | +/// the Free Software Foundation, either version 3 of the License, or |
| 9 | +/// (at your option) any later version. |
| 10 | +/// |
| 11 | +/// hidapi-rs is distributed in the hope that it will be useful, |
| 12 | +/// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +/// GNU General Public License for more details. |
| 15 | +/// |
| 16 | +/// You should have received a copy of the GNU General Public License |
| 17 | +/// along with hidapi-rs. If not, see <http://www.gnu.org/licenses/>. |
| 18 | +/// ************************************************************************* |
19 | 19 |
|
20 | 20 | // For documentation look at the corresponding C header file hidapi.h
|
21 | 21 |
|
@@ -44,26 +44,44 @@ extern "C" {
|
44 | 44 | pub fn hid_exit() -> c_int;
|
45 | 45 | pub fn hid_enumerate(vendor_id: c_ushort, product_id: c_ushort) -> *mut HidDeviceInfo;
|
46 | 46 | pub fn hid_free_enumeration(hid_device_info: *mut HidDeviceInfo);
|
47 |
| - pub fn hid_open(vendor_id: c_ushort, product_id: c_ushort, serial_number: *const wchar_t) |
48 |
| - -> *mut HidDevice; |
| 47 | + pub fn hid_open(vendor_id: c_ushort, |
| 48 | + product_id: c_ushort, |
| 49 | + serial_number: *const wchar_t) |
| 50 | + -> *mut HidDevice; |
49 | 51 | pub fn hid_open_path(path: *const c_char) -> *mut HidDevice;
|
50 | 52 | pub fn hid_write(device: *mut HidDevice, data: *const c_uchar, length: size_t) -> c_int;
|
51 |
| - pub fn hid_read_timeout(device: *mut HidDevice, data: *mut c_uchar, length: size_t, |
52 |
| - milleseconds: c_int) -> c_int; |
| 53 | + pub fn hid_read_timeout(device: *mut HidDevice, |
| 54 | + data: *mut c_uchar, |
| 55 | + length: size_t, |
| 56 | + milleseconds: c_int) |
| 57 | + -> c_int; |
53 | 58 | pub fn hid_read(device: *mut HidDevice, data: *mut c_uchar, length: size_t) -> c_int;
|
54 | 59 | pub fn hid_set_nonblocking(device: *mut HidDevice, nonblock: c_int) -> c_int;
|
55 |
| - pub fn hid_send_feature_report(device: *mut HidDevice, data: *const c_uchar, length: size_t) |
56 |
| - -> c_int; |
57 |
| - pub fn hid_get_feature_report(device: *mut HidDevice, data: *mut c_uchar, length: size_t) |
58 |
| - -> c_int; |
| 60 | + pub fn hid_send_feature_report(device: *mut HidDevice, |
| 61 | + data: *const c_uchar, |
| 62 | + length: size_t) |
| 63 | + -> c_int; |
| 64 | + pub fn hid_get_feature_report(device: *mut HidDevice, |
| 65 | + data: *mut c_uchar, |
| 66 | + length: size_t) |
| 67 | + -> c_int; |
59 | 68 | pub fn hid_close(device: *mut HidDevice);
|
60 |
| - pub fn hid_get_manufacturer_string(device: *mut HidDevice, string: *mut wchar_t, |
61 |
| - maxlen: size_t) -> c_int; |
62 |
| - pub fn hid_get_product_string(device: *mut HidDevice, string: *mut wchar_t, maxlen: size_t) |
63 |
| - -> c_int; |
64 |
| - pub fn hid_get_serial_number_string(device: *mut HidDevice, string: *mut wchar_t, |
65 |
| - maxlen: size_t) -> c_int; |
66 |
| - pub fn hid_get_indexed_string(device: *mut HidDevice, string_index: c_int, |
67 |
| - string: *mut wchar_t, maxlen: size_t) -> c_int; |
| 69 | + pub fn hid_get_manufacturer_string(device: *mut HidDevice, |
| 70 | + string: *mut wchar_t, |
| 71 | + maxlen: size_t) |
| 72 | + -> c_int; |
| 73 | + pub fn hid_get_product_string(device: *mut HidDevice, |
| 74 | + string: *mut wchar_t, |
| 75 | + maxlen: size_t) |
| 76 | + -> c_int; |
| 77 | + pub fn hid_get_serial_number_string(device: *mut HidDevice, |
| 78 | + string: *mut wchar_t, |
| 79 | + maxlen: size_t) |
| 80 | + -> c_int; |
| 81 | + pub fn hid_get_indexed_string(device: *mut HidDevice, |
| 82 | + string_index: c_int, |
| 83 | + string: *mut wchar_t, |
| 84 | + maxlen: size_t) |
| 85 | + -> c_int; |
68 | 86 | pub fn hid_error(device: *mut HidDevice) -> *const wchar_t;
|
69 | 87 | }
|
0 commit comments