Implementation

Java libusb wrapper provides the necessary shared libraries and Java classes to access libusb/libusb-win32 trough the Java Native Interface. The class ch.ntb.usb.LibusbJava loads the shared library and provides the native interface to access libusb.

In libusb, the bus structure (with devices, configurations, interfaces and endpoints) is represented in C structs. For each struct, a Java object is created (named Usb_xxx) and the information is copied to this object. This is done when calling LibusbJava.usb_get_busses(). The information about busses and attached devices can now be obtained from a tree like Java Object structure.

It provides a simple Device class which represents a USB device and makes it easy to write to and read from it. Errors and Timeouts will result in Exceptions.

The Library is used in two projects at the University of Applied Sciences of Technology NTB (Programming and Debugging Interface (Cypress FX2) and Experimental Board (AVR AT90USB1287)) which are using bulk transfers. Interrupt transfers are working with a test device as well.