From 12d9f735fe5a3bf2a0b8c136688301e79efbac60 Mon Sep 17 00:00:00 2001 From: hedgecrw85 Date: Fri, 20 Jul 2018 17:41:55 -0500 Subject: [PATCH] Test for HF link loader as additional fp architecture test --- src/main/java/com/fazecast/jSerialComm/SerialPort.java | 7 ++++--- .../com/fazecast/jSerialComm/SerialPortDataListener.java | 2 +- .../java/com/fazecast/jSerialComm/SerialPortEvent.java | 2 +- .../com/fazecast/jSerialComm/SerialPortPacketListener.java | 2 +- src/test/java/com/fazecast/jSerialComm/SerialPortTest.java | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/fazecast/jSerialComm/SerialPort.java b/src/main/java/com/fazecast/jSerialComm/SerialPort.java index fadc14d..fb8ed4c 100644 --- a/src/main/java/com/fazecast/jSerialComm/SerialPort.java +++ b/src/main/java/com/fazecast/jSerialComm/SerialPort.java @@ -2,7 +2,7 @@ * SerialPort.java * * Created on: Feb 25, 2012 - * Last Updated on: Apr 03, 2018 + * Last Updated on: Jul 20, 2018 * Author: Will Hedgecock * * Copyright (C) 2012-2018 Fazecast, Inc. @@ -42,7 +42,7 @@ import java.util.Date; * This class provides native access to serial ports and devices without requiring external libraries or tools. * * @author Will Hedgecock <will.hedgecock@fazecast.com> - * @version 2.0.2 + * @version 2.0.3 * @see java.io.InputStream * @see java.io.OutputStream */ @@ -152,12 +152,13 @@ public final class SerialPort { try { + File linkerFile = new File("/lib/ld-linux-armhf.so.3"); ProcessBuilder pb = new ProcessBuilder("/bin/sh", "-c", "ldd /usr/bin/ld | grep ld-"); Process p = pb.start(); p.waitFor(); BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); String linkLoader = br.readLine(); - if (linkLoader.contains("armhf")) + if (linkerFile.exists() || linkLoader.contains("armhf")) libraryPath += "-hf"; } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/com/fazecast/jSerialComm/SerialPortDataListener.java b/src/main/java/com/fazecast/jSerialComm/SerialPortDataListener.java index ce96328..448ab9f 100644 --- a/src/main/java/com/fazecast/jSerialComm/SerialPortDataListener.java +++ b/src/main/java/com/fazecast/jSerialComm/SerialPortDataListener.java @@ -31,7 +31,7 @@ import java.util.EventListener; * This interface must be implemented to enable simple event-based serial port I/O. * * @author Will Hedgecock <will.hedgecock@fazecast.com> - * @version 2.0.2 + * @version 2.0.3 * @see java.util.EventListener */ public interface SerialPortDataListener extends EventListener diff --git a/src/main/java/com/fazecast/jSerialComm/SerialPortEvent.java b/src/main/java/com/fazecast/jSerialComm/SerialPortEvent.java index 3518176..859f3ef 100644 --- a/src/main/java/com/fazecast/jSerialComm/SerialPortEvent.java +++ b/src/main/java/com/fazecast/jSerialComm/SerialPortEvent.java @@ -31,7 +31,7 @@ import java.util.EventObject; * This class describes an asynchronous serial port event. * * @author Will Hedgecock <will.hedgecock@fazecast.com> - * @version 2.0.2 + * @version 2.0.3 * @see java.util.EventObject */ public final class SerialPortEvent extends EventObject diff --git a/src/main/java/com/fazecast/jSerialComm/SerialPortPacketListener.java b/src/main/java/com/fazecast/jSerialComm/SerialPortPacketListener.java index 6bed11b..1d60e0d 100644 --- a/src/main/java/com/fazecast/jSerialComm/SerialPortPacketListener.java +++ b/src/main/java/com/fazecast/jSerialComm/SerialPortPacketListener.java @@ -31,7 +31,7 @@ package com.fazecast.jSerialComm; * Note: Using this interface will negate any serial port read timeout settings since they make no sense in an asynchronous context. * * @author Will Hedgecock <will.hedgecock@fazecast.com> - * @version 2.0.2 + * @version 2.0.3 * @see com.fazecast.jSerialComm.SerialPortDataListener * @see java.util.EventListener */ diff --git a/src/test/java/com/fazecast/jSerialComm/SerialPortTest.java b/src/test/java/com/fazecast/jSerialComm/SerialPortTest.java index 7298117..aa7344f 100644 --- a/src/test/java/com/fazecast/jSerialComm/SerialPortTest.java +++ b/src/test/java/com/fazecast/jSerialComm/SerialPortTest.java @@ -32,7 +32,7 @@ import java.util.Scanner; * This class provides a test case for the jSerialComm library. * * @author Will Hedgecock <will.hedgecock@gmail.com> - * @version 2.0.0 + * @version 2.0.3 * @see java.io.InputStream * @see java.io.OutputStream */