1 |
2 |
ZTEX |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2 |
|
|
<!--NewPage-->
|
3 |
|
|
<HTML>
|
4 |
|
|
<HEAD>
|
5 |
|
|
<!-- Generated by javadoc (build 1.6.0_18) on Wed Oct 30 21:18:13 CET 2013 -->
|
6 |
|
|
<TITLE>
|
7 |
|
|
Device
|
8 |
|
|
</TITLE>
|
9 |
|
|
|
10 |
|
|
<META NAME="date" CONTENT="2013-10-30">
|
11 |
|
|
|
12 |
|
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
13 |
|
|
|
14 |
|
|
<SCRIPT type="text/javascript">
|
15 |
|
|
function windowTitle()
|
16 |
|
|
{
|
17 |
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
18 |
|
|
parent.document.title="Device";
|
19 |
|
|
}
|
20 |
|
|
}
|
21 |
|
|
</SCRIPT>
|
22 |
|
|
<NOSCRIPT>
|
23 |
|
|
</NOSCRIPT>
|
24 |
|
|
|
25 |
|
|
</HEAD>
|
26 |
|
|
|
27 |
|
|
<BODY BGCOLOR="white" onload="windowTitle();">
|
28 |
|
|
<HR>
|
29 |
|
|
|
30 |
|
|
|
31 |
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
32 |
|
|
<A NAME="navbar_top"><!-- --></A>
|
33 |
|
|
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
34 |
|
|
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
35 |
|
|
<TR>
|
36 |
|
|
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
37 |
|
|
<A NAME="navbar_top_firstrow"><!-- --></A>
|
38 |
|
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
39 |
|
|
<TR ALIGN="center" VALIGN="top">
|
40 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
41 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
42 |
|
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
43 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
44 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
45 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
46 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
47 |
|
|
</TR>
|
48 |
|
|
</TABLE>
|
49 |
|
|
</TD>
|
50 |
|
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
51 |
|
|
</EM>
|
52 |
|
|
</TD>
|
53 |
|
|
</TR>
|
54 |
|
|
|
55 |
|
|
<TR>
|
56 |
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
57 |
|
|
PREV CLASS
|
58 |
|
|
<A HREF="../../../ch/ntb/usb/LibLoader.html" title="class in ch.ntb.usb"><B>NEXT CLASS</B></A></FONT></TD>
|
59 |
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
60 |
|
|
<A HREF="../../../index.html?ch/ntb/usb/Device.html" target="_top"><B>FRAMES</B></A>
|
61 |
|
|
<A HREF="Device.html" target="_top"><B>NO FRAMES</B></A>
|
62 |
|
|
<SCRIPT type="text/javascript">
|
63 |
|
|
<!--
|
64 |
|
|
if(window==top) {
|
65 |
|
|
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
66 |
|
|
}
|
67 |
|
|
//-->
|
68 |
|
|
</SCRIPT>
|
69 |
|
|
<NOSCRIPT>
|
70 |
|
|
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
71 |
|
|
</NOSCRIPT>
|
72 |
|
|
|
73 |
|
|
|
74 |
|
|
</FONT></TD>
|
75 |
|
|
</TR>
|
76 |
|
|
<TR>
|
77 |
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
78 |
|
|
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
79 |
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
80 |
|
|
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
81 |
|
|
</TR>
|
82 |
|
|
</TABLE>
|
83 |
|
|
<A NAME="skip-navbar_top"></A>
|
84 |
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
85 |
|
|
|
86 |
|
|
<HR>
|
87 |
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
88 |
|
|
<H2>
|
89 |
|
|
<FONT SIZE="-1">
|
90 |
|
|
ch.ntb.usb</FONT>
|
91 |
|
|
<BR>
|
92 |
|
|
Class Device</H2>
|
93 |
|
|
<PRE>
|
94 |
|
|
java.lang.Object
|
95 |
|
|
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>ch.ntb.usb.Device</B>
|
96 |
|
|
</PRE>
|
97 |
|
|
<HR>
|
98 |
|
|
<DL>
|
99 |
|
|
<DT><PRE>public class <B>Device</B><DT>extends java.lang.Object</DL>
|
100 |
|
|
</PRE>
|
101 |
|
|
|
102 |
|
|
<P>
|
103 |
|
|
This class represents an USB device.<br>
|
104 |
|
|
To get an instance of an USB device use <code>USB.getDevice(...)</code>.
|
105 |
|
|
<P>
|
106 |
|
|
|
107 |
|
|
<P>
|
108 |
|
|
<HR>
|
109 |
|
|
|
110 |
|
|
<P>
|
111 |
|
|
|
112 |
|
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
113 |
|
|
|
114 |
|
|
<A NAME="constructor_summary"><!-- --></A>
|
115 |
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
116 |
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
117 |
|
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
118 |
|
|
<B>Constructor Summary</B></FONT></TH>
|
119 |
|
|
</TR>
|
120 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
121 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
122 |
|
|
<CODE>protected </CODE></FONT></TD>
|
123 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#Device(short, short)">Device</A></B>(short idVendor,
|
124 |
|
|
short idProduct)</CODE>
|
125 |
|
|
|
126 |
|
|
<BR>
|
127 |
|
|
</TD>
|
128 |
|
|
</TR>
|
129 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
130 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
131 |
|
|
<CODE>protected </CODE></FONT></TD>
|
132 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#Device(short, short, java.lang.String)">Device</A></B>(short idVendor,
|
133 |
|
|
short idProduct,
|
134 |
|
|
java.lang.String filename)</CODE>
|
135 |
|
|
|
136 |
|
|
<BR>
|
137 |
|
|
</TD>
|
138 |
|
|
</TR>
|
139 |
|
|
</TABLE>
|
140 |
|
|
|
141 |
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
142 |
|
|
|
143 |
|
|
<A NAME="method_summary"><!-- --></A>
|
144 |
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
145 |
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
146 |
|
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
147 |
|
|
<B>Method Summary</B></FONT></TH>
|
148 |
|
|
</TR>
|
149 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
150 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
151 |
|
|
<CODE> void</CODE></FONT></TD>
|
152 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#close()">close</A></B>()</CODE>
|
153 |
|
|
|
154 |
|
|
<BR>
|
155 |
|
|
Release the claimed interface and close the opened device.</TD>
|
156 |
|
|
</TR>
|
157 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
158 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
159 |
|
|
<CODE> int</CODE></FONT></TD>
|
160 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#controlMsg(int, int, int, int, byte[], int, int, boolean)">controlMsg</A></B>(int requestType,
|
161 |
|
|
int request,
|
162 |
|
|
int value,
|
163 |
|
|
int index,
|
164 |
|
|
byte[] data,
|
165 |
|
|
int size,
|
166 |
|
|
int timeout,
|
167 |
|
|
boolean reopenOnTimeout)</CODE>
|
168 |
|
|
|
169 |
|
|
<BR>
|
170 |
|
|
Performs a control request to the default control pipe on a device.</TD>
|
171 |
|
|
</TR>
|
172 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
173 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
174 |
|
|
<CODE> int</CODE></FONT></TD>
|
175 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#getAltinterface()">getAltinterface</A></B>()</CODE>
|
176 |
|
|
|
177 |
|
|
<BR>
|
178 |
|
|
Returns the alternative interface.</TD>
|
179 |
|
|
</TR>
|
180 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
181 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
182 |
|
|
<CODE> <A HREF="../../../ch/ntb/usb/Usb_Config_Descriptor.html" title="class in ch.ntb.usb">Usb_Config_Descriptor</A>[]</CODE></FONT></TD>
|
183 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#getConfigDescriptors()">getConfigDescriptors</A></B>()</CODE>
|
184 |
|
|
|
185 |
|
|
<BR>
|
186 |
|
|
Returns the configuration descriptors associated with this device.</TD>
|
187 |
|
|
</TR>
|
188 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
189 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
190 |
|
|
<CODE> int</CODE></FONT></TD>
|
191 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#getConfiguration()">getConfiguration</A></B>()</CODE>
|
192 |
|
|
|
193 |
|
|
<BR>
|
194 |
|
|
Returns the current configuration used.</TD>
|
195 |
|
|
</TR>
|
196 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
197 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
198 |
|
|
<CODE> <A HREF="../../../ch/ntb/usb/Usb_Device.html" title="class in ch.ntb.usb">Usb_Device</A></CODE></FONT></TD>
|
199 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#getDevice()">getDevice</A></B>()</CODE>
|
200 |
|
|
|
201 |
|
|
<BR>
|
202 |
|
|
Returns the Usb_Device instance associated with this device.</TD>
|
203 |
|
|
</TR>
|
204 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
205 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
206 |
|
|
<CODE> <A HREF="../../../ch/ntb/usb/Usb_Device_Descriptor.html" title="class in ch.ntb.usb">Usb_Device_Descriptor</A></CODE></FONT></TD>
|
207 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#getDeviceDescriptor()">getDeviceDescriptor</A></B>()</CODE>
|
208 |
|
|
|
209 |
|
|
<BR>
|
210 |
|
|
Returns the device descriptor associated with this device.</TD>
|
211 |
|
|
</TR>
|
212 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
213 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
214 |
|
|
<CODE>protected java.lang.String</CODE></FONT></TD>
|
215 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#getFilename()">getFilename</A></B>()</CODE>
|
216 |
|
|
|
217 |
|
|
<BR>
|
218 |
|
|
Returns the optional filename which is set when there are multiple
|
219 |
|
|
devices with the same vendor and product id.</TD>
|
220 |
|
|
</TR>
|
221 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
222 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
223 |
|
|
<CODE> int</CODE></FONT></TD>
|
224 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#getIdProduct()">getIdProduct</A></B>()</CODE>
|
225 |
|
|
|
226 |
|
|
<BR>
|
227 |
|
|
Returns the product ID of the device.</TD>
|
228 |
|
|
</TR>
|
229 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
230 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
231 |
|
|
<CODE> int</CODE></FONT></TD>
|
232 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#getIdVendor()">getIdVendor</A></B>()</CODE>
|
233 |
|
|
|
234 |
|
|
<BR>
|
235 |
|
|
Returns the vendor ID of the device.</TD>
|
236 |
|
|
</TR>
|
237 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
238 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
239 |
|
|
<CODE> int</CODE></FONT></TD>
|
240 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#getInterface()">getInterface</A></B>()</CODE>
|
241 |
|
|
|
242 |
|
|
<BR>
|
243 |
|
|
Returns the current interface.</TD>
|
244 |
|
|
</TR>
|
245 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
246 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
247 |
|
|
<CODE> int</CODE></FONT></TD>
|
248 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#getMaxPacketSize()">getMaxPacketSize</A></B>()</CODE>
|
249 |
|
|
|
250 |
|
|
<BR>
|
251 |
|
|
Returns the maximum packet size in bytes which is allowed to be
|
252 |
|
|
transmitted at once.</TD>
|
253 |
|
|
</TR>
|
254 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
255 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
256 |
|
|
<CODE> boolean</CODE></FONT></TD>
|
257 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#isOpen()">isOpen</A></B>()</CODE>
|
258 |
|
|
|
259 |
|
|
<BR>
|
260 |
|
|
Check if the device is open.</TD>
|
261 |
|
|
</TR>
|
262 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
263 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
264 |
|
|
<CODE> void</CODE></FONT></TD>
|
265 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#open(int, int, int)">open</A></B>(int configuration,
|
266 |
|
|
int interface_,
|
267 |
|
|
int altinterface)</CODE>
|
268 |
|
|
|
269 |
|
|
<BR>
|
270 |
|
|
Opens the device and claims the specified configuration, interface and
|
271 |
|
|
altinterface.</TD>
|
272 |
|
|
</TR>
|
273 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
274 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
275 |
|
|
<CODE> int</CODE></FONT></TD>
|
276 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#readBulk(int, byte[], int, int, boolean)">readBulk</A></B>(int in_ep_address,
|
277 |
|
|
byte[] data,
|
278 |
|
|
int size,
|
279 |
|
|
int timeout,
|
280 |
|
|
boolean reopenOnTimeout)</CODE>
|
281 |
|
|
|
282 |
|
|
<BR>
|
283 |
|
|
Read data from the device using a bulk transfer.</TD>
|
284 |
|
|
</TR>
|
285 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
286 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
287 |
|
|
<CODE> int</CODE></FONT></TD>
|
288 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#readInterrupt(int, byte[], int, int, boolean)">readInterrupt</A></B>(int in_ep_address,
|
289 |
|
|
byte[] data,
|
290 |
|
|
int size,
|
291 |
|
|
int timeout,
|
292 |
|
|
boolean reopenOnTimeout)</CODE>
|
293 |
|
|
|
294 |
|
|
<BR>
|
295 |
|
|
Read data from the device using a interrupt transfer.</TD>
|
296 |
|
|
</TR>
|
297 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
298 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
299 |
|
|
<CODE> void</CODE></FONT></TD>
|
300 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#reset()">reset</A></B>()</CODE>
|
301 |
|
|
|
302 |
|
|
<BR>
|
303 |
|
|
Sends an USB reset to the device.</TD>
|
304 |
|
|
</TR>
|
305 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
306 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
307 |
|
|
<CODE> void</CODE></FONT></TD>
|
308 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#setResetOnFirstOpen(boolean, int)">setResetOnFirstOpen</A></B>(boolean enable,
|
309 |
|
|
int timeout)</CODE>
|
310 |
|
|
|
311 |
|
|
<BR>
|
312 |
|
|
If enabled, the device is reset when first opened.</TD>
|
313 |
|
|
</TR>
|
314 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
315 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
316 |
|
|
<CODE> void</CODE></FONT></TD>
|
317 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#updateDescriptors()">updateDescriptors</A></B>()</CODE>
|
318 |
|
|
|
319 |
|
|
<BR>
|
320 |
|
|
Updates the device and descriptor information from the bus.</TD>
|
321 |
|
|
</TR>
|
322 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
323 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
324 |
|
|
<CODE> int</CODE></FONT></TD>
|
325 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#writeBulk(int, byte[], int, int, boolean)">writeBulk</A></B>(int out_ep_address,
|
326 |
|
|
byte[] data,
|
327 |
|
|
int size,
|
328 |
|
|
int timeout,
|
329 |
|
|
boolean reopenOnTimeout)</CODE>
|
330 |
|
|
|
331 |
|
|
<BR>
|
332 |
|
|
Write data to the device using a bulk transfer.</TD>
|
333 |
|
|
</TR>
|
334 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
335 |
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
336 |
|
|
<CODE> int</CODE></FONT></TD>
|
337 |
|
|
<TD><CODE><B><A HREF="../../../ch/ntb/usb/Device.html#writeInterrupt(int, byte[], int, int, boolean)">writeInterrupt</A></B>(int out_ep_address,
|
338 |
|
|
byte[] data,
|
339 |
|
|
int size,
|
340 |
|
|
int timeout,
|
341 |
|
|
boolean reopenOnTimeout)</CODE>
|
342 |
|
|
|
343 |
|
|
<BR>
|
344 |
|
|
Write data to the device using a interrupt transfer.</TD>
|
345 |
|
|
</TR>
|
346 |
|
|
</TABLE>
|
347 |
|
|
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
348 |
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
349 |
|
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
350 |
|
|
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
351 |
|
|
</TR>
|
352 |
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
353 |
|
|
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
354 |
|
|
</TR>
|
355 |
|
|
</TABLE>
|
356 |
|
|
|
357 |
|
|
<P>
|
358 |
|
|
|
359 |
|
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
360 |
|
|
|
361 |
|
|
<A NAME="constructor_detail"><!-- --></A>
|
362 |
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
363 |
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
364 |
|
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
365 |
|
|
<B>Constructor Detail</B></FONT></TH>
|
366 |
|
|
</TR>
|
367 |
|
|
</TABLE>
|
368 |
|
|
|
369 |
|
|
<A NAME="Device(short, short)"><!-- --></A><H3>
|
370 |
|
|
Device</H3>
|
371 |
|
|
<PRE>
|
372 |
|
|
protected <B>Device</B>(short idVendor,
|
373 |
|
|
short idProduct)</PRE>
|
374 |
|
|
<DL>
|
375 |
|
|
</DL>
|
376 |
|
|
<HR>
|
377 |
|
|
|
378 |
|
|
<A NAME="Device(short, short, java.lang.String)"><!-- --></A><H3>
|
379 |
|
|
Device</H3>
|
380 |
|
|
<PRE>
|
381 |
|
|
protected <B>Device</B>(short idVendor,
|
382 |
|
|
short idProduct,
|
383 |
|
|
java.lang.String filename)</PRE>
|
384 |
|
|
<DL>
|
385 |
|
|
</DL>
|
386 |
|
|
|
387 |
|
|
<!-- ============ METHOD DETAIL ========== -->
|
388 |
|
|
|
389 |
|
|
<A NAME="method_detail"><!-- --></A>
|
390 |
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
391 |
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
392 |
|
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
393 |
|
|
<B>Method Detail</B></FONT></TH>
|
394 |
|
|
</TR>
|
395 |
|
|
</TABLE>
|
396 |
|
|
|
397 |
|
|
<A NAME="updateDescriptors()"><!-- --></A><H3>
|
398 |
|
|
updateDescriptors</H3>
|
399 |
|
|
<PRE>
|
400 |
|
|
public void <B>updateDescriptors</B>()
|
401 |
|
|
throws <A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></PRE>
|
402 |
|
|
<DL>
|
403 |
|
|
<DD>Updates the device and descriptor information from the bus.<br>
|
404 |
|
|
The descriptors can be read with <A HREF="../../../ch/ntb/usb/Device.html#getDeviceDescriptor()"><CODE>getDeviceDescriptor()</CODE></A> and
|
405 |
|
|
<A HREF="../../../ch/ntb/usb/Device.html#getConfigDescriptors()"><CODE>getConfigDescriptors()</CODE></A>.
|
406 |
|
|
<P>
|
407 |
|
|
<DD><DL>
|
408 |
|
|
|
409 |
|
|
<DT><B>Throws:</B>
|
410 |
|
|
<DD><CODE><A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></CODE></DL>
|
411 |
|
|
</DD>
|
412 |
|
|
</DL>
|
413 |
|
|
<HR>
|
414 |
|
|
|
415 |
|
|
<A NAME="getDeviceDescriptor()"><!-- --></A><H3>
|
416 |
|
|
getDeviceDescriptor</H3>
|
417 |
|
|
<PRE>
|
418 |
|
|
public <A HREF="../../../ch/ntb/usb/Usb_Device_Descriptor.html" title="class in ch.ntb.usb">Usb_Device_Descriptor</A> <B>getDeviceDescriptor</B>()</PRE>
|
419 |
|
|
<DL>
|
420 |
|
|
<DD>Returns the device descriptor associated with this device.<br>
|
421 |
|
|
The descriptor is updated by calling <A HREF="../../../ch/ntb/usb/Device.html#updateDescriptors()"><CODE>updateDescriptors()</CODE></A> or
|
422 |
|
|
<A HREF="../../../ch/ntb/usb/Device.html#open(int, int, int)"><CODE>open(int, int, int)</CODE></A>.
|
423 |
|
|
<P>
|
424 |
|
|
<DD><DL>
|
425 |
|
|
|
426 |
|
|
<DT><B>Returns:</B><DD>the device descriptor associated with this device or
|
427 |
|
|
<code>null</code></DL>
|
428 |
|
|
</DD>
|
429 |
|
|
</DL>
|
430 |
|
|
<HR>
|
431 |
|
|
|
432 |
|
|
<A NAME="getConfigDescriptors()"><!-- --></A><H3>
|
433 |
|
|
getConfigDescriptors</H3>
|
434 |
|
|
<PRE>
|
435 |
|
|
public <A HREF="../../../ch/ntb/usb/Usb_Config_Descriptor.html" title="class in ch.ntb.usb">Usb_Config_Descriptor</A>[] <B>getConfigDescriptors</B>()</PRE>
|
436 |
|
|
<DL>
|
437 |
|
|
<DD>Returns the configuration descriptors associated with this device.<br>
|
438 |
|
|
The descriptors are updated by calling <A HREF="../../../ch/ntb/usb/Device.html#updateDescriptors()"><CODE>updateDescriptors()</CODE></A> or
|
439 |
|
|
<A HREF="../../../ch/ntb/usb/Device.html#open(int, int, int)"><CODE>open(int, int, int)</CODE></A>.
|
440 |
|
|
<P>
|
441 |
|
|
<DD><DL>
|
442 |
|
|
|
443 |
|
|
<DT><B>Returns:</B><DD>the configuration descriptors associated with this device or
|
444 |
|
|
<code>null</code></DL>
|
445 |
|
|
</DD>
|
446 |
|
|
</DL>
|
447 |
|
|
<HR>
|
448 |
|
|
|
449 |
|
|
<A NAME="open(int, int, int)"><!-- --></A><H3>
|
450 |
|
|
open</H3>
|
451 |
|
|
<PRE>
|
452 |
|
|
public void <B>open</B>(int configuration,
|
453 |
|
|
int interface_,
|
454 |
|
|
int altinterface)
|
455 |
|
|
throws <A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></PRE>
|
456 |
|
|
<DL>
|
457 |
|
|
<DD>Opens the device and claims the specified configuration, interface and
|
458 |
|
|
altinterface.<br>
|
459 |
|
|
First the bus is enumerated. If the device is found its descriptors are
|
460 |
|
|
read and the <code>maxPacketSize</code> value is updated. If no
|
461 |
|
|
endpoints are found in the descriptors an exception is thrown.
|
462 |
|
|
<P>
|
463 |
|
|
<DD><DL>
|
464 |
|
|
<DT><B>Parameters:</B><DD><CODE>configuration</CODE> - the configuration, see
|
465 |
|
|
<A HREF="../../../ch/ntb/usb/Usb_Config_Descriptor.html#getBConfigurationValue()"><CODE>Usb_Config_Descriptor.getBConfigurationValue()</CODE></A><DD><CODE>interface_</CODE> - the interface, see
|
466 |
|
|
<A HREF="../../../ch/ntb/usb/Usb_Interface_Descriptor.html#getBInterfaceNumber()"><CODE>Usb_Interface_Descriptor.getBInterfaceNumber()</CODE></A><DD><CODE>altinterface</CODE> - the alternate interface, see
|
467 |
|
|
<A HREF="../../../ch/ntb/usb/Usb_Interface_Descriptor.html#getBAlternateSetting()"><CODE>Usb_Interface_Descriptor.getBAlternateSetting()</CODE></A>. If
|
468 |
|
|
no alternate interface must be set <i>-1</i> can be used.
|
469 |
|
|
<DT><B>Throws:</B>
|
470 |
|
|
<DD><CODE><A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></CODE></DL>
|
471 |
|
|
</DD>
|
472 |
|
|
</DL>
|
473 |
|
|
<HR>
|
474 |
|
|
|
475 |
|
|
<A NAME="close()"><!-- --></A><H3>
|
476 |
|
|
close</H3>
|
477 |
|
|
<PRE>
|
478 |
|
|
public void <B>close</B>()
|
479 |
|
|
throws <A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></PRE>
|
480 |
|
|
<DL>
|
481 |
|
|
<DD>Release the claimed interface and close the opened device.<br>
|
482 |
|
|
<P>
|
483 |
|
|
<DD><DL>
|
484 |
|
|
|
485 |
|
|
<DT><B>Throws:</B>
|
486 |
|
|
<DD><CODE><A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></CODE></DL>
|
487 |
|
|
</DD>
|
488 |
|
|
</DL>
|
489 |
|
|
<HR>
|
490 |
|
|
|
491 |
|
|
<A NAME="reset()"><!-- --></A><H3>
|
492 |
|
|
reset</H3>
|
493 |
|
|
<PRE>
|
494 |
|
|
public void <B>reset</B>()
|
495 |
|
|
throws <A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></PRE>
|
496 |
|
|
<DL>
|
497 |
|
|
<DD>Sends an USB reset to the device. The device handle will no longer be
|
498 |
|
|
valid. To use the device again, <A HREF="../../../ch/ntb/usb/Device.html#open(int, int, int)"><CODE>open(int, int, int)</CODE></A> must be
|
499 |
|
|
called.
|
500 |
|
|
<P>
|
501 |
|
|
<DD><DL>
|
502 |
|
|
|
503 |
|
|
<DT><B>Throws:</B>
|
504 |
|
|
<DD><CODE><A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></CODE></DL>
|
505 |
|
|
</DD>
|
506 |
|
|
</DL>
|
507 |
|
|
<HR>
|
508 |
|
|
|
509 |
|
|
<A NAME="writeBulk(int, byte[], int, int, boolean)"><!-- --></A><H3>
|
510 |
|
|
writeBulk</H3>
|
511 |
|
|
<PRE>
|
512 |
|
|
public int <B>writeBulk</B>(int out_ep_address,
|
513 |
|
|
byte[] data,
|
514 |
|
|
int size,
|
515 |
|
|
int timeout,
|
516 |
|
|
boolean reopenOnTimeout)
|
517 |
|
|
throws <A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></PRE>
|
518 |
|
|
<DL>
|
519 |
|
|
<DD>Write data to the device using a bulk transfer.<br>
|
520 |
|
|
<P>
|
521 |
|
|
<DD><DL>
|
522 |
|
|
<DT><B>Parameters:</B><DD><CODE>out_ep_address</CODE> - endpoint address to write to<DD><CODE>data</CODE> - data to write to this endpoint<DD><CODE>size</CODE> - size of the data<DD><CODE>timeout</CODE> - amount of time in ms the device will try to send the data
|
523 |
|
|
until a timeout exception is thrown<DD><CODE>reopenOnTimeout</CODE> - if set to true, the device will try to open the connection and
|
524 |
|
|
send the data again before a timeout exception is thrown
|
525 |
|
|
<DT><B>Returns:</B><DD>the actual number of bytes written
|
526 |
|
|
<DT><B>Throws:</B>
|
527 |
|
|
<DD><CODE><A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></CODE></DL>
|
528 |
|
|
</DD>
|
529 |
|
|
</DL>
|
530 |
|
|
<HR>
|
531 |
|
|
|
532 |
|
|
<A NAME="readBulk(int, byte[], int, int, boolean)"><!-- --></A><H3>
|
533 |
|
|
readBulk</H3>
|
534 |
|
|
<PRE>
|
535 |
|
|
public int <B>readBulk</B>(int in_ep_address,
|
536 |
|
|
byte[] data,
|
537 |
|
|
int size,
|
538 |
|
|
int timeout,
|
539 |
|
|
boolean reopenOnTimeout)
|
540 |
|
|
throws <A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></PRE>
|
541 |
|
|
<DL>
|
542 |
|
|
<DD>Read data from the device using a bulk transfer.<br>
|
543 |
|
|
<P>
|
544 |
|
|
<DD><DL>
|
545 |
|
|
<DT><B>Parameters:</B><DD><CODE>in_ep_address</CODE> - endpoint address to read from<DD><CODE>data</CODE> - data buffer for the data to be read<DD><CODE>size</CODE> - the maximum requested data size<DD><CODE>timeout</CODE> - amount of time in ms the device will try to receive data until
|
546 |
|
|
a timeout exception is thrown<DD><CODE>reopenOnTimeout</CODE> - if set to true, the device will try to open the connection and
|
547 |
|
|
receive the data again before a timeout exception is thrown
|
548 |
|
|
<DT><B>Returns:</B><DD>the actual number of bytes read
|
549 |
|
|
<DT><B>Throws:</B>
|
550 |
|
|
<DD><CODE><A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></CODE></DL>
|
551 |
|
|
</DD>
|
552 |
|
|
</DL>
|
553 |
|
|
<HR>
|
554 |
|
|
|
555 |
|
|
<A NAME="writeInterrupt(int, byte[], int, int, boolean)"><!-- --></A><H3>
|
556 |
|
|
writeInterrupt</H3>
|
557 |
|
|
<PRE>
|
558 |
|
|
public int <B>writeInterrupt</B>(int out_ep_address,
|
559 |
|
|
byte[] data,
|
560 |
|
|
int size,
|
561 |
|
|
int timeout,
|
562 |
|
|
boolean reopenOnTimeout)
|
563 |
|
|
throws <A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></PRE>
|
564 |
|
|
<DL>
|
565 |
|
|
<DD>Write data to the device using a interrupt transfer.<br>
|
566 |
|
|
<P>
|
567 |
|
|
<DD><DL>
|
568 |
|
|
<DT><B>Parameters:</B><DD><CODE>out_ep_address</CODE> - endpoint address to write to<DD><CODE>data</CODE> - data to write to this endpoint<DD><CODE>size</CODE> - size of the data<DD><CODE>timeout</CODE> - amount of time in ms the device will try to send the data
|
569 |
|
|
until a timeout exception is thrown<DD><CODE>reopenOnTimeout</CODE> - if set to true, the device will try to open the connection and
|
570 |
|
|
send the data again before a timeout exception is thrown
|
571 |
|
|
<DT><B>Returns:</B><DD>the actual number of bytes written
|
572 |
|
|
<DT><B>Throws:</B>
|
573 |
|
|
<DD><CODE><A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></CODE></DL>
|
574 |
|
|
</DD>
|
575 |
|
|
</DL>
|
576 |
|
|
<HR>
|
577 |
|
|
|
578 |
|
|
<A NAME="readInterrupt(int, byte[], int, int, boolean)"><!-- --></A><H3>
|
579 |
|
|
readInterrupt</H3>
|
580 |
|
|
<PRE>
|
581 |
|
|
public int <B>readInterrupt</B>(int in_ep_address,
|
582 |
|
|
byte[] data,
|
583 |
|
|
int size,
|
584 |
|
|
int timeout,
|
585 |
|
|
boolean reopenOnTimeout)
|
586 |
|
|
throws <A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></PRE>
|
587 |
|
|
<DL>
|
588 |
|
|
<DD>Read data from the device using a interrupt transfer.<br>
|
589 |
|
|
<P>
|
590 |
|
|
<DD><DL>
|
591 |
|
|
<DT><B>Parameters:</B><DD><CODE>in_ep_address</CODE> - endpoint address to read from<DD><CODE>data</CODE> - data buffer for the data to be read<DD><CODE>size</CODE> - the maximum requested data size<DD><CODE>timeout</CODE> - amount of time in ms the device will try to receive data until
|
592 |
|
|
a timeout exception is thrown<DD><CODE>reopenOnTimeout</CODE> - if set to true, the device will try to open the connection and
|
593 |
|
|
receive the data again before a timeout exception is thrown
|
594 |
|
|
<DT><B>Returns:</B><DD>the actual number of bytes read
|
595 |
|
|
<DT><B>Throws:</B>
|
596 |
|
|
<DD><CODE><A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></CODE></DL>
|
597 |
|
|
</DD>
|
598 |
|
|
</DL>
|
599 |
|
|
<HR>
|
600 |
|
|
|
601 |
|
|
<A NAME="controlMsg(int, int, int, int, byte[], int, int, boolean)"><!-- --></A><H3>
|
602 |
|
|
controlMsg</H3>
|
603 |
|
|
<PRE>
|
604 |
|
|
public int <B>controlMsg</B>(int requestType,
|
605 |
|
|
int request,
|
606 |
|
|
int value,
|
607 |
|
|
int index,
|
608 |
|
|
byte[] data,
|
609 |
|
|
int size,
|
610 |
|
|
int timeout,
|
611 |
|
|
boolean reopenOnTimeout)
|
612 |
|
|
throws <A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></PRE>
|
613 |
|
|
<DL>
|
614 |
|
|
<DD>Performs a control request to the default control pipe on a device.<br>
|
615 |
|
|
The parameters mirror the types of the same name in the USB
|
616 |
|
|
specification.
|
617 |
|
|
<P>
|
618 |
|
|
<DD><DL>
|
619 |
|
|
<DT><B>Parameters:</B><DD><CODE>requestType</CODE> - USB device request type (USB specification 9.3,
|
620 |
|
|
bmRequestType). Use constants from <A HREF="../../../ch/ntb/usb/USB.html" title="class in ch.ntb.usb"><CODE>USB</CODE></A>
|
621 |
|
|
(REQ_TYPE_xxx).<DD><CODE>request</CODE> - specific request (USB specification 9.4, bRequest). Use
|
622 |
|
|
constants from <A HREF="../../../ch/ntb/usb/USB.html" title="class in ch.ntb.usb"><CODE>USB</CODE></A> (REQ_xxx).<DD><CODE>value</CODE> - field that varies according to request (USB specification 9.4,
|
623 |
|
|
wValue)<DD><CODE>index</CODE> - field that varies according to request (USB specification 9.4,
|
624 |
|
|
wIndex)<DD><CODE>data</CODE> - the send/receive buffer<DD><CODE>size</CODE> - the buffer size. 0 is a valid value, but there must still be a
|
625 |
|
|
dummy data buffer provided.<DD><CODE>timeout</CODE> - amount of time in ms the device will try to send/receive data
|
626 |
|
|
until a timeout exception is thrown<DD><CODE>reopenOnTimeout</CODE> - if set to true, the device will try to open the connection and
|
627 |
|
|
send/receive the data again before a timeout exception is
|
628 |
|
|
thrown
|
629 |
|
|
<DT><B>Returns:</B><DD>the number of bytes written/read
|
630 |
|
|
<DT><B>Throws:</B>
|
631 |
|
|
<DD><CODE><A HREF="../../../ch/ntb/usb/USBException.html" title="class in ch.ntb.usb">USBException</A></CODE></DL>
|
632 |
|
|
</DD>
|
633 |
|
|
</DL>
|
634 |
|
|
<HR>
|
635 |
|
|
|
636 |
|
|
<A NAME="getIdProduct()"><!-- --></A><H3>
|
637 |
|
|
getIdProduct</H3>
|
638 |
|
|
<PRE>
|
639 |
|
|
public int <B>getIdProduct</B>()</PRE>
|
640 |
|
|
<DL>
|
641 |
|
|
<DD>Returns the product ID of the device.<br>
|
642 |
|
|
<P>
|
643 |
|
|
<DD><DL>
|
644 |
|
|
|
645 |
|
|
<DT><B>Returns:</B><DD>the product ID of the device.</DL>
|
646 |
|
|
</DD>
|
647 |
|
|
</DL>
|
648 |
|
|
<HR>
|
649 |
|
|
|
650 |
|
|
<A NAME="getIdVendor()"><!-- --></A><H3>
|
651 |
|
|
getIdVendor</H3>
|
652 |
|
|
<PRE>
|
653 |
|
|
public int <B>getIdVendor</B>()</PRE>
|
654 |
|
|
<DL>
|
655 |
|
|
<DD>Returns the vendor ID of the device.<br>
|
656 |
|
|
<P>
|
657 |
|
|
<DD><DL>
|
658 |
|
|
|
659 |
|
|
<DT><B>Returns:</B><DD>the vendor ID of the device.</DL>
|
660 |
|
|
</DD>
|
661 |
|
|
</DL>
|
662 |
|
|
<HR>
|
663 |
|
|
|
664 |
|
|
<A NAME="getAltinterface()"><!-- --></A><H3>
|
665 |
|
|
getAltinterface</H3>
|
666 |
|
|
<PRE>
|
667 |
|
|
public int <B>getAltinterface</B>()</PRE>
|
668 |
|
|
<DL>
|
669 |
|
|
<DD>Returns the alternative interface.<br>
|
670 |
|
|
This value is only valid after opening the device.
|
671 |
|
|
<P>
|
672 |
|
|
<DD><DL>
|
673 |
|
|
|
674 |
|
|
<DT><B>Returns:</B><DD>the alternative interface. This value is only valid after opening
|
675 |
|
|
the device.</DL>
|
676 |
|
|
</DD>
|
677 |
|
|
</DL>
|
678 |
|
|
<HR>
|
679 |
|
|
|
680 |
|
|
<A NAME="getConfiguration()"><!-- --></A><H3>
|
681 |
|
|
getConfiguration</H3>
|
682 |
|
|
<PRE>
|
683 |
|
|
public int <B>getConfiguration</B>()</PRE>
|
684 |
|
|
<DL>
|
685 |
|
|
<DD>Returns the current configuration used.<br>
|
686 |
|
|
This value is only valid after opening the device.
|
687 |
|
|
<P>
|
688 |
|
|
<DD><DL>
|
689 |
|
|
|
690 |
|
|
<DT><B>Returns:</B><DD>the current configuration used. This value is only valid after
|
691 |
|
|
opening the device.</DL>
|
692 |
|
|
</DD>
|
693 |
|
|
</DL>
|
694 |
|
|
<HR>
|
695 |
|
|
|
696 |
|
|
<A NAME="getInterface()"><!-- --></A><H3>
|
697 |
|
|
getInterface</H3>
|
698 |
|
|
<PRE>
|
699 |
|
|
public int <B>getInterface</B>()</PRE>
|
700 |
|
|
<DL>
|
701 |
|
|
<DD>Returns the current interface.<br>
|
702 |
|
|
This value is only valid after opening the device.
|
703 |
|
|
<P>
|
704 |
|
|
<DD><DL>
|
705 |
|
|
|
706 |
|
|
<DT><B>Returns:</B><DD>the current interface. This value is only valid after opening the
|
707 |
|
|
device.</DL>
|
708 |
|
|
</DD>
|
709 |
|
|
</DL>
|
710 |
|
|
<HR>
|
711 |
|
|
|
712 |
|
|
<A NAME="getMaxPacketSize()"><!-- --></A><H3>
|
713 |
|
|
getMaxPacketSize</H3>
|
714 |
|
|
<PRE>
|
715 |
|
|
public int <B>getMaxPacketSize</B>()</PRE>
|
716 |
|
|
<DL>
|
717 |
|
|
<DD>Returns the maximum packet size in bytes which is allowed to be
|
718 |
|
|
transmitted at once.<br>
|
719 |
|
|
The value is determined by reading the endpoint descriptor(s) when
|
720 |
|
|
opening the device. It is invalid before the device is opened! Note that
|
721 |
|
|
if some endpoints use different packet sizes the maximum packet size is
|
722 |
|
|
return. This value may be used to determine if a device is opened in
|
723 |
|
|
fullspeed or highspeed mode.
|
724 |
|
|
<P>
|
725 |
|
|
<DD><DL>
|
726 |
|
|
|
727 |
|
|
<DT><B>Returns:</B><DD>the maximum packet size</DL>
|
728 |
|
|
</DD>
|
729 |
|
|
</DL>
|
730 |
|
|
<HR>
|
731 |
|
|
|
732 |
|
|
<A NAME="isOpen()"><!-- --></A><H3>
|
733 |
|
|
isOpen</H3>
|
734 |
|
|
<PRE>
|
735 |
|
|
public boolean <B>isOpen</B>()</PRE>
|
736 |
|
|
<DL>
|
737 |
|
|
<DD>Check if the device is open.<br>
|
738 |
|
|
This checks only for a valid device handle. It doesn't check if the
|
739 |
|
|
device is still attached or working.
|
740 |
|
|
<P>
|
741 |
|
|
<DD><DL>
|
742 |
|
|
|
743 |
|
|
<DT><B>Returns:</B><DD>true if the device is open</DL>
|
744 |
|
|
</DD>
|
745 |
|
|
</DL>
|
746 |
|
|
<HR>
|
747 |
|
|
|
748 |
|
|
<A NAME="setResetOnFirstOpen(boolean, int)"><!-- --></A><H3>
|
749 |
|
|
setResetOnFirstOpen</H3>
|
750 |
|
|
<PRE>
|
751 |
|
|
public void <B>setResetOnFirstOpen</B>(boolean enable,
|
752 |
|
|
int timeout)</PRE>
|
753 |
|
|
<DL>
|
754 |
|
|
<DD>If enabled, the device is reset when first opened. <br>
|
755 |
|
|
This will only happen once. When the application is started, the device
|
756 |
|
|
state is unknown. If the device is not reset, read or write may result in
|
757 |
|
|
a <A HREF="../../../ch/ntb/usb/USBTimeoutException.html" title="class in ch.ntb.usb"><CODE>USBTimeoutException</CODE></A>.<br>
|
758 |
|
|
<br>
|
759 |
|
|
This feature is disabled by default.
|
760 |
|
|
<P>
|
761 |
|
|
<DD><DL>
|
762 |
|
|
<DT><B>Parameters:</B><DD><CODE>enable</CODE> - true if the device should be reset when first opened<DD><CODE>timeout</CODE> - the timeout between the reset and the reopening</DL>
|
763 |
|
|
</DD>
|
764 |
|
|
</DL>
|
765 |
|
|
<HR>
|
766 |
|
|
|
767 |
|
|
<A NAME="getFilename()"><!-- --></A><H3>
|
768 |
|
|
getFilename</H3>
|
769 |
|
|
<PRE>
|
770 |
|
|
protected java.lang.String <B>getFilename</B>()</PRE>
|
771 |
|
|
<DL>
|
772 |
|
|
<DD>Returns the optional filename which is set when there are multiple
|
773 |
|
|
devices with the same vendor and product id. See
|
774 |
|
|
<A HREF="../../../ch/ntb/usb/USB.html#getDevice(short, short, java.lang.String)"><CODE>USB.getDevice(short, short, String)</CODE></A>. Use
|
775 |
|
|
<A HREF="../../../ch/ntb/usb/Usb_Device.html#getFilename()"><CODE>Usb_Device.getFilename()</CODE></A> to read the filename of a device.
|
776 |
|
|
<P>
|
777 |
|
|
<DD><DL>
|
778 |
|
|
|
779 |
|
|
<DT><B>Returns:</B><DD>the filename if set or null</DL>
|
780 |
|
|
</DD>
|
781 |
|
|
</DL>
|
782 |
|
|
<HR>
|
783 |
|
|
|
784 |
|
|
<A NAME="getDevice()"><!-- --></A><H3>
|
785 |
|
|
getDevice</H3>
|
786 |
|
|
<PRE>
|
787 |
|
|
public <A HREF="../../../ch/ntb/usb/Usb_Device.html" title="class in ch.ntb.usb">Usb_Device</A> <B>getDevice</B>()</PRE>
|
788 |
|
|
<DL>
|
789 |
|
|
<DD>Returns the Usb_Device instance associated with this device. This value
|
790 |
|
|
is only valid after opening the device.
|
791 |
|
|
<P>
|
792 |
|
|
<DD><DL>
|
793 |
|
|
|
794 |
|
|
<DT><B>Returns:</B><DD>the Usb_Device instance associated with this device.</DL>
|
795 |
|
|
</DD>
|
796 |
|
|
</DL>
|
797 |
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
798 |
|
|
<HR>
|
799 |
|
|
|
800 |
|
|
|
801 |
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
802 |
|
|
<A NAME="navbar_bottom"><!-- --></A>
|
803 |
|
|
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
804 |
|
|
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
805 |
|
|
<TR>
|
806 |
|
|
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
807 |
|
|
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
808 |
|
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
809 |
|
|
<TR ALIGN="center" VALIGN="top">
|
810 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
811 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
812 |
|
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
813 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
814 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
815 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
816 |
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
817 |
|
|
</TR>
|
818 |
|
|
</TABLE>
|
819 |
|
|
</TD>
|
820 |
|
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
821 |
|
|
</EM>
|
822 |
|
|
</TD>
|
823 |
|
|
</TR>
|
824 |
|
|
|
825 |
|
|
<TR>
|
826 |
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
827 |
|
|
PREV CLASS
|
828 |
|
|
<A HREF="../../../ch/ntb/usb/LibLoader.html" title="class in ch.ntb.usb"><B>NEXT CLASS</B></A></FONT></TD>
|
829 |
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
830 |
|
|
<A HREF="../../../index.html?ch/ntb/usb/Device.html" target="_top"><B>FRAMES</B></A>
|
831 |
|
|
<A HREF="Device.html" target="_top"><B>NO FRAMES</B></A>
|
832 |
|
|
<SCRIPT type="text/javascript">
|
833 |
|
|
<!--
|
834 |
|
|
if(window==top) {
|
835 |
|
|
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
836 |
|
|
}
|
837 |
|
|
//-->
|
838 |
|
|
</SCRIPT>
|
839 |
|
|
<NOSCRIPT>
|
840 |
|
|
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
841 |
|
|
</NOSCRIPT>
|
842 |
|
|
|
843 |
|
|
|
844 |
|
|
</FONT></TD>
|
845 |
|
|
</TR>
|
846 |
|
|
<TR>
|
847 |
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
848 |
|
|
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
849 |
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
850 |
|
|
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
851 |
|
|
</TR>
|
852 |
|
|
</TABLE>
|
853 |
|
|
<A NAME="skip-navbar_bottom"></A>
|
854 |
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
855 |
|
|
|
856 |
|
|
<HR>
|
857 |
|
|
|
858 |
|
|
</BODY>
|
859 |
|
|
</HTML>
|