Fixed bug whereby Event-Based Reading hangs forever on Windows if there is no input from the serial port.

This commit is contained in:
hedgecrw85 2015-05-13 10:32:07 -05:00
parent de600d05c8
commit cb3b50196f
6 changed files with 17 additions and 12 deletions

14
INSTALL
View File

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

View File

@ -38,7 +38,7 @@ import java.util.Date;
* 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;
* @version 1.3.1
* @version 1.3.2
* @see java.io.InputStream
* @see java.io.OutputStream
*/
@ -792,8 +792,13 @@ public final class SerialPort
if (!isListening)
return;
isListening = false;
int oldEventFlags = eventFlags;
eventFlags = 0;
configEventFlags();
try { serialEventThread.join(); } catch (InterruptedException e) {}
serialEventThread = null;
eventFlags = oldEventFlags;
}
public final void waitForSerialEvent() throws NullPointerException

View File

@ -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 &lt;will.hedgecock@fazecast.com&gt;
* @version 1.1.1
* @version 1.3.2
* @see java.util.EventListener
*/
public interface SerialPortDataListener extends EventListener

View File

@ -31,7 +31,7 @@ import java.util.EventObject;
* This class describes an asynchronous serial port event.
*
* @author Will Hedgecock &lt;will.hedgecock@fazecast.com&gt;
* @version 1.1.1
* @version 1.3.2
* @see java.util.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.
*
* @author Will Hedgecock &lt;will.hedgecock@fazecast.com&gt;
* @version 1.1.1
* @version 1.3.2
* @see com.fazecast.jSerialComm.SerialPortDataListener
* @see java.util.EventListener
*/

View File

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