comm
Class SerialPortEvent

java.lang.Object
  extended by java.util.EventObject
      extended by comm.SerialPortEvent
All Implemented Interfaces:
java.io.Serializable

public class SerialPortEvent
extends java.util.EventObject

An event on a serial port.

Version:
2.0.3
Author:
Chris Burdess
See Also:
Serialized Form

Field Summary
static int BI
          Break interrupt.
static int CD
          Carrier detect.
static int CTS
          Clear to send.
static int DATA_AVAILABLE
          Data is available at the serial port.
static int DSR
          Data set ready.
 int eventType
          Deprecated. Replaced by getEventType method. For compatibility only.
static int FE
          Framing error.
static int OE
          Overrun error.
static int OUTPUT_BUFFER_EMPTY
          The output buffer is empty.
static int PE
          Parity error.
static int RI
          Ring indicator.
 
Constructor Summary
SerialPortEvent(SerialPortInterface srcport, int eventtype, boolean oldvalue, boolean newvalue)
          Constructor.
 
Method Summary
 int getEventType()
          Returns the type of event, one of: BI, CD, CTS, DATA_AVAILABLE, DSR, FE, OE, OUTPUT_BUFFER_EMPTY, PE or RI.
 boolean getNewValue()
          Returns the new value of the state change that caused this event.
 boolean getOldValue()
          Returns the old value of the state change that caused this event.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

eventType

public int eventType
Deprecated. Replaced by getEventType method. For compatibility only.

DATA_AVAILABLE

public static final int DATA_AVAILABLE
Data is available at the serial port.

See Also:
Constant Field Values

OUTPUT_BUFFER_EMPTY

public static final int OUTPUT_BUFFER_EMPTY
The output buffer is empty.

See Also:
Constant Field Values

CTS

public static final int CTS
Clear to send.

See Also:
Constant Field Values

DSR

public static final int DSR
Data set ready.

See Also:
Constant Field Values

RI

public static final int RI
Ring indicator.

See Also:
Constant Field Values

CD

public static final int CD
Carrier detect.

See Also:
Constant Field Values

OE

public static final int OE
Overrun error.

See Also:
Constant Field Values

PE

public static final int PE
Parity error.

See Also:
Constant Field Values

FE

public static final int FE
Framing error.

See Also:
Constant Field Values

BI

public static final int BI
Break interrupt.

See Also:
Constant Field Values
Constructor Detail

SerialPortEvent

public SerialPortEvent(SerialPortInterface srcport,
                       int eventtype,
                       boolean oldvalue,
                       boolean newvalue)
Constructor. This should only be called by the port driver.

Parameters:
srcport - the source port
eventtype - the event type, one of: BI, CD, CTS, DATA_AVAILABLE, DSR, FE, OE, OUTPUT_BUFFER_EMPTY, PE or RI.
oldvalue - the old value
newvalue - the new value
Method Detail

getEventType

public int getEventType()
Returns the type of event, one of: BI, CD, CTS, DATA_AVAILABLE, DSR, FE, OE, OUTPUT_BUFFER_EMPTY, PE or RI.

Since:
CommAPI 1.1

getNewValue

public boolean getNewValue()
Returns the new value of the state change that caused this event.


getOldValue

public boolean getOldValue()
Returns the old value of the state change that caused this event.