diff --git a/README.txt b/README.txt index c5fba559c7..0ef14ebe0d 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,32 @@ -jSSC-2.8.0 Release version (24.01.2014) +[VinceOPS] jSSC-2.8.0 - First Fork and Changes (28.01.2015) + +Essentially working on Linux (PC & ARM), this fork will contain small fixes/changes which match my projetcs requirements. + +In this build: + Fixes: + * DSR "off" event (DSR state 0) was not emitted using (PC) Ubuntu 13.10 and (ARM SF) Debian Wheezy. + * Using the current JVM "arm type" (Soft-Float / Hard-Float) to define which library (sf or hf) should be loaded. Indeed, on MULTIARCH systems (like Debian), it is possible to use a Soft-Float JVM whereas the rootfs is Hard-Float. Reading /proc/self/exe ELF format tells what is the rootfs "arm type", not the JVM (loading an ARMHF library with an ARMSF JVM obviously fails). + +Note: + How did I compile the .so libraries on my PC (x86_64) running on Ubuntu 13.10: + * PC (x86_64): g++ jssc.cpp -I//include -I//include/linux -shared -fPIC -o libjSSC-2.8_x86_64.so + * PC (x86), using g++-multilib: g++ jssc.cpp -I/usr/lib/jvm/jdk1.8.0_25/include -I/usr/lib/jvm/jdk1.8.0_25/include/linux -shared -fPIC -m32 -o libjSSC-2.8_x86.so + + * ARM (SF): arm-linux-gnueabi-g++ jssc.cpp -I//include -I//include/linux -shared -o libjSSC-2.8_armsf.so + * ARM (HF): arm-linux-gnueabihf-g++-4.8 jssc.cpp -I//include -I//include/linux -shared -fPIC -o libjSSC-2.8_armhf.so + + Any version of the ARM toolchain > 4.7 was fine. + Optimisation level 2 (-O2). + + + + + +============= Previous Builds ============== + +/////////////////////////////////////////// +//jSSC-2.8.0 Release version (24.01.2014)// +/////////////////////////////////////////// This version contains native libs for Windows(x86, x86-64), Linux(x86, x86-64, ARM soft & hard float), Solaris(x86, x86-64), Mac OS X(x86, x86-64, PPC, PPC64). All native libs contains in the jssc.jar file and you don't need manage native libs manually. @@ -15,8 +43,6 @@ In this build: With Best Regards, Sokolov Alexey aka scream3r. -============= Previous Builds ============== - /////////////////////////////////////////// //jSSC-2.6.0 Release version (01.06.2013)// /////////////////////////////////////////// diff --git a/src/cpp/_nix_based/jssc.cpp b/src/cpp/_nix_based/jssc.cpp index 634b620187..34e2644a70 100644 --- a/src/cpp/_nix_based/jssc.cpp +++ b/src/cpp/_nix_based/jssc.cpp @@ -654,7 +654,12 @@ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_sendBreak */ int getLinesStatus(jlong portHandle) { int statusLines; - ioctl(portHandle, TIOCMGET, &statusLines); + + if(ioctl(portHandle, TIOCMGET, &statusLines) != 0) { + // return 0 in case of failure, otherwise statusLines stays unchanged + return 0; + } + return statusLines; } diff --git a/src/java/jssc/SerialNativeInterface.java b/src/java/jssc/SerialNativeInterface.java index c5264f5e8a..60b2b848b7 100644 --- a/src/java/jssc/SerialNativeInterface.java +++ b/src/java/jssc/SerialNativeInterface.java @@ -122,7 +122,8 @@ else if(architecture.equals("arm")) {//since 2.1.0 } else { try { - Process readelfProcess = Runtime.getRuntime().exec("readelf -A /proc/self/exe"); + // get the ELF format of the JVM binary to know which library should be loaded (soft-float or hard-float) + Process readelfProcess = Runtime.getRuntime().exec("readelf -A " + System.getProperty("java.home") + "/bin/java"); BufferedReader reader = new BufferedReader(new InputStreamReader(readelfProcess.getInputStream())); String buffer = ""; while((buffer = reader.readLine()) != null && !buffer.isEmpty()){ diff --git a/src/java/libs/linux/libjSSC-2.8_armhf.so b/src/java/libs/linux/libjSSC-2.8_armhf.so old mode 100644 new mode 100755 index 3742fbe08f..39b0da6f0b Binary files a/src/java/libs/linux/libjSSC-2.8_armhf.so and b/src/java/libs/linux/libjSSC-2.8_armhf.so differ diff --git a/src/java/libs/linux/libjSSC-2.8_armsf.so b/src/java/libs/linux/libjSSC-2.8_armsf.so old mode 100644 new mode 100755 index 894ec80876..08e9226466 Binary files a/src/java/libs/linux/libjSSC-2.8_armsf.so and b/src/java/libs/linux/libjSSC-2.8_armsf.so differ diff --git a/src/java/libs/linux/libjSSC-2.8_x86.so b/src/java/libs/linux/libjSSC-2.8_x86.so old mode 100644 new mode 100755 index 8ea5d6e21e..c604e1000c Binary files a/src/java/libs/linux/libjSSC-2.8_x86.so and b/src/java/libs/linux/libjSSC-2.8_x86.so differ diff --git a/src/java/libs/linux/libjSSC-2.8_x86_64.so b/src/java/libs/linux/libjSSC-2.8_x86_64.so old mode 100644 new mode 100755 index 1108cb5f28..7aee00c3a0 Binary files a/src/java/libs/linux/libjSSC-2.8_x86_64.so and b/src/java/libs/linux/libjSSC-2.8_x86_64.so differ