Package jmri.jmrix.purejavacomm
Class SerialPortEvent
- java.lang.Object
-
- java.util.EventObject
-
- jmri.jmrix.purejavacomm.SerialPortEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class SerialPortEvent extends java.util.EventObject
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intBIBreak interrupt.static intCDCarrier detect.static intCTSClear to send.static intDATA_AVAILABLEData available at the serial port.static intDSRData set ready.static intFEFraming error.static intOEOverrun error.static intOUTPUT_BUFFER_EMPTYOutput buffer is empty.static intPEParity error.static intRIRing indicator.
-
Constructor Summary
Constructors Constructor Description SerialPortEvent(SerialPort source, int eventType, boolean oldValue, boolean newValue)Constructs aSerialPortEventwith the specified serial port, event type, old and new values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetEventType()Returns the type of this event.booleangetNewValue()Returns the new value of the state change that caused theSerialPortEventto be propagated.booleangetOldValue()Returns the old value of the state change that caused theSerialPortEventto be propagated.
-
-
-
Field Detail
-
DATA_AVAILABLE
public static final int DATA_AVAILABLE
Data available at the serial port.- See Also:
- Constant Field Values
-
OUTPUT_BUFFER_EMPTY
public static final int OUTPUT_BUFFER_EMPTY
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(SerialPort source, int eventType, boolean oldValue, boolean newValue)
Constructs aSerialPortEventwith the specified serial port, event type, old and new values. Application programs should not directly createSerialPortEventobjects.- Parameters:
source- the sourceeventType- the event typeoldValue- the old valuenewValue- the new value
-
-
Method Detail
-
getEventType
public int getEventType()
Returns the type of this event.- Returns:
- The type of this event.
-
getNewValue
public boolean getNewValue()
Returns the new value of the state change that caused theSerialPortEventto be propagated.- Returns:
- The new value of the state change.
-
getOldValue
public boolean getOldValue()
Returns the old value of the state change that caused theSerialPortEventto be propagated.- Returns:
- The old value of the state change.
-
-