AIOUSB Java Class Library Reference

See:
          Description

Packages
com.acces.aiousb  

 

AIOUSB Java Class Library Reference

The AIOUSB Java Class Library is an object-oriented Java layer that runs on top of the AIOUSB library, utilizing the Java Native Interface (JNI) to enable other Java libraries and applications to control ACCES I/O USB products. All access to the USB devices is through fully object-oriented Java classes. The user never needs to call the underlying AIOUSB library. (In fact, it's not even possible to do so in Java, although it is possible in C++.)

This Java library currently supports all the features of all the USB products except the D/A streaming features of the USB-DA12-8A product. While the underlying AIOUSB library has been thoroughly tested, this Java library has not yet been thoroughly tested and should be considered beta software.

This reference documentation, while oriented toward the Java library, also applies to the C++ class library, which is nearly identical, with the same class names, method names, parameter lists and overall design. Unfortunately, some of the constant names are slightly different in C++ and Java. In the interest of reusing the constants already defined in the underlying AIOUSB library, the C++ class library simply inherits those constants. For obvious reasons, the Java code cannot reuse the C/C++ source files which declare those constants, so the Java code declares its own constants with names that seem more suitable to its object-oriented design. Refer to the AIOUSB API Reference for the exact names of the constants used in the C++ class library.

Packaging

For convenience, the entire AIOUSB Java class library is packaged into a JAR file. You may extract the classes from the JAR file, add your own classes to it or refer to the JAR file as a class path. For example, if you have a Java program named Test.java which uses the AIOUSB Java class library, you can compile it with the command:

javac -cp /path/aiousb.jar Test.java

After you have compiled it, producing Test.class, you can run the program with the command:

java -cp /path/aiousb.jar:. Test

Notice that multiple class paths are specified in the above command: the path to aiousb.jar and ".", which represents the class path of Test.class (assuming that it is the current directory).

JNI Shared Library

Between AIOUSB and this Java class library is a module named libjavaaiousb.so which contains the JNI interface. This interface module is a shared library that is loaded by the Java VM at run-time. Therefore, it must be located in a place where the operating system loader can find it. You can also modify the LD_LIBRARY_PATH environment variable to point to where libjavaaiousb.so resides.


Document: $Revision: 1.2 $ $Date: 2009/11/25 16:58:59 $