Allow use of pseudo-terminals on Linux.

This commit is contained in:
hedgecrw85 2015-05-18 21:39:31 -05:00
parent 97a8efcec3
commit 5741a2f827
6 changed files with 16 additions and 14 deletions

14
INSTALL
View File

@ -123,31 +123,31 @@ Maven:
<dependency> <dependency>
<groupId>com.fazecast</groupId> <groupId>com.fazecast</groupId>
<artifactId>jSerialComm</artifactId> <artifactId>jSerialComm</artifactId>
<version>1.3.2</version> <version>1.3.3</version>
</dependency> </dependency>
Ivy: Ivy:
<dependency org="com.fazecast" name="jSerialComm" rev="1.3.2"/> <dependency org="com.fazecast" name="jSerialComm" rev="1.3.3"/>
Grape: Grape:
@Grapes( @Grapes(
@Grab(group='com.fazecast', module='jSerialComm', version='1.3.2') @Grab(group='com.fazecast', module='jSerialComm', version='1.3.3')
) )
Gradle: Gradle:
'com.fazecast:jSerialComm:1.3.2' 'com.fazecast:jSerialComm:1.3.3'
Buildr: Buildr:
'com.fazecast:jSerialComm:jar:1.3.2' 'com.fazecast:jSerialComm:jar:1.3.3'
SBT: SBT:
libraryDependencies += "com.fazecast" % "jSerialComm" % "1.3.2" libraryDependencies += "com.fazecast" % "jSerialComm" % "1.3.3"
Leiningen: Leiningen:
[com.fazecast/jSerialComm "1.3.2"] [com.fazecast/jSerialComm "1.3.3"]

View File

@ -4,7 +4,7 @@ apply plugin: 'maven'
group = 'com.fazecast' group = 'com.fazecast'
archivesBaseName = 'jSerialComm' archivesBaseName = 'jSerialComm'
version = '1.3.2' version = '1.3.3'
sourceCompatibility = 1.6 sourceCompatibility = 1.6
targetCompatibility = 1.6 targetCompatibility = 1.6

View File

@ -2,7 +2,7 @@
* SerialPort.java * SerialPort.java
* *
* Created on: Feb 25, 2012 * Created on: Feb 25, 2012
* Last Updated on: May 04, 2015 * Last Updated on: May 18, 2015
* Author: Will Hedgecock * Author: Will Hedgecock
* *
* Copyright (C) 2012-2015 Fazecast, Inc. * Copyright (C) 2012-2015 Fazecast, Inc.
@ -38,7 +38,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 &lt;will.hedgecock@fazecast.com&gt; * @author Will Hedgecock &lt;will.hedgecock@fazecast.com&gt;
* @version 1.3.2 * @version 1.3.3
* @see java.io.InputStream * @see java.io.InputStream
* @see java.io.OutputStream * @see java.io.OutputStream
*/ */
@ -192,9 +192,11 @@ public final class SerialPort
*/ */
static public SerialPort getCommPort(String portDescriptor) static public SerialPort getCommPort(String portDescriptor)
{ {
// Correct Windows port descriptor, if needed // Correct port descriptor, if needed
if (isWindows) if (isWindows)
portDescriptor = "\\\\.\\" + portDescriptor.substring(portDescriptor.lastIndexOf('\\')+1); portDescriptor = "\\\\.\\" + portDescriptor.substring(portDescriptor.lastIndexOf('\\')+1);
else if (portDescriptor.contains("/pts/"))
portDescriptor = "/dev/pts/" + portDescriptor.substring(portDescriptor.lastIndexOf('/')+1);
else else
portDescriptor = "/dev/" + portDescriptor.substring(portDescriptor.lastIndexOf('/')+1); portDescriptor = "/dev/" + portDescriptor.substring(portDescriptor.lastIndexOf('/')+1);

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 &lt;will.hedgecock@fazecast.com&gt; * @author Will Hedgecock &lt;will.hedgecock@fazecast.com&gt;
* @version 1.3.2 * @version 1.3.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 &lt;will.hedgecock@fazecast.com&gt; * @author Will Hedgecock &lt;will.hedgecock@fazecast.com&gt;
* @version 1.3.2 * @version 1.3.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 1.3.2 * @version 1.3.3
* @see com.fazecast.jSerialComm.SerialPortDataListener * @see com.fazecast.jSerialComm.SerialPortDataListener
* @see java.util.EventListener * @see java.util.EventListener
*/ */