URL
https://opencores.org/ocsvn/usb_fpga_1_2/usb_fpga_1_2/trunk
Subversion Repositories usb_fpga_1_2
[/] [usb_fpga_1_2/] [trunk/] [docs/] [java/] [ch/] [ntb/] [usb/] [LibusbJava.html] - Rev 5
Go to most recent revision | Compare with Previous | Blame | View Log
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_02) on Wed Sep 29 21:04:05 CEST 2010 --> <TITLE> LibusbJava </TITLE> <META NAME="date" CONTENT="2010-09-29"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="LibusbJava"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../ch/ntb/usb/LibLoader.html" title="class in ch.ntb.usb"><B>PREV CLASS</B></A> <A HREF="../../../ch/ntb/usb/USB.html" title="class in ch.ntb.usb"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?ch/ntb/usb/LibusbJava.html" target="_top"><B>FRAMES</B></A> <A HREF="LibusbJava.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> ch.ntb.usb</FONT> <BR> Class LibusbJava</H2> <PRE> java.lang.Object <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>ch.ntb.usb.LibusbJava</B> </PRE> <HR> <DL> <DT><PRE>public class <B>LibusbJava</B><DT>extends java.lang.Object</DL> </PRE> <P> This class represents the Java Native Interface to the shared library which is (with some exceptions) a one-to-one representation of the libusb API.<br> <br> <h1>Project Description</h1> Java libusb is a Java wrapper for the libusb and libusb-win32 USB library. <a href="http://libusb.sourceforge.net/">libusb</a> aim is to create a library for use by user level applications to access USB devices regardless of OS.<br> <a href="http://libusb-win32.sourceforge.net/">Libusb-win32</a> is a port of the USB library <a href="http://libusb.sourceforge.net/">libusb</a> to the Windows operating systems. The library allows user space applications to access any USB device on Windows in a generic way without writing any line of kernel driver code.<br> <br> The API description of this class has been copied from the <a href="http://libusb.sourceforge.net/documentation.html">libusb documentation</a> and adapted where neccessary.<br> <P> <P> <HR> <P> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#ERROR_BAD_FILE_DESCRIPTOR">ERROR_BAD_FILE_DESCRIPTOR</A></B></CODE> <BR> System error codes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#ERROR_BUSY">ERROR_BUSY</A></B></CODE> <BR> System error codes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#ERROR_INVALID_PARAMETER">ERROR_INVALID_PARAMETER</A></B></CODE> <BR> System error codes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#ERROR_IO_ERROR">ERROR_IO_ERROR</A></B></CODE> <BR> System error codes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#ERROR_NO_SUCH_DEVICE_OR_ADDRESS">ERROR_NO_SUCH_DEVICE_OR_ADDRESS</A></B></CODE> <BR> System error codes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#ERROR_NOT_ENOUGH_MEMORY">ERROR_NOT_ENOUGH_MEMORY</A></B></CODE> <BR> System error codes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#ERROR_SUCCESS">ERROR_SUCCESS</A></B></CODE> <BR> System error codes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#ERROR_TIMEDOUT">ERROR_TIMEDOUT</A></B></CODE> <BR> System error codes.</TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#LibusbJava()">LibusbJava</A></B>()</CODE> <BR> </TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_bulk_read(int, int, byte[], int, int)">usb_bulk_read</A></B>(int dev_handle, int ep, byte[] bytes, int size, int timeout)</CODE> <BR> Performs a bulk read request to the endpoint specified by ep.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_bulk_write(int, int, byte[], int, int)">usb_bulk_write</A></B>(int dev_handle, int ep, byte[] bytes, int size, int timeout)</CODE> <BR> Performs a bulk write request to the endpoint specified by ep.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_claim_interface(int, int)">usb_claim_interface</A></B>(int dev_handle, int interface_)</CODE> <BR> Claim an interface of a device.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_clear_halt(int, int)">usb_clear_halt</A></B>(int dev_handle, int ep)</CODE> <BR> Clears any halt status on an endpoint.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_close(int)">usb_close</A></B>(int dev_handle)</CODE> <BR> <code>usb_close</code> closes a device opened with <code>usb_open</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_control_msg(int, int, int, int, int, byte[], int, int)">usb_control_msg</A></B>(int dev_handle, int requesttype, int request, int value, int index, byte[] bytes, int size, int timeout)</CODE> <BR> Performs a control request to the default control pipe on a device.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_find_busses()">usb_find_busses</A></B>()</CODE> <BR> <code>usb_find_busses</code> will find all of the busses on the system.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_find_devices()">usb_find_devices</A></B>()</CODE> <BR> <code>usb_find_devices</code> will find all of the devices on each bus.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../ch/ntb/usb/Usb_Bus.html" title="class in ch.ntb.usb">Usb_Bus</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_get_busses()">usb_get_busses</A></B>()</CODE> <BR> <code>usb_get_busses</code> returns a tree of descriptor objects.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_get_descriptor_by_endpoint(int, int, byte, byte, int)">usb_get_descriptor_by_endpoint</A></B>(int dev_handle, int ep, byte type, byte index, int size)</CODE> <BR> Retrieves a descriptor from the device identified by the type and index of the descriptor from the control pipe identified by ep.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_get_descriptor(int, byte, byte, int)">usb_get_descriptor</A></B>(int dev_handle, byte type, byte index, int size)</CODE> <BR> Retrieves a descriptor from the device identified by the type and index of the descriptor from the default control pipe.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_get_string_simple(int, int)">usb_get_string_simple</A></B>(int dev_handle, int index)</CODE> <BR> <code>usb_get_string_simple</code> is a wrapper around <code>usb_get_string</code> that retrieves the string description specified by index in the first language for the descriptor.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_get_string(int, int, int)">usb_get_string</A></B>(int dev_handle, int index, int langid)</CODE> <BR> Retrieves the string descriptor specified by index and langid from a device.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_init()">usb_init</A></B>()</CODE> <BR> Just like the name implies, <code>usb_init</code> sets up some internal structures.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_interrupt_read(int, int, byte[], int, int)">usb_interrupt_read</A></B>(int dev_handle, int ep, byte[] bytes, int size, int timeout)</CODE> <BR> Performs a interrupt read request to the endpoint specified by ep.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_interrupt_write(int, int, byte[], int, int)">usb_interrupt_write</A></B>(int dev_handle, int ep, byte[] bytes, int size, int timeout)</CODE> <BR> Performs an interrupt write request to the endpoint specified by ep.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_open(ch.ntb.usb.Usb_Device)">usb_open</A></B>(<A HREF="../../../ch/ntb/usb/Usb_Device.html" title="class in ch.ntb.usb">Usb_Device</A> dev)</CODE> <BR> <code>usb_open</code> is to be used to open up a device for use.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_release_interface(int, int)">usb_release_interface</A></B>(int dev_handle, int interface_)</CODE> <BR> Releases a previously claimed interface</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_reset(int)">usb_reset</A></B>(int dev_handle)</CODE> <BR> Resets a device by sending a RESET down the port it is connected to.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_set_altinterface(int, int)">usb_set_altinterface</A></B>(int dev_handle, int alternate)</CODE> <BR> Sets the active alternate setting of the current interface</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_set_configuration(int, int)">usb_set_configuration</A></B>(int dev_handle, int configuration)</CODE> <BR> Sets the active configuration of a device</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_set_debug(int)">usb_set_debug</A></B>(int level)</CODE> <BR> Sets the debugging level of libusb.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_strerror()">usb_strerror</A></B>()</CODE> <BR> Returns the error string after an error occured.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Field Detail</B></FONT></TH> </TR> </TABLE> <A NAME="ERROR_SUCCESS"><!-- --></A><H3> ERROR_SUCCESS</H3> <PRE> public static int <B>ERROR_SUCCESS</B></PRE> <DL> <DD>System error codes.<br> This list is not complete! For more error codes see the file 'errorno.h' on your system. <P> <DL> </DL> </DL> <HR> <A NAME="ERROR_BAD_FILE_DESCRIPTOR"><!-- --></A><H3> ERROR_BAD_FILE_DESCRIPTOR</H3> <PRE> public static int <B>ERROR_BAD_FILE_DESCRIPTOR</B></PRE> <DL> <DD>System error codes.<br> This list is not complete! For more error codes see the file 'errorno.h' on your system. <P> <DL> </DL> </DL> <HR> <A NAME="ERROR_NO_SUCH_DEVICE_OR_ADDRESS"><!-- --></A><H3> ERROR_NO_SUCH_DEVICE_OR_ADDRESS</H3> <PRE> public static int <B>ERROR_NO_SUCH_DEVICE_OR_ADDRESS</B></PRE> <DL> <DD>System error codes.<br> This list is not complete! For more error codes see the file 'errorno.h' on your system. <P> <DL> </DL> </DL> <HR> <A NAME="ERROR_BUSY"><!-- --></A><H3> ERROR_BUSY</H3> <PRE> public static int <B>ERROR_BUSY</B></PRE> <DL> <DD>System error codes.<br> This list is not complete! For more error codes see the file 'errorno.h' on your system. <P> <DL> </DL> </DL> <HR> <A NAME="ERROR_INVALID_PARAMETER"><!-- --></A><H3> ERROR_INVALID_PARAMETER</H3> <PRE> public static int <B>ERROR_INVALID_PARAMETER</B></PRE> <DL> <DD>System error codes.<br> This list is not complete! For more error codes see the file 'errorno.h' on your system. <P> <DL> </DL> </DL> <HR> <A NAME="ERROR_TIMEDOUT"><!-- --></A><H3> ERROR_TIMEDOUT</H3> <PRE> public static int <B>ERROR_TIMEDOUT</B></PRE> <DL> <DD>System error codes.<br> This list is not complete! For more error codes see the file 'errorno.h' on your system. <P> <DL> </DL> </DL> <HR> <A NAME="ERROR_IO_ERROR"><!-- --></A><H3> ERROR_IO_ERROR</H3> <PRE> public static int <B>ERROR_IO_ERROR</B></PRE> <DL> <DD>System error codes.<br> This list is not complete! For more error codes see the file 'errorno.h' on your system. <P> <DL> </DL> </DL> <HR> <A NAME="ERROR_NOT_ENOUGH_MEMORY"><!-- --></A><H3> ERROR_NOT_ENOUGH_MEMORY</H3> <PRE> public static int <B>ERROR_NOT_ENOUGH_MEMORY</B></PRE> <DL> <DD>System error codes.<br> This list is not complete! For more error codes see the file 'errorno.h' on your system. <P> <DL> </DL> </DL> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="LibusbJava()"><!-- --></A><H3> LibusbJava</H3> <PRE> public <B>LibusbJava</B>()</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="usb_set_debug(int)"><!-- --></A><H3> usb_set_debug</H3> <PRE> public static void <B>usb_set_debug</B>(int level)</PRE> <DL> <DD>Sets the debugging level of libusb.<br> The range is from 0 to 255, where 0 disables debug output and 255 enables all output. On application start, debugging is disabled (0). <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>level</CODE> - 0 to 255</DL> </DD> </DL> <HR> <A NAME="usb_init()"><!-- --></A><H3> usb_init</H3> <PRE> public static void <B>usb_init</B>()</PRE> <DL> <DD>Just like the name implies, <code>usb_init</code> sets up some internal structures. <code>usb_init</code> must be called before any other libusb functions. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="usb_find_busses()"><!-- --></A><H3> usb_find_busses</H3> <PRE> public static int <B>usb_find_busses</B>()</PRE> <DL> <DD><code>usb_find_busses</code> will find all of the busses on the system. <P> <DD><DL> <DT><B>Returns:</B><DD>the number of changes since previous call to this function (total of new busses and busses removed).</DL> </DD> </DL> <HR> <A NAME="usb_find_devices()"><!-- --></A><H3> usb_find_devices</H3> <PRE> public static int <B>usb_find_devices</B>()</PRE> <DL> <DD><code>usb_find_devices</code> will find all of the devices on each bus. This should be called after <code>usb_find_busses</code>. <P> <DD><DL> <DT><B>Returns:</B><DD>the number of changes since the previous call to this function (total of new device and devices removed).</DL> </DD> </DL> <HR> <A NAME="usb_get_busses()"><!-- --></A><H3> usb_get_busses</H3> <PRE> public static <A HREF="../../../ch/ntb/usb/Usb_Bus.html" title="class in ch.ntb.usb">Usb_Bus</A> <B>usb_get_busses</B>()</PRE> <DL> <DD><code>usb_get_busses</code> returns a tree of descriptor objects.<br> The tree represents the bus structure with devices, configurations, interfaces and endpoints. Note that this is only a copy. To refresh the information, <code>usb_get_busses()</code> must be called again.<br> The name of the objects contained in the tree is starting with <code>Usb_</code>. <P> <DD><DL> <DT><B>Returns:</B><DD>the structure of all busses and devices. <code>Note:</code> The java objects are copies of the C structs.</DL> </DD> </DL> <HR> <A NAME="usb_open(ch.ntb.usb.Usb_Device)"><!-- --></A><H3> usb_open</H3> <PRE> public static int <B>usb_open</B>(<A HREF="../../../ch/ntb/usb/Usb_Device.html" title="class in ch.ntb.usb">Usb_Device</A> dev)</PRE> <DL> <DD><code>usb_open</code> is to be used to open up a device for use. <code>usb_open</code> must be called before attempting to perform any operations to the device. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev</CODE> - The device to open. <DT><B>Returns:</B><DD>a handle used in future communication with the device. 0 if an error has occurred.</DL> </DD> </DL> <HR> <A NAME="usb_close(int)"><!-- --></A><H3> usb_close</H3> <PRE> public static int <B>usb_close</B>(int dev_handle)</PRE> <DL> <DD><code>usb_close</code> closes a device opened with <code>usb_open</code>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device. <DT><B>Returns:</B><DD>0 on success or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_set_configuration(int, int)"><!-- --></A><H3> usb_set_configuration</H3> <PRE> public static int <B>usb_set_configuration</B>(int dev_handle, int configuration)</PRE> <DL> <DD>Sets the active configuration of a device <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>configuration</CODE> - The value as specified in the descriptor field bConfigurationValue. <DT><B>Returns:</B><DD>0 on success or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_set_altinterface(int, int)"><!-- --></A><H3> usb_set_altinterface</H3> <PRE> public static int <B>usb_set_altinterface</B>(int dev_handle, int alternate)</PRE> <DL> <DD>Sets the active alternate setting of the current interface <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>alternate</CODE> - The value as specified in the descriptor field bAlternateSetting. <DT><B>Returns:</B><DD>0 on success or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_clear_halt(int, int)"><!-- --></A><H3> usb_clear_halt</H3> <PRE> public static int <B>usb_clear_halt</B>(int dev_handle, int ep)</PRE> <DL> <DD>Clears any halt status on an endpoint. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>ep</CODE> - The value specified in the descriptor field bEndpointAddress. <DT><B>Returns:</B><DD>0 on success or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_reset(int)"><!-- --></A><H3> usb_reset</H3> <PRE> public static int <B>usb_reset</B>(int dev_handle)</PRE> <DL> <DD>Resets a device by sending a RESET down the port it is connected to.<br> <br> <b>Causes re-enumeration:</b> After calling <code>usb_reset</code>, the device will need to re-enumerate and thusly, requires you to find the new device and open a new handle. The handle used to call <code>usb_reset</code> will no longer work. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device. <DT><B>Returns:</B><DD>0 on success or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_claim_interface(int, int)"><!-- --></A><H3> usb_claim_interface</H3> <PRE> public static int <B>usb_claim_interface</B>(int dev_handle, int interface_)</PRE> <DL> <DD>Claim an interface of a device.<br> <br> <b>Must be called!:</b> <code>usb_claim_interface</code> must be called before you perform any operations related to this interface (like <code>usb_set_altinterface, usb_bulk_write</code>, etc). <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>interface_</CODE> - The value as specified in the descriptor field bInterfaceNumber. <DT><B>Returns:</B><DD>0 on success or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_release_interface(int, int)"><!-- --></A><H3> usb_release_interface</H3> <PRE> public static int <B>usb_release_interface</B>(int dev_handle, int interface_)</PRE> <DL> <DD>Releases a previously claimed interface <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>interface_</CODE> - The value as specified in the descriptor field bInterfaceNumber. <DT><B>Returns:</B><DD>0 on success or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_control_msg(int, int, int, int, int, byte[], int, int)"><!-- --></A><H3> usb_control_msg</H3> <PRE> public static int <B>usb_control_msg</B>(int dev_handle, int requesttype, int request, int value, int index, byte[] bytes, int size, int timeout)</PRE> <DL> <DD>Performs a control request to the default control pipe on a device. The parameters mirror the types of the same name in the USB specification. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>requesttype</CODE> - <DD><CODE>request</CODE> - <DD><CODE>value</CODE> - <DD><CODE>index</CODE> - <DD><CODE>bytes</CODE> - <DD><CODE>size</CODE> - <DD><CODE>timeout</CODE> - <DT><B>Returns:</B><DD>the number of bytes written/read or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_get_string(int, int, int)"><!-- --></A><H3> usb_get_string</H3> <PRE> public static java.lang.String <B>usb_get_string</B>(int dev_handle, int index, int langid)</PRE> <DL> <DD>Retrieves the string descriptor specified by index and langid from a device. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>index</CODE> - <DD><CODE>langid</CODE> - <DT><B>Returns:</B><DD>the descriptor String or null</DL> </DD> </DL> <HR> <A NAME="usb_get_string_simple(int, int)"><!-- --></A><H3> usb_get_string_simple</H3> <PRE> public static java.lang.String <B>usb_get_string_simple</B>(int dev_handle, int index)</PRE> <DL> <DD><code>usb_get_string_simple</code> is a wrapper around <code>usb_get_string</code> that retrieves the string description specified by index in the first language for the descriptor. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>index</CODE> - <DT><B>Returns:</B><DD>the descriptor String or null</DL> </DD> </DL> <HR> <A NAME="usb_get_descriptor(int, byte, byte, int)"><!-- --></A><H3> usb_get_descriptor</H3> <PRE> public static java.lang.String <B>usb_get_descriptor</B>(int dev_handle, byte type, byte index, int size)</PRE> <DL> <DD>Retrieves a descriptor from the device identified by the type and index of the descriptor from the default control pipe.<br> <br> See <A HREF="../../../ch/ntb/usb/LibusbJava.html#usb_get_descriptor_by_endpoint(int, int, byte, byte, int)"><CODE>usb_get_descriptor_by_endpoint(int, int, byte, byte, int)</CODE></A> for a function that allows the control endpoint to be specified. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>type</CODE> - <DD><CODE>index</CODE> - <DD><CODE>size</CODE> - number of charactes which will be retrieved (the length of the resulting String) <DT><B>Returns:</B><DD>the descriptor String or null</DL> </DD> </DL> <HR> <A NAME="usb_get_descriptor_by_endpoint(int, int, byte, byte, int)"><!-- --></A><H3> usb_get_descriptor_by_endpoint</H3> <PRE> public static java.lang.String <B>usb_get_descriptor_by_endpoint</B>(int dev_handle, int ep, byte type, byte index, int size)</PRE> <DL> <DD>Retrieves a descriptor from the device identified by the type and index of the descriptor from the control pipe identified by ep. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>ep</CODE> - <DD><CODE>type</CODE> - <DD><CODE>index</CODE> - <DD><CODE>size</CODE> - number of charactes which will be retrieved (the length of the resulting String) <DT><B>Returns:</B><DD>the descriptor String or null</DL> </DD> </DL> <HR> <A NAME="usb_bulk_write(int, int, byte[], int, int)"><!-- --></A><H3> usb_bulk_write</H3> <PRE> public static int <B>usb_bulk_write</B>(int dev_handle, int ep, byte[] bytes, int size, int timeout)</PRE> <DL> <DD>Performs a bulk write request to the endpoint specified by ep. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>ep</CODE> - <DD><CODE>bytes</CODE> - <DD><CODE>size</CODE> - <DD><CODE>timeout</CODE> - <DT><B>Returns:</B><DD>the number of bytes written on success or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_bulk_read(int, int, byte[], int, int)"><!-- --></A><H3> usb_bulk_read</H3> <PRE> public static int <B>usb_bulk_read</B>(int dev_handle, int ep, byte[] bytes, int size, int timeout)</PRE> <DL> <DD>Performs a bulk read request to the endpoint specified by ep. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>ep</CODE> - <DD><CODE>bytes</CODE> - <DD><CODE>size</CODE> - <DD><CODE>timeout</CODE> - <DT><B>Returns:</B><DD>the number of bytes read on success or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_interrupt_write(int, int, byte[], int, int)"><!-- --></A><H3> usb_interrupt_write</H3> <PRE> public static int <B>usb_interrupt_write</B>(int dev_handle, int ep, byte[] bytes, int size, int timeout)</PRE> <DL> <DD>Performs an interrupt write request to the endpoint specified by ep. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>ep</CODE> - <DD><CODE>bytes</CODE> - <DD><CODE>size</CODE> - <DD><CODE>timeout</CODE> - <DT><B>Returns:</B><DD>the number of bytes written on success or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_interrupt_read(int, int, byte[], int, int)"><!-- --></A><H3> usb_interrupt_read</H3> <PRE> public static int <B>usb_interrupt_read</B>(int dev_handle, int ep, byte[] bytes, int size, int timeout)</PRE> <DL> <DD>Performs a interrupt read request to the endpoint specified by ep. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>dev_handle</CODE> - The handle to the device.<DD><CODE>ep</CODE> - <DD><CODE>bytes</CODE> - <DD><CODE>size</CODE> - <DD><CODE>timeout</CODE> - <DT><B>Returns:</B><DD>the number of bytes read on success or < 0 on error.</DL> </DD> </DL> <HR> <A NAME="usb_strerror()"><!-- --></A><H3> usb_strerror</H3> <PRE> public static java.lang.String <B>usb_strerror</B>()</PRE> <DL> <DD>Returns the error string after an error occured. <P> <DD><DL> <DT><B>Returns:</B><DD>the last error sring.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../ch/ntb/usb/LibLoader.html" title="class in ch.ntb.usb"><B>PREV CLASS</B></A> <A HREF="../../../ch/ntb/usb/USB.html" title="class in ch.ntb.usb"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?ch/ntb/usb/LibusbJava.html" target="_top"><B>FRAMES</B></A> <A HREF="LibusbJava.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
Go to most recent revision | Compare with Previous | Blame | View Log