Test for HF link loader as additional fp architecture test

This commit is contained in:
hedgecrw85 2018-07-20 17:41:55 -05:00
parent e86d9122ac
commit 12d9f735fe
5 changed files with 8 additions and 7 deletions

View File

@ -2,7 +2,7 @@
* SerialPort.java * SerialPort.java
* *
* Created on: Feb 25, 2012 * Created on: Feb 25, 2012
* Last Updated on: Apr 03, 2018 * Last Updated on: Jul 20, 2018
* Author: Will Hedgecock * Author: Will Hedgecock
* *
* Copyright (C) 2012-2018 Fazecast, Inc. * 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. * This class provides native access to serial ports and devices without requiring external libraries or tools.
* *
* @author Will Hedgecock <will.hedgecock@fazecast.com> * @author Will Hedgecock <will.hedgecock@fazecast.com>
* @version 2.0.2 * @version 2.0.3
* @see java.io.InputStream * @see java.io.InputStream
* @see java.io.OutputStream * @see java.io.OutputStream
*/ */
@ -152,12 +152,13 @@ public final class SerialPort
{ {
try try
{ {
File linkerFile = new File("/lib/ld-linux-armhf.so.3");
ProcessBuilder pb = new ProcessBuilder("/bin/sh", "-c", "ldd /usr/bin/ld | grep ld-"); ProcessBuilder pb = new ProcessBuilder("/bin/sh", "-c", "ldd /usr/bin/ld | grep ld-");
Process p = pb.start(); Process p = pb.start();
p.waitFor(); p.waitFor();
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String linkLoader = br.readLine(); String linkLoader = br.readLine();
if (linkLoader.contains("armhf")) if (linkerFile.exists() || linkLoader.contains("armhf"))
libraryPath += "-hf"; libraryPath += "-hf";
} }
catch (Exception e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); }

View File

@ -31,7 +31,7 @@ import java.util.EventListener;
* This interface must be implemented to enable simple event-based serial port I/O. * This interface must be implemented to enable simple event-based serial port I/O.
* *
* @author Will Hedgecock <will.hedgecock@fazecast.com> * @author Will Hedgecock <will.hedgecock@fazecast.com>
* @version 2.0.2 * @version 2.0.3
* @see java.util.EventListener * @see java.util.EventListener
*/ */
public interface SerialPortDataListener extends EventListener public interface SerialPortDataListener extends EventListener

View File

@ -31,7 +31,7 @@ import java.util.EventObject;
* This class describes an asynchronous serial port event. * This class describes an asynchronous serial port event.
* *
* @author Will Hedgecock <will.hedgecock@fazecast.com> * @author Will Hedgecock <will.hedgecock@fazecast.com>
* @version 2.0.2 * @version 2.0.3
* @see java.util.EventObject * @see java.util.EventObject
*/ */
public final class SerialPortEvent extends EventObject public final class SerialPortEvent extends EventObject

View File

@ -31,7 +31,7 @@ package com.fazecast.jSerialComm;
* <i>Note</i>: Using this interface will negate any serial port read timeout settings since they make no sense in an asynchronous context. * <i>Note</i>: Using this interface will negate any serial port read timeout settings since they make no sense in an asynchronous context.
* *
* @author Will Hedgecock &lt;will.hedgecock@fazecast.com&gt; * @author Will Hedgecock &lt;will.hedgecock@fazecast.com&gt;
* @version 2.0.2 * @version 2.0.3
* @see com.fazecast.jSerialComm.SerialPortDataListener * @see com.fazecast.jSerialComm.SerialPortDataListener
* @see java.util.EventListener * @see java.util.EventListener
*/ */

View File

@ -32,7 +32,7 @@ import java.util.Scanner;
* This class provides a test case for the jSerialComm library. * This class provides a test case for the jSerialComm library.
* *
* @author Will Hedgecock &lt;will.hedgecock@gmail.com&gt; * @author Will Hedgecock &lt;will.hedgecock@gmail.com&gt;
* @version 2.0.0 * @version 2.0.3
* @see java.io.InputStream * @see java.io.InputStream
* @see java.io.OutputStream * @see java.io.OutputStream
*/ */