-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfiguration.html
106 lines (105 loc) · 6.1 KB
/
configuration.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
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia Site Renderer 1.8.1 from src/site/apt/configuration.apt.vm at 2018-10-21
| Rendered using Apache Maven Fluido Skin 1.7
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="Date-Revision-yyyymmdd" content="20181021" />
<meta http-equiv="Content-Language" content="en" />
<title>usb4java – Configuration</title>
<link rel="stylesheet" href="./css/apache-maven-fluido-1.7.min.css" />
<link rel="stylesheet" href="./css/site.css" />
<link rel="stylesheet" href="./css/print.css" media="print" />
<script type="text/javascript" src="./js/apache-maven-fluido-1.7.min.js"></script>
<link href="favicon.ico" rel="SHORTCUT ICON" />
</head>
<body class="topBarDisabled">
<a href="https://github.com/usb4java">
<img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"
alt="Fork me on GitHub">
</a>
<div class="container-fluid">
<div id="banner">
<div class="pull-left"><a href="./" id="bannerLeft"><img src="images/logo.png" alt="usb4java"/></a></div>
<div class="pull-right"></div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li id="publishDate">Last Published: 2018-10-21<span class="divider">|</span>
</li>
<li id="projectVersion">Version: 1.3.0<span class="divider">|</span></li>
<li class=""><a href="./" title="usb4java">usb4java</a><span class="divider">/</span></li>
<li class="active ">Configuration</li>
<li class="pull-right"><span class="divider">|</span>
<a href="http://libusb.info/" class="externalLink" title="libusb">libusb</a></li>
<li class="pull-right"><a href="http://javax-usb.sourceforge.net/" class="externalLink" title="javax-usb">javax-usb</a></li>
</ul>
</div>
<div class="row-fluid">
<div id="leftColumn" class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">usb4java</li>
<li><a href="index.html" title="About"><span class="none"></span>About</a></li>
<li><a href="quickstart/index.html" title="Quick start"><span class="icon-chevron-right"></span>Quick start</a></li>
<li><a href="faq.html" title="FAQ"><span class="none"></span>FAQ</a></li>
<li class="active"><a href="#"><span class="none"></span>Configuration</a></li>
<li><a href="nativelibs.html" title="Native libs"><span class="none"></span>Native libs</a></li>
<li class="nav-header">Project Documentation</li>
<li><a href="project-info.html" title="Project Information"><span class="icon-chevron-right"></span>Project Information</a></li>
<li><a href="project-reports.html" title="Project Reports"><span class="icon-chevron-right"></span>Project Reports</a></li>
</ul>
<hr />
<div id="poweredBy">
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
</div>
</div>
</div>
<div id="bodyColumn" class="span10" >
<div class="section">
<h2><a name="Configuration"></a>Configuration</h2>
<p>The configuration options explained here are only valid for the javax-usb extension of usb4java. If you access your USB devices with the native libusb API then no configuration is needed.</p>
<div class="section">
<h3><a name="Selecting_usb4java_as_javax-usb_implementation"></a>Selecting usb4java as javax-usb implementation</h3>
<p>To tell the USB Host Manager of <i>javax-usb</i> to use the <i>usb4java</i> implementation you have to put the following property into the <i>javax.usb.properties</i> file which must be located in the root of your classpath:</p>
<div class="source"><pre class="prettyprint">javax.usb.services = org.usb4java.javax.Services</pre></div>
<p><i>usb4java</i> can be configured by adding more properties to this file as described in the following sections.</p></div>
<div class="section">
<h3><a name="Communication_timeout"></a>Communication timeout</h3>
<p>The default USB communication timeout of <i>usb4java</i> is 2500 milliseconds. To change this to 250 milliseconds for example add this to the properties file:</p>
<div class="source"><pre class="prettyprint">org.usb4java.javax.timeout = 250</pre></div></div>
<div class="section">
<h3><a name="Scan_interval"></a>Scan interval</h3>
<p>The default USB device scan interval of <i>usb4java</i> is 500 milliseconds. To change this to 1000 milliseconds for example add this to the properties file:</p>
<div class="source"><pre class="prettyprint">org.usb4java.javax.scanInterval = 1000</pre></div>
<p>When you set this interval to 0 then <i>usb4java</i> only scans once during application startup. If you want to trigger a manual device <i>scan</i> you can do it by calling the scan method on the USB services class (Must be casted to the <i>usb4java</i> implementation, because this is not a javax-usb feature:</p>
<div class="source"><pre class="prettyprint">((org.usb4java.javax.Services) UsbHostManager.getUsbServices()).scan();</pre></div></div>
<div class="section">
<h3><a name="Use_USBDK"></a>Use USBDK</h3>
<p>If you want to use <a class="externalLink" href="https://github.com/daynix/UsbDk">USBDK</a> on Windows then you have to enable the feature with the following entry:</p>
<div class="source"><pre class="prettyprint">org.usb4java.javax.useUSBDK = true</pre></div>
<p>This setting is ignored on other platforms.</p></div></div>
</div>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row-fluid">
<p>Copyright ©2011–2018
<a href="http://usb4java.org/">usb4java Team</a>.
All rights reserved.</p>
</div>
</div>
</footer>
</body>
</html>