-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroup__libusb__lib.html
426 lines (404 loc) · 27.4 KB
/
group__libusb__lib.html
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
<!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>libusb-1.0: Library initialization/deinitialization</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">libusb-1.0
</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="#nested-classes">Classes</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Library initialization/deinitialization</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibusb__version.html">libusb_version</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga4ec088aa7b79c4a9599e39bf36a72833"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structlibusb__context.html">libusb_context</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__libusb__lib.html#ga4ec088aa7b79c4a9599e39bf36a72833">libusb_context</a></td></tr>
<tr class="separator:ga4ec088aa7b79c4a9599e39bf36a72833"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga820bc2b2c9ff61000fea9dd61a770a26"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="group__libusb__asyncio.html#ga8ca3594d1761da8da91be2851f4e8f21">void</a>(<a class="el" href="group__libusb__misc.html#gaa7d6035eb2692d455d27144560a0f68d">LIBUSB_CALL</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__libusb__lib.html#ga820bc2b2c9ff61000fea9dd61a770a26">libusb_log_cb</a>) (<a class="el" href="structlibusb__context.html">libusb_context</a> *ctx, enum <a class="el" href="group__libusb__lib.html#ga2d6144203f0fc6d373677f6e2e89d2d2">libusb_log_level</a> level, const char *str)</td></tr>
<tr class="separator:ga820bc2b2c9ff61000fea9dd61a770a26"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga2d6144203f0fc6d373677f6e2e89d2d2"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__libusb__lib.html#ga2d6144203f0fc6d373677f6e2e89d2d2">libusb_log_level</a> { <br />
  <a class="el" href="group__libusb__lib.html#gga2d6144203f0fc6d373677f6e2e89d2d2af431dbe84c85599526cc0103f8178270">LIBUSB_LOG_LEVEL_NONE</a> = 0,
<a class="el" href="group__libusb__lib.html#gga2d6144203f0fc6d373677f6e2e89d2d2ace959b4b99f6c460dfa929b6152e49a8">LIBUSB_LOG_LEVEL_ERROR</a> = 1,
<a class="el" href="group__libusb__lib.html#gga2d6144203f0fc6d373677f6e2e89d2d2a1d141f7a981d9fcd4bc12e41a1a14e78">LIBUSB_LOG_LEVEL_WARNING</a> = 2,
<a class="el" href="group__libusb__lib.html#gga2d6144203f0fc6d373677f6e2e89d2d2ab942d780c83ba4f30b9dd2e338002a07">LIBUSB_LOG_LEVEL_INFO</a> = 3,
<br />
  <a class="el" href="group__libusb__lib.html#gga2d6144203f0fc6d373677f6e2e89d2d2afabee6826e913933f5d6fe4040bd7b9c">LIBUSB_LOG_LEVEL_DEBUG</a> = 4
<br />
}</td></tr>
<tr class="separator:ga2d6144203f0fc6d373677f6e2e89d2d2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga20e11f6f5a3b5a075fdf44969f3a9310"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__libusb__lib.html#ga20e11f6f5a3b5a075fdf44969f3a9310">libusb_log_cb_mode</a> { <a class="el" href="group__libusb__lib.html#gga20e11f6f5a3b5a075fdf44969f3a9310a3baf6e9e1909f47fa8fce3f4155fbf5e">LIBUSB_LOG_CB_GLOBAL</a> = (1 << 0),
<a class="el" href="group__libusb__lib.html#gga20e11f6f5a3b5a075fdf44969f3a9310aa82c77f3902eca38eb87b727baa77f15">LIBUSB_LOG_CB_CONTEXT</a> = (1 << 1)
}</td></tr>
<tr class="separator:ga20e11f6f5a3b5a075fdf44969f3a9310"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga07d4ec54cf575d672ba94c72b3c0de7c"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__libusb__lib.html#ga07d4ec54cf575d672ba94c72b3c0de7c">libusb_option</a> { <a class="el" href="group__libusb__lib.html#gga07d4ec54cf575d672ba94c72b3c0de7ca8fbcdda276e0c49402c209c25a35cd4d">LIBUSB_OPTION_LOG_LEVEL</a> = 0,
<a class="el" href="group__libusb__lib.html#gga07d4ec54cf575d672ba94c72b3c0de7ca95e60ef92c1da58829d830db38829aa6">LIBUSB_OPTION_USE_USBDK</a> = 1
}</td></tr>
<tr class="separator:ga07d4ec54cf575d672ba94c72b3c0de7c"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga13db8bfeff29df24ddf88b8823bd9b8a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__libusb__asyncio.html#ga8ca3594d1761da8da91be2851f4e8f21">void</a> API_EXPORTED </td><td class="memItemRight" valign="bottom"><a class="el" href="group__libusb__lib.html#ga13db8bfeff29df24ddf88b8823bd9b8a">libusb_set_debug</a> (<a class="el" href="structlibusb__context.html">libusb_context</a> *ctx, int level)</td></tr>
<tr class="separator:ga13db8bfeff29df24ddf88b8823bd9b8a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae77a5f683e3cad1dcb881f4b3ac7a148"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__libusb__asyncio.html#ga8ca3594d1761da8da91be2851f4e8f21">void</a> API_EXPORTED </td><td class="memItemRight" valign="bottom"><a class="el" href="group__libusb__lib.html#gae77a5f683e3cad1dcb881f4b3ac7a148">libusb_set_log_cb</a> (<a class="el" href="structlibusb__context.html">libusb_context</a> *ctx, <a class="el" href="group__libusb__lib.html#ga820bc2b2c9ff61000fea9dd61a770a26">libusb_log_cb</a> cb, int mode)</td></tr>
<tr class="separator:gae77a5f683e3cad1dcb881f4b3ac7a148"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga84683efd59c9bd1b610a4b2d594974df"><td class="memItemLeft" align="right" valign="top">int API_EXPORTED </td><td class="memItemRight" valign="bottom"><a class="el" href="group__libusb__lib.html#ga84683efd59c9bd1b610a4b2d594974df">libusb_set_option</a> (<a class="el" href="structlibusb__context.html">libusb_context</a> *ctx, enum <a class="el" href="group__libusb__lib.html#ga07d4ec54cf575d672ba94c72b3c0de7c">libusb_option</a> <a class="el" href="structoption.html">option</a>,...)</td></tr>
<tr class="separator:ga84683efd59c9bd1b610a4b2d594974df"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga297006e15c446cee88ab09b02f1bbe0c"><td class="memItemLeft" align="right" valign="top">int API_EXPORTED </td><td class="memItemRight" valign="bottom"><a class="el" href="group__libusb__lib.html#ga297006e15c446cee88ab09b02f1bbe0c">libusb_init</a> (<a class="el" href="structlibusb__context.html">libusb_context</a> **context)</td></tr>
<tr class="separator:ga297006e15c446cee88ab09b02f1bbe0c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gab57b6d0abf8349a24792f12b53d20220"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__libusb__asyncio.html#ga8ca3594d1761da8da91be2851f4e8f21">void</a> API_EXPORTED </td><td class="memItemRight" valign="bottom"><a class="el" href="group__libusb__lib.html#gab57b6d0abf8349a24792f12b53d20220">libusb_exit</a> (<a class="el" href="structlibusb__context.html">libusb_context</a> *ctx)</td></tr>
<tr class="separator:gab57b6d0abf8349a24792f12b53d20220"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This page details how to initialize and deinitialize libusb. Initialization must be performed before using any libusb functionality, and similarly you must not call any libusb functions after deinitialization. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga4ec088aa7b79c4a9599e39bf36a72833"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4ec088aa7b79c4a9599e39bf36a72833">◆ </a></span>libusb_context</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="structlibusb__context.html">libusb_context</a> <a class="el" href="structlibusb__context.html">libusb_context</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Structure representing a libusb session. The concept of individual libusb sessions allows for your program to use two libraries (or dynamically load two modules) which both independently use libusb. This will prevent interference between the individual libusb users - for example <a class="el" href="group__libusb__lib.html#ga84683efd59c9bd1b610a4b2d594974df">libusb_set_option()</a> will not affect the other user of the library, and <a class="el" href="group__libusb__lib.html#gab57b6d0abf8349a24792f12b53d20220">libusb_exit()</a> will not destroy resources that the other user is still using.</p>
<p>Sessions are created by <a class="el" href="group__libusb__lib.html#ga297006e15c446cee88ab09b02f1bbe0c">libusb_init()</a> and destroyed through <a class="el" href="group__libusb__lib.html#gab57b6d0abf8349a24792f12b53d20220">libusb_exit()</a>. If your application is guaranteed to only ever include a single libusb user (i.e. you), you do not have to worry about contexts: pass NULL in every function call where a context is required. The default context will be used.</p>
<p>For more information, see <a class="el" href="libusb_contexts.html">Contexts</a>. </p>
</div>
</div>
<a id="ga820bc2b2c9ff61000fea9dd61a770a26"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga820bc2b2c9ff61000fea9dd61a770a26">◆ </a></span>libusb_log_cb</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="group__libusb__asyncio.html#ga8ca3594d1761da8da91be2851f4e8f21">void</a>(<a class="el" href="group__libusb__misc.html#gaa7d6035eb2692d455d27144560a0f68d">LIBUSB_CALL</a> * libusb_log_cb) (<a class="el" href="structlibusb__context.html">libusb_context</a> *ctx, enum <a class="el" href="group__libusb__lib.html#ga2d6144203f0fc6d373677f6e2e89d2d2">libusb_log_level</a> level, const char *str)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback function for handling log messages. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ctx</td><td>the context which is related to the log message, or NULL if it is a global log message </td></tr>
<tr><td class="paramname">level</td><td>the log level, see <a class="el" href="group__libusb__lib.html#ga2d6144203f0fc6d373677f6e2e89d2d2">libusb_log_level</a> for a description </td></tr>
<tr><td class="paramname">str</td><td>the log message </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__libusb__lib.html#gae77a5f683e3cad1dcb881f4b3ac7a148">libusb_set_log_cb()</a> </dd></dl>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga20e11f6f5a3b5a075fdf44969f3a9310"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga20e11f6f5a3b5a075fdf44969f3a9310">◆ </a></span>libusb_log_cb_mode</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group__libusb__lib.html#ga20e11f6f5a3b5a075fdf44969f3a9310">libusb_log_cb_mode</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Log callback mode. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__libusb__lib.html#gae77a5f683e3cad1dcb881f4b3ac7a148">libusb_set_log_cb()</a> </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga20e11f6f5a3b5a075fdf44969f3a9310a3baf6e9e1909f47fa8fce3f4155fbf5e"></a>LIBUSB_LOG_CB_GLOBAL </td><td class="fielddoc"><p>Callback function handling all log messages. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga20e11f6f5a3b5a075fdf44969f3a9310aa82c77f3902eca38eb87b727baa77f15"></a>LIBUSB_LOG_CB_CONTEXT </td><td class="fielddoc"><p>Callback function handling context related log messages. </p>
</td></tr>
</table>
</div>
</div>
<a id="ga2d6144203f0fc6d373677f6e2e89d2d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2d6144203f0fc6d373677f6e2e89d2d2">◆ </a></span>libusb_log_level</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group__libusb__lib.html#ga2d6144203f0fc6d373677f6e2e89d2d2">libusb_log_level</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Log message levels. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga2d6144203f0fc6d373677f6e2e89d2d2af431dbe84c85599526cc0103f8178270"></a>LIBUSB_LOG_LEVEL_NONE </td><td class="fielddoc"><p>(0) : No messages ever emitted by the library (default) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2d6144203f0fc6d373677f6e2e89d2d2ace959b4b99f6c460dfa929b6152e49a8"></a>LIBUSB_LOG_LEVEL_ERROR </td><td class="fielddoc"><p>(1) : Error messages are emitted </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2d6144203f0fc6d373677f6e2e89d2d2a1d141f7a981d9fcd4bc12e41a1a14e78"></a>LIBUSB_LOG_LEVEL_WARNING </td><td class="fielddoc"><p>(2) : Warning and error messages are emitted </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2d6144203f0fc6d373677f6e2e89d2d2ab942d780c83ba4f30b9dd2e338002a07"></a>LIBUSB_LOG_LEVEL_INFO </td><td class="fielddoc"><p>(3) : Informational, warning and error messages are emitted </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2d6144203f0fc6d373677f6e2e89d2d2afabee6826e913933f5d6fe4040bd7b9c"></a>LIBUSB_LOG_LEVEL_DEBUG </td><td class="fielddoc"><p>(4) : All messages are emitted </p>
</td></tr>
</table>
</div>
</div>
<a id="ga07d4ec54cf575d672ba94c72b3c0de7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga07d4ec54cf575d672ba94c72b3c0de7c">◆ </a></span>libusb_option</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group__libusb__lib.html#ga07d4ec54cf575d672ba94c72b3c0de7c">libusb_option</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Available option values for <a class="el" href="group__libusb__lib.html#ga84683efd59c9bd1b610a4b2d594974df">libusb_set_option()</a>. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga07d4ec54cf575d672ba94c72b3c0de7ca8fbcdda276e0c49402c209c25a35cd4d"></a>LIBUSB_OPTION_LOG_LEVEL </td><td class="fielddoc"><p>Set the log message verbosity.</p>
<p>The default level is LIBUSB_LOG_LEVEL_NONE, which means no messages are ever printed. If you choose to increase the message verbosity level, ensure that your application does not close the stderr file descriptor.</p>
<p>You are advised to use level LIBUSB_LOG_LEVEL_WARNING. libusb is conservative with its message logging and most of the time, will only log messages that explain error conditions and other oddities. This will help you debug your software.</p>
<p>If the LIBUSB_DEBUG environment variable was set when libusb was initialized, this function does nothing: the message verbosity is fixed to the value in the environment variable.</p>
<p>If libusb was compiled without any message logging, this function does nothing: you'll never get any messages.</p>
<p>If libusb was compiled with verbose debug message logging, this function does nothing: you'll always get messages from all levels. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga07d4ec54cf575d672ba94c72b3c0de7ca95e60ef92c1da58829d830db38829aa6"></a>LIBUSB_OPTION_USE_USBDK </td><td class="fielddoc"><p>Use the UsbDk backend for a specific context, if available.</p>
<p>This option should be set immediately after calling <a class="el" href="group__libusb__lib.html#ga297006e15c446cee88ab09b02f1bbe0c">libusb_init()</a>, otherwise unspecified behavior may occur.</p>
<p>Only valid on Windows. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gab57b6d0abf8349a24792f12b53d20220"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab57b6d0abf8349a24792f12b53d20220">◆ </a></span>libusb_exit()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__libusb__asyncio.html#ga8ca3594d1761da8da91be2851f4e8f21">void</a> API_EXPORTED libusb_exit </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structlibusb__context.html">libusb_context</a> * </td>
<td class="paramname"><em>ctx</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Deinitialize libusb. Should be called after closing all open devices and before your application terminates. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ctx</td><td>the context to deinitialize, or NULL for the default context </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga297006e15c446cee88ab09b02f1bbe0c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga297006e15c446cee88ab09b02f1bbe0c">◆ </a></span>libusb_init()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int API_EXPORTED libusb_init </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structlibusb__context.html">libusb_context</a> ** </td>
<td class="paramname"><em>context</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialize libusb. This function must be called before calling any other libusb function.</p>
<p>If you do not provide an output location for a context pointer, a default context will be created. If there was already a default context, it will be reused (and nothing will be initialized/reinitialized).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">context</td><td>Optional output location for context pointer. Only valid on return code 0. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, or a LIBUSB_ERROR code on failure </dd></dl>
<dl class="section see"><dt>See also</dt><dd>libusb_contexts </dd></dl>
</div>
</div>
<a id="ga13db8bfeff29df24ddf88b8823bd9b8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga13db8bfeff29df24ddf88b8823bd9b8a">◆ </a></span>libusb_set_debug()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__libusb__asyncio.html#ga8ca3594d1761da8da91be2851f4e8f21">void</a> API_EXPORTED libusb_set_debug </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structlibusb__context.html">libusb_context</a> * </td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>level</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>Use <a class="el" href="group__libusb__lib.html#ga84683efd59c9bd1b610a4b2d594974df">libusb_set_option()</a> instead using the <a class="el" href="group__libusb__lib.html#gga07d4ec54cf575d672ba94c72b3c0de7ca8fbcdda276e0c49402c209c25a35cd4d">LIBUSB_OPTION_LOG_LEVEL</a> option. </dd></dl>
</div>
</div>
<a id="gae77a5f683e3cad1dcb881f4b3ac7a148"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae77a5f683e3cad1dcb881f4b3ac7a148">◆ </a></span>libusb_set_log_cb()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__libusb__asyncio.html#ga8ca3594d1761da8da91be2851f4e8f21">void</a> API_EXPORTED libusb_set_log_cb </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structlibusb__context.html">libusb_context</a> * </td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__libusb__lib.html#ga820bc2b2c9ff61000fea9dd61a770a26">libusb_log_cb</a> </td>
<td class="paramname"><em>cb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>mode</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set log handler.</p>
<p>libusb will redirect its log messages to the provided callback function. libusb supports redirection of per context and global log messages. Log messages sent to the context will be sent to the global log handler too.</p>
<p>If libusb is compiled without message logging or USE_SYSTEM_LOGGING_FACILITY is defined then global callback function will never be called. If ENABLE_DEBUG_LOGGING is defined then per context callback function will never be called.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ctx</td><td>context on which to assign log handler, or NULL for the default context. Parameter ignored if only LIBUSB_LOG_CB_GLOBAL mode is requested. </td></tr>
<tr><td class="paramname">cb</td><td>pointer to the callback function, or NULL to stop log messages redirection </td></tr>
<tr><td class="paramname">mode</td><td>mode of callback function operation. Several modes can be selected for a single callback function, see <a class="el" href="group__libusb__lib.html#ga20e11f6f5a3b5a075fdf44969f3a9310">libusb_log_cb_mode</a> for a description. </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__libusb__lib.html#ga820bc2b2c9ff61000fea9dd61a770a26">libusb_log_cb</a>, <a class="el" href="group__libusb__lib.html#ga20e11f6f5a3b5a075fdf44969f3a9310">libusb_log_cb_mode</a> </dd></dl>
</div>
</div>
<a id="ga84683efd59c9bd1b610a4b2d594974df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga84683efd59c9bd1b610a4b2d594974df">◆ </a></span>libusb_set_option()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int API_EXPORTED libusb_set_option </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structlibusb__context.html">libusb_context</a> * </td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">enum <a class="el" href="group__libusb__lib.html#ga07d4ec54cf575d672ba94c72b3c0de7c">libusb_option</a> </td>
<td class="paramname"><em>option</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname"><em>...</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set an option in the library.</p>
<p>Use this function to configure a specific option within the library.</p>
<p>Some options require one or more arguments to be provided. Consult each option's documentation for specific requirements.</p>
<p>Since version 1.0.22, <a class="el" href="group__libusb__misc.html#gaabe4bc36a83358685d36a6c853cbb4de">LIBUSB_API_VERSION</a> >= 0x01000106</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ctx</td><td>context on which to operate </td></tr>
<tr><td class="paramname">option</td><td>which option to set </td></tr>
<tr><td class="paramname">...</td><td>any required arguments for the specified option</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>LIBUSB_SUCCESS on success </dd>
<dd>
LIBUSB_ERROR_INVALID_PARAM if the option or arguments are invalid </dd>
<dd>
LIBUSB_ERROR_NOT_SUPPORTED if the option is valid but not supported on this platform </dd>
<dd>
LIBUSB_ERROR_NOT_FOUND if LIBUSB_OPTION_USE_USBDK is valid on this platform but UsbDk is not available </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated 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>