SMSLib 3.5.3

org.smslib.helper
Class SerialPortEvent

java.lang.Object
  extended by org.smslib.helper.SerialPortEvent

public class SerialPortEvent
extends java.lang.Object

A serial port event.

Please note: This is a wrapper around javax.comm.SerialPortEvent (and so gnu.io.SerialPortEvent). The API definition is taken from Sun. So honor them!

Author:
Jagane Sundar

Field Summary
static int BI
          Break interrupt.
static int CD
          Carrier detect.
static int CTS
          Clear to send.
static int DATA_AVAILABLE
          Data available at the serial port.
static int DSR
          Data set ready.
static int FE
          Framing error.
static int OE
          Overrun error.
static int OUTPUT_BUFFER_EMPTY
          Output buffer is empty.
static int PE
          Parity error.
static int RI
          Ring indicator.
 
Constructor Summary
SerialPortEvent(SerialPort srcport, int eventtype, boolean oldvalue, boolean newvalue)
          Constructs a SerialPortEvent with the specified serial port, event type, old and new values.
 
Method Summary
 int getEventType()
          Gets the type of this event.
 boolean getNewValue()
          Gets the new value of the state change that caused the SerialPortEvent to be propagated.
 boolean getOldValue()
          Gets the old value of the state change that caused the SerialPortEvent to be propagated.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BI

public static final int BI
Break interrupt.


CD

public static final int CD
Carrier detect.


CTS

public static final int CTS
Clear to send.


DATA_AVAILABLE

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


DSR

public static final int DSR
Data set ready.


FE

public static final int FE
Framing error.


OE

public static final int OE
Overrun error.


OUTPUT_BUFFER_EMPTY

public static final int OUTPUT_BUFFER_EMPTY
Output buffer is empty.


PE

public static final int PE
Parity error.


RI

public static final int RI
Ring indicator.

Constructor Detail

SerialPortEvent

public SerialPortEvent(SerialPort srcport,
                       int eventtype,
                       boolean oldvalue,
                       boolean newvalue)
Constructs a SerialPortEvent with the specified serial port, event type, old and new values. Application programs should not directly create SerialPortEvent objects.

Parameters:
srcport - source parallel port
eventtype - event type
oldvalue - old value
newvalue - new value
Method Detail

getEventType

public int getEventType()
Gets the type of this event.

Returns:
integer that can be equal to one of the following static variables: BI, CD, CTS, DATA_AVAILABLE, DSR, FE, OE, OUTPUT_BUFFER_EMPTY, PE or RI.
Since:
CommAPI 1.1

getNewValue

public boolean getNewValue()
Gets the new value of the state change that caused the SerialPortEvent to be propagated. For example, when the CD bit changes, newValue reflects the new value of the CD bit.


getOldValue

public boolean getOldValue()
Gets the old value of the state change that caused the SerialPortEvent to be propagated. For example, when the CD bit changes, oldValue reflects the old value of the CD bit.


SMSLib 3.5.3

(c) 2002-2011, http://smslib.org