    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class javax.comm.SerialPortEvent

    java.lang.Object
       |
       +----java.util.EventObject
               |
               +----javax.comm.SerialPortEvent

public class SerialPortEvent
extends EventObject

A serial port event.

See Also:
  SerialPort, SeriallPortEventListener, EventObject

##

BI
  Break interrupt.
CD
  Carrier detect.
CTS
  Clear to send.
DATA_AVAILABLE
  Data available at the serial port.
DSR
  Data set ready.
eventType
  The type of event. Deprecated.
FE
  Framing error.
OE
  Overrun error.
OUTPUT_BUFFER_EMPTY
  Output buffer is empty.
PE
  Parity error.
RI
  Ring indicator.

##

SerialPortEvent(SerialPort, int, boolean, boolean)
  Constructs a `SerialPortEvent` with the specified serial port, event type, old and new values.

##

getEventType()
  Gets the type of this event.
getNewValue()
  Gets the new value of the state change that caused the `SerialPortEvent` to be propagated.
getOldValue()
  Gets the old value of the state change that caused the `SerialPortEvent` to be propagated.

##

eventType

     public int eventType

  Note: eventType is deprecated. Replaced by `getEventType` method.

  The type of event.

DATA_AVAILABLE

     public static final int DATA_AVAILABLE

  Data available at the serial port. This event will be generated once when new data arrive at the serial port. Even if the user doesn't read the data, it won't be generated again until next time new data arrive.

OUTPUT_BUFFER_EMPTY

     public static final int OUTPUT_BUFFER_EMPTY

  Output buffer is empty. The event will be generated after a write is completed, when the system buffer becomes empty again.

CTS

     public static final int CTS

  Clear to send.

DSR

     public static final int DSR

  Data set ready.

RI

     public static final int RI

  Ring indicator.

CD

     public static final int CD

  Carrier detect.

OE

     public static final int OE

  Overrun error.

PE

     public static final int PE

  Parity error.

FE

     public static final int FE

  Framing error.

BI

     public static final int BI

  Break interrupt.

##

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

##

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`.

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.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index