These changes both simplify the Java code and improve performance across the
JNI boundary.
This also fixes the AnalogCrossConnectTest by adding delays to
setInterruptHigh() and setInterruptLow() to ensure the change in voltage has
time to propagate and extends the timeouts in AbstractInterruptTest.
Detailed changes:
Hoisted status checks to C. This avoids the need to create direct byte
buffers (expensive) and significantly simplifies the Java code. The C code
now directly generates the exception or reports the error to the DS.
The JVM pointer is now a global across the JNI, initialized by the OnLoad
function, avoiding the need for some of the class-specific initializers to
get this pointer for callbacks.
Opaque pointers (such as ports) are now passed as long values rather than
with a ByteBuffer wrapper.
Added extern "C" to source files. This allows earlier detection of JNI
definition mismatches to the Java source headers.
Changed JNI signatures to more closely match HAL signatures (in particular,
boolean is now universally used instead of byte for HAL bool, which cleans
up mapping back and forth to 1/0 from true/false).
Change-Id: I4ea0032cabb0871cd74106a3a70d947258c29d2d
The HAL functions often call NI functions that may expect status to be
initialized on entry. Java does not guarantee direct pointer allocation
memory to be initialized, although that may have been occurring by accident.
Change-Id: I5e3a553f3a7be8de3716ccfc13e6ca1cb4f2a552
Implements the JNI bindings for java
Adds integration tests for Digital Inputs and AnalogTriggers.
Adds the ability to get the value and message from errno in java using the HALUtil JNI class.
Change-Id: I853529fdab9744ce95ee15d4cc73dc3953265552
This is the changes made by Patrick Plenefisch converting the native
code to use CMake and the CMake Maven Plugin, as opposed to the
native Maven plugin. This is to allow for compatibility with newer
versions of the GCC toolchain. All the cpp sources were moved from
maven style directories to cpp style directories for CMake.
Change-Id: I67f5e3608948f37c83b0990d232105a3784f8593