Repository navigation
Expand file tree
/
Copy pathgroup__API.html
More file actions
841 lines (785 loc) · 53.5 KB
/
Copy pathgroup__API.html
File metadata and controls
841 lines (785 loc) · 53.5 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>hidapi: hidapi API</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">hidapi
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">hidapi API</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga142ffc1b0b7a7fa412d3862b2a17164b"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#ga142ffc1b0b7a7fa412d3862b2a17164b">hid_init</a> (void)</td></tr>
<tr class="memdesc:ga142ffc1b0b7a7fa412d3862b2a17164b"><td class="mdescLeft"> </td><td class="mdescRight">Initialize the HIDAPI library. <a href="#ga142ffc1b0b7a7fa412d3862b2a17164b">More...</a><br /></td></tr>
<tr class="separator:ga142ffc1b0b7a7fa412d3862b2a17164b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gacf5da9ce37132eba69fc259f17f13023"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#gacf5da9ce37132eba69fc259f17f13023">hid_exit</a> (void)</td></tr>
<tr class="memdesc:gacf5da9ce37132eba69fc259f17f13023"><td class="mdescLeft"> </td><td class="mdescRight">Finalize the HIDAPI library. <a href="#gacf5da9ce37132eba69fc259f17f13023">More...</a><br /></td></tr>
<tr class="separator:gacf5da9ce37132eba69fc259f17f13023"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga135931e04d48078a9fb7aebf663676f9"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structhid__device__info.html">hid_device_info</a> <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> *<a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#ga135931e04d48078a9fb7aebf663676f9">hid_enumerate</a> (unsigned short vendor_id, unsigned short product_id)</td></tr>
<tr class="memdesc:ga135931e04d48078a9fb7aebf663676f9"><td class="mdescLeft"> </td><td class="mdescRight">Enumerate the HID Devices. <a href="#ga135931e04d48078a9fb7aebf663676f9">More...</a><br /></td></tr>
<tr class="separator:ga135931e04d48078a9fb7aebf663676f9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gafc2d2adf71db3784b783b9a554527aa4"><td class="memItemLeft" align="right" valign="top">void <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#gafc2d2adf71db3784b783b9a554527aa4">hid_free_enumeration</a> (struct <a class="el" href="structhid__device__info.html">hid_device_info</a> *devs)</td></tr>
<tr class="memdesc:gafc2d2adf71db3784b783b9a554527aa4"><td class="mdescLeft"> </td><td class="mdescRight">Free an enumeration Linked List. <a href="#gafc2d2adf71db3784b783b9a554527aa4">More...</a><br /></td></tr>
<tr class="separator:gafc2d2adf71db3784b783b9a554527aa4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae6910ed9f01c4a99d25539b16800e90c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *<a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c">hid_open</a> (unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number)</td></tr>
<tr class="memdesc:gae6910ed9f01c4a99d25539b16800e90c"><td class="mdescLeft"> </td><td class="mdescRight">Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number. <a href="#gae6910ed9f01c4a99d25539b16800e90c">More...</a><br /></td></tr>
<tr class="separator:gae6910ed9f01c4a99d25539b16800e90c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga1e87518670f88540c920dc451df608ee"><td class="memItemLeft" align="right" valign="top"><a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *<a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#ga1e87518670f88540c920dc451df608ee">hid_open_path</a> (const char *path)</td></tr>
<tr class="memdesc:ga1e87518670f88540c920dc451df608ee"><td class="mdescLeft"> </td><td class="mdescRight">Open a HID device by its path name. <a href="#ga1e87518670f88540c920dc451df608ee">More...</a><br /></td></tr>
<tr class="separator:ga1e87518670f88540c920dc451df608ee"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaa691d2c469b9654128196bf7ef8edd9d"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#gaa691d2c469b9654128196bf7ef8edd9d">hid_write</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev, const unsigned char *data, size_t length)</td></tr>
<tr class="memdesc:gaa691d2c469b9654128196bf7ef8edd9d"><td class="mdescLeft"> </td><td class="mdescRight">Write an Output report to a HID device. <a href="#gaa691d2c469b9654128196bf7ef8edd9d">More...</a><br /></td></tr>
<tr class="separator:gaa691d2c469b9654128196bf7ef8edd9d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaa5c9ed5aa290688ffac03343989ad75a"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#gaa5c9ed5aa290688ffac03343989ad75a">hid_read_timeout</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev, unsigned char *data, size_t length, int milliseconds)</td></tr>
<tr class="memdesc:gaa5c9ed5aa290688ffac03343989ad75a"><td class="mdescLeft"> </td><td class="mdescRight">Read an Input report from a HID device with timeout. <a href="#gaa5c9ed5aa290688ffac03343989ad75a">More...</a><br /></td></tr>
<tr class="separator:gaa5c9ed5aa290688ffac03343989ad75a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga2224269e8cd7c789f9fd4864a73f8c95"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#ga2224269e8cd7c789f9fd4864a73f8c95">hid_read</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev, unsigned char *data, size_t length)</td></tr>
<tr class="memdesc:ga2224269e8cd7c789f9fd4864a73f8c95"><td class="mdescLeft"> </td><td class="mdescRight">Read an Input report from a HID device. <a href="#ga2224269e8cd7c789f9fd4864a73f8c95">More...</a><br /></td></tr>
<tr class="separator:ga2224269e8cd7c789f9fd4864a73f8c95"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga0e9af0d8ed72f5610e9297c90b08e242"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#ga0e9af0d8ed72f5610e9297c90b08e242">hid_set_nonblocking</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev, int nonblock)</td></tr>
<tr class="memdesc:ga0e9af0d8ed72f5610e9297c90b08e242"><td class="mdescLeft"> </td><td class="mdescRight">Set the device handle to be non-blocking. <a href="#ga0e9af0d8ed72f5610e9297c90b08e242">More...</a><br /></td></tr>
<tr class="separator:ga0e9af0d8ed72f5610e9297c90b08e242"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae99a9ddbb5d9b03fddf40fb4a492cbec"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#gae99a9ddbb5d9b03fddf40fb4a492cbec">hid_send_feature_report</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev, const unsigned char *data, size_t length)</td></tr>
<tr class="memdesc:gae99a9ddbb5d9b03fddf40fb4a492cbec"><td class="mdescLeft"> </td><td class="mdescRight">Send a Feature report to the device. <a href="#gae99a9ddbb5d9b03fddf40fb4a492cbec">More...</a><br /></td></tr>
<tr class="separator:gae99a9ddbb5d9b03fddf40fb4a492cbec"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaa537a4b3c49d638c6ec9dedc08c44601"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#gaa537a4b3c49d638c6ec9dedc08c44601">hid_get_feature_report</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev, unsigned char *data, size_t length)</td></tr>
<tr class="memdesc:gaa537a4b3c49d638c6ec9dedc08c44601"><td class="mdescLeft"> </td><td class="mdescRight">Get a feature report from a HID device. <a href="#gaa537a4b3c49d638c6ec9dedc08c44601">More...</a><br /></td></tr>
<tr class="separator:gaa537a4b3c49d638c6ec9dedc08c44601"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga8d478a5986439ffb838fb1f1ba6ba5ec"><td class="memItemLeft" align="right" valign="top">void <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#ga8d478a5986439ffb838fb1f1ba6ba5ec">hid_close</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev)</td></tr>
<tr class="memdesc:ga8d478a5986439ffb838fb1f1ba6ba5ec"><td class="mdescLeft"> </td><td class="mdescRight">Close a HID device. <a href="#ga8d478a5986439ffb838fb1f1ba6ba5ec">More...</a><br /></td></tr>
<tr class="separator:ga8d478a5986439ffb838fb1f1ba6ba5ec"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga702f45b42d85599eedd602c05661fde5"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#a70c49eda5025c1bc455af77da19ca312">HID_API_EXPORT_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#ga702f45b42d85599eedd602c05661fde5">hid_get_manufacturer_string</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev, wchar_t *string, size_t maxlen)</td></tr>
<tr class="memdesc:ga702f45b42d85599eedd602c05661fde5"><td class="mdescLeft"> </td><td class="mdescRight">Get The Manufacturer String from a HID device. <a href="#ga702f45b42d85599eedd602c05661fde5">More...</a><br /></td></tr>
<tr class="separator:ga702f45b42d85599eedd602c05661fde5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga648feb765c5e0da3e821ee84aeab9d99"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#a70c49eda5025c1bc455af77da19ca312">HID_API_EXPORT_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#ga648feb765c5e0da3e821ee84aeab9d99">hid_get_product_string</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev, wchar_t *string, size_t maxlen)</td></tr>
<tr class="memdesc:ga648feb765c5e0da3e821ee84aeab9d99"><td class="mdescLeft"> </td><td class="mdescRight">Get The Product String from a HID device. <a href="#ga648feb765c5e0da3e821ee84aeab9d99">More...</a><br /></td></tr>
<tr class="separator:ga648feb765c5e0da3e821ee84aeab9d99"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga3442db3ece59fe248b0625a4c8fca617"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#a70c49eda5025c1bc455af77da19ca312">HID_API_EXPORT_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#ga3442db3ece59fe248b0625a4c8fca617">hid_get_serial_number_string</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev, wchar_t *string, size_t maxlen)</td></tr>
<tr class="memdesc:ga3442db3ece59fe248b0625a4c8fca617"><td class="mdescLeft"> </td><td class="mdescRight">Get The Serial Number String from a HID device. <a href="#ga3442db3ece59fe248b0625a4c8fca617">More...</a><br /></td></tr>
<tr class="separator:ga3442db3ece59fe248b0625a4c8fca617"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga18546669554746d0f292ca5e23372e06"><td class="memItemLeft" align="right" valign="top">int <a class="el" href="hidapi_8h.html#a70c49eda5025c1bc455af77da19ca312">HID_API_EXPORT_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#ga18546669554746d0f292ca5e23372e06">hid_get_indexed_string</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev, int string_index, wchar_t *string, size_t maxlen)</td></tr>
<tr class="memdesc:ga18546669554746d0f292ca5e23372e06"><td class="mdescLeft"> </td><td class="mdescRight">Get a string from a HID device, based on its string index. <a href="#ga18546669554746d0f292ca5e23372e06">More...</a><br /></td></tr>
<tr class="separator:ga18546669554746d0f292ca5e23372e06"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaac4feaa92f29edfb53d498ce3953c694"><td class="memItemLeft" align="right" valign="top"><a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> const wchar_t *<a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__API.html#gaac4feaa92f29edfb53d498ce3953c694">hid_error</a> (<a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> *dev)</td></tr>
<tr class="memdesc:gaac4feaa92f29edfb53d498ce3953c694"><td class="mdescLeft"> </td><td class="mdescRight">Get a string describing the last error which occurred. <a href="#gaac4feaa92f29edfb53d498ce3953c694">More...</a><br /></td></tr>
<tr class="separator:gaac4feaa92f29edfb53d498ce3953c694"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga8d478a5986439ffb838fb1f1ba6ba5ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8d478a5986439ffb838fb1f1ba6ba5ec">◆ </a></span>hid_close()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_close </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Close a HID device. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga135931e04d48078a9fb7aebf663676f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga135931e04d48078a9fb7aebf663676f9">◆ </a></span>hid_enumerate()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="structhid__device__info.html">hid_device_info</a> <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a>* <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_enumerate </td>
<td>(</td>
<td class="paramtype">unsigned short </td>
<td class="paramname"><em>vendor_id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned short </td>
<td class="paramname"><em>product_id</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Enumerate the HID Devices. </p>
<p>This function returns a linked list of all the HID devices attached to the system which match vendor_id and product_id. If <code>vendor_id</code> is set to 0 then any vendor matches. If <code>product_id</code> is set to 0 then any product matches. If <code>vendor_id</code> and <code>product_id</code> are both set to 0, then all HID devices will be returned.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">vendor_id</td><td>The Vendor ID (VID) of the types of device to open. </td></tr>
<tr><td class="paramname">product_id</td><td>The Product ID (PID) of the types of device to open.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns a pointer to a linked list of type struct <a class="el" href="structhid__device__info.html">hid_device_info</a>, containing information about the HID devices attached to the system, or NULL in the case of failure. Free this linked list by calling <a class="el" href="group__API.html#gafc2d2adf71db3784b783b9a554527aa4" title="Free an enumeration Linked List. ">hid_free_enumeration()</a>. </dd></dl>
</div>
</div>
<a id="gaac4feaa92f29edfb53d498ce3953c694"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaac4feaa92f29edfb53d498ce3953c694">◆ </a></span>hid_error()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> const wchar_t* <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_error </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get a string describing the last error which occurred. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns a string containing the last error which occurred or NULL if none has occurred. </dd></dl>
</div>
</div>
<a id="gacf5da9ce37132eba69fc259f17f13023"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacf5da9ce37132eba69fc259f17f13023">◆ </a></span>hid_exit()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_exit </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Finalize the HIDAPI library. </p>
<p>This function frees all of the static data associated with HIDAPI. It should be called at the end of execution to avoid memory leaks.</p>
<dl class="section return"><dt>Returns</dt><dd>This function returns 0 on success and -1 on error. </dd></dl>
</div>
</div>
<a id="gafc2d2adf71db3784b783b9a554527aa4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafc2d2adf71db3784b783b9a554527aa4">◆ </a></span>hid_free_enumeration()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_free_enumeration </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structhid__device__info.html">hid_device_info</a> * </td>
<td class="paramname"><em>devs</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Free an enumeration Linked List. </p>
<p>This function frees a linked list created by <a class="el" href="group__API.html#ga135931e04d48078a9fb7aebf663676f9" title="Enumerate the HID Devices. ">hid_enumerate()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">devs</td><td>Pointer to a list of struct_device returned from <a class="el" href="group__API.html#ga135931e04d48078a9fb7aebf663676f9" title="Enumerate the HID Devices. ">hid_enumerate()</a>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gaa537a4b3c49d638c6ec9dedc08c44601"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa537a4b3c49d638c6ec9dedc08c44601">◆ </a></span>hid_get_feature_report()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_get_feature_report </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>length</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get a feature report from a HID device. </p>
<p>Set the first byte of <code>data</code>[] to the Report ID of the report to be read. Make sure to allow space for this extra byte in <code>data</code>[]. Upon return, the first byte will still contain the Report ID, and the report data will start in data[1].</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>. </td></tr>
<tr><td class="paramname">data</td><td>A buffer to put the read data into, including the Report ID. Set the first byte of <code>data</code>[] to the Report ID of the report to be read, or set it to zero if your device does not use numbered reports. </td></tr>
<tr><td class="paramname">length</td><td>The number of bytes to read, including an extra byte for the report ID. The buffer can be longer than the actual report.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns the number of bytes read plus one for the report ID (which is still in the first byte), or -1 on error. </dd></dl>
</div>
</div>
<a id="ga18546669554746d0f292ca5e23372e06"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga18546669554746d0f292ca5e23372e06">◆ </a></span>hid_get_indexed_string()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#a70c49eda5025c1bc455af77da19ca312">HID_API_EXPORT_CALL</a> hid_get_indexed_string </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>string_index</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">wchar_t * </td>
<td class="paramname"><em>string</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>maxlen</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get a string from a HID device, based on its string index. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>. </td></tr>
<tr><td class="paramname">string_index</td><td>The index of the string to get. </td></tr>
<tr><td class="paramname">string</td><td>A wide string buffer to put the data into. </td></tr>
<tr><td class="paramname">maxlen</td><td>The length of the buffer in multiples of wchar_t.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns 0 on success and -1 on error. </dd></dl>
</div>
</div>
<a id="ga702f45b42d85599eedd602c05661fde5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga702f45b42d85599eedd602c05661fde5">◆ </a></span>hid_get_manufacturer_string()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#a70c49eda5025c1bc455af77da19ca312">HID_API_EXPORT_CALL</a> hid_get_manufacturer_string </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">wchar_t * </td>
<td class="paramname"><em>string</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>maxlen</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get The Manufacturer String from a HID device. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>. </td></tr>
<tr><td class="paramname">string</td><td>A wide string buffer to put the data into. </td></tr>
<tr><td class="paramname">maxlen</td><td>The length of the buffer in multiples of wchar_t.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns 0 on success and -1 on error. </dd></dl>
</div>
</div>
<a id="ga648feb765c5e0da3e821ee84aeab9d99"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga648feb765c5e0da3e821ee84aeab9d99">◆ </a></span>hid_get_product_string()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#a70c49eda5025c1bc455af77da19ca312">HID_API_EXPORT_CALL</a> hid_get_product_string </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">wchar_t * </td>
<td class="paramname"><em>string</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>maxlen</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get The Product String from a HID device. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>. </td></tr>
<tr><td class="paramname">string</td><td>A wide string buffer to put the data into. </td></tr>
<tr><td class="paramname">maxlen</td><td>The length of the buffer in multiples of wchar_t.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns 0 on success and -1 on error. </dd></dl>
</div>
</div>
<a id="ga3442db3ece59fe248b0625a4c8fca617"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3442db3ece59fe248b0625a4c8fca617">◆ </a></span>hid_get_serial_number_string()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#a70c49eda5025c1bc455af77da19ca312">HID_API_EXPORT_CALL</a> hid_get_serial_number_string </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">wchar_t * </td>
<td class="paramname"><em>string</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>maxlen</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get The Serial Number String from a HID device. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>. </td></tr>
<tr><td class="paramname">string</td><td>A wide string buffer to put the data into. </td></tr>
<tr><td class="paramname">maxlen</td><td>The length of the buffer in multiples of wchar_t.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns 0 on success and -1 on error. </dd></dl>
</div>
</div>
<a id="ga142ffc1b0b7a7fa412d3862b2a17164b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga142ffc1b0b7a7fa412d3862b2a17164b">◆ </a></span>hid_init()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_init </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialize the HIDAPI library. </p>
<p>This function initializes the HIDAPI library. Calling it is not strictly necessary, as it will be called automatically by <a class="el" href="group__API.html#ga135931e04d48078a9fb7aebf663676f9" title="Enumerate the HID Devices. ">hid_enumerate()</a> and any of the hid_open_*() functions if it is needed. This function should be called at the beginning of execution however, if there is a chance of HIDAPI handles being opened by different threads simultaneously.</p>
<dl class="section return"><dt>Returns</dt><dd>This function returns 0 on success and -1 on error. </dd></dl>
</div>
</div>
<a id="gae6910ed9f01c4a99d25539b16800e90c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae6910ed9f01c4a99d25539b16800e90c">◆ </a></span>hid_open()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a>* <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_open </td>
<td>(</td>
<td class="paramtype">unsigned short </td>
<td class="paramname"><em>vendor_id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned short </td>
<td class="paramname"><em>product_id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const wchar_t * </td>
<td class="paramname"><em>serial_number</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number. </p>
<p>If <code>serial_number</code> is NULL, the first device with the specified VID and PID is opened.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">vendor_id</td><td>The Vendor ID (VID) of the device to open. </td></tr>
<tr><td class="paramname">product_id</td><td>The Product ID (PID) of the device to open. </td></tr>
<tr><td class="paramname">serial_number</td><td>The Serial Number of the device to open (Optionally NULL).</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns a pointer to a <a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> object on success or NULL on failure. </dd></dl>
</div>
</div>
<a id="ga1e87518670f88540c920dc451df608ee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1e87518670f88540c920dc451df608ee">◆ </a></span>hid_open_path()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a>* <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_open_path </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>path</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Open a HID device by its path name. </p>
<p>The path name be determined by calling <a class="el" href="group__API.html#ga135931e04d48078a9fb7aebf663676f9" title="Enumerate the HID Devices. ">hid_enumerate()</a>, or a platform-specific path name can be used (eg: /dev/hidraw0 on Linux).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">path</td><td>The path name of the device to open</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns a pointer to a <a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> object on success or NULL on failure. </dd></dl>
</div>
</div>
<a id="ga2224269e8cd7c789f9fd4864a73f8c95"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2224269e8cd7c789f9fd4864a73f8c95">◆ </a></span>hid_read()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_read </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>length</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Read an Input report from a HID device. </p>
<p>Input reports are returned to the host through the INTERRUPT IN endpoint. The first byte will contain the Report number if the device uses numbered reports.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>. </td></tr>
<tr><td class="paramname">data</td><td>A buffer to put the read data into. </td></tr>
<tr><td class="paramname">length</td><td>The number of bytes to read. For devices with multiple reports, make sure to read an extra byte for the report number.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns the actual number of bytes read and -1 on error. If no packet was available to be read and the handle is in non-blocking mode, this function returns 0. </dd></dl>
</div>
</div>
<a id="gaa5c9ed5aa290688ffac03343989ad75a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa5c9ed5aa290688ffac03343989ad75a">◆ </a></span>hid_read_timeout()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_read_timeout </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>length</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>milliseconds</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Read an Input report from a HID device with timeout. </p>
<p>Input reports are returned to the host through the INTERRUPT IN endpoint. The first byte will contain the Report number if the device uses numbered reports.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>. </td></tr>
<tr><td class="paramname">data</td><td>A buffer to put the read data into. </td></tr>
<tr><td class="paramname">length</td><td>The number of bytes to read. For devices with multiple reports, make sure to read an extra byte for the report number. </td></tr>
<tr><td class="paramname">milliseconds</td><td>timeout in milliseconds or -1 for blocking wait.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns the actual number of bytes read and -1 on error. If no packet was available to be read within the timeout period, this function returns 0. </dd></dl>
</div>
</div>
<a id="gae99a9ddbb5d9b03fddf40fb4a492cbec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae99a9ddbb5d9b03fddf40fb4a492cbec">◆ </a></span>hid_send_feature_report()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_send_feature_report </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const unsigned char * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>length</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Send a Feature report to the device. </p>
<p>Feature reports are sent over the Control endpoint as a Set_Report transfer. The first byte of <code>data</code>[] must contain the Report ID. For devices which only support a single report, this must be set to 0x0. The remaining bytes contain the report data. Since the Report ID is mandatory, calls to <a class="el" href="group__API.html#gae99a9ddbb5d9b03fddf40fb4a492cbec" title="Send a Feature report to the device. ">hid_send_feature_report()</a> will always contain one more byte than the report contains. For example, if a hid report is 16 bytes long, 17 bytes must be passed to <a class="el" href="group__API.html#gae99a9ddbb5d9b03fddf40fb4a492cbec" title="Send a Feature report to the device. ">hid_send_feature_report()</a>: the Report ID (or 0x0, for devices which do not use numbered reports), followed by the report data (16 bytes). In this example, the length passed in would be 17.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>. </td></tr>
<tr><td class="paramname">data</td><td>The data to send, including the report number as the first byte. </td></tr>
<tr><td class="paramname">length</td><td>The length in bytes of the data to send, including the report number.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns the actual number of bytes written and -1 on error. </dd></dl>
</div>
</div>
<a id="ga0e9af0d8ed72f5610e9297c90b08e242"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0e9af0d8ed72f5610e9297c90b08e242">◆ </a></span>hid_set_nonblocking()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_set_nonblocking </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>nonblock</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the device handle to be non-blocking. </p>
<p>In non-blocking mode calls to <a class="el" href="group__API.html#ga2224269e8cd7c789f9fd4864a73f8c95" title="Read an Input report from a HID device. ">hid_read()</a> will return immediately with a value of 0 if there is no data to be read. In blocking mode, <a class="el" href="group__API.html#ga2224269e8cd7c789f9fd4864a73f8c95" title="Read an Input report from a HID device. ">hid_read()</a> will wait (block) until there is data to read before returning.</p>
<p>Nonblocking can be turned on and off at any time.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>. </td></tr>
<tr><td class="paramname">nonblock</td><td>enable or not the nonblocking reads<ul>
<li>1 to enable nonblocking</li>
<li>0 to disable nonblocking.</li>
</ul>
</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns 0 on success and -1 on error. </dd></dl>
</div>
</div>
<a id="gaa691d2c469b9654128196bf7ef8edd9d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa691d2c469b9654128196bf7ef8edd9d">◆ </a></span>hid_write()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="hidapi_8h.html#aa60150016800ccb88fdf140e8553ae13">HID_API_EXPORT</a> <a class="el" href="hidapi_8h.html#af140a25716604e86096670a505a58ee0">HID_API_CALL</a> hid_write </td>
<td>(</td>
<td class="paramtype"><a class="el" href="hidapi_8h.html#aa6da74d5686d198dd3e5440e60088fcc">hid_device</a> * </td>
<td class="paramname"><em>dev</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const unsigned char * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>length</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Write an Output report to a HID device. </p>
<p>The first byte of <code>data</code>[] must contain the Report ID. For devices which only support a single report, this must be set to 0x0. The remaining bytes contain the report data. Since the Report ID is mandatory, calls to <a class="el" href="group__API.html#gaa691d2c469b9654128196bf7ef8edd9d" title="Write an Output report to a HID device. ">hid_write()</a> will always contain one more byte than the report contains. For example, if a hid report is 16 bytes long, 17 bytes must be passed to <a class="el" href="group__API.html#gaa691d2c469b9654128196bf7ef8edd9d" title="Write an Output report to a HID device. ">hid_write()</a>, the Report ID (or 0x0, for devices with a single report), followed by the report data (16 bytes). In this example, the length passed in would be 17.</p>
<p><a class="el" href="group__API.html#gaa691d2c469b9654128196bf7ef8edd9d" title="Write an Output report to a HID device. ">hid_write()</a> will send the data on the first OUT endpoint, if one exists. If it does not, it will send the data through the Control Endpoint (Endpoint 0).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dev</td><td>A device handle returned from <a class="el" href="group__API.html#gae6910ed9f01c4a99d25539b16800e90c" title="Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number...">hid_open()</a>. </td></tr>
<tr><td class="paramname">data</td><td>The data to send, including the report number as the first byte. </td></tr>
<tr><td class="paramname">length</td><td>The length in bytes of the data to send.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns the actual number of bytes written and -1 on error. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Sep 30 2019 23:30:43 for hidapi by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>