1.0.0

javax.comm
Class SerialPort

java.lang.Object
  extended by javax.comm.CommPort
      extended by javax.comm.SerialPort
Direct Known Subclasses:
NSSerialPort

public abstract class SerialPort
extends CommPort

Version:
1.0.0

Field Summary
static int DATABITS_5
          Define the databits5 (int) constant.
static int DATABITS_6
          Define the databits6 (int) constant.
static int DATABITS_7
          Define the databits7 (int) constant.
static int DATABITS_8
          Define the databits8 (int) constant.
static int FLOWCONTROL_NONE
          Define the flowcontrol none (int) constant.
static int FLOWCONTROL_RTSCTS_IN
          Define the flowcontrol rtscts in (int) constant.
static int FLOWCONTROL_RTSCTS_OUT
          Define the flowcontrol rtscts out (int) constant.
static int FLOWCONTROL_XONXOFF_IN
          Define the flowcontrol xonxoff in (int) constant.
static int FLOWCONTROL_XONXOFF_OUT
          Define the flowcontrol xonxoff out (int) constant.
static int PARITY_EVEN
          Define the parity even (int) constant.
static int PARITY_MARK
          Define the parity mark (int) constant.
static int PARITY_NONE
          Define the parity none (int) constant.
static int PARITY_ODD
          Define the parity odd (int) constant.
static int PARITY_SPACE
          Define the parity space (int) constant.
static int STOPBITS_1
          Define the stopbits1 (int) constant.
static int STOPBITS_1_5
          Define the stopbits15 (int) constant.
static int STOPBITS_2
          Define the stopbits2 (int) constant.
 
Fields inherited from class javax.comm.CommPort
name
 
Constructor Summary
SerialPort()
          Constructs an instance of this class.
 
Method Summary
abstract  void addEventListener(SerialPortEventListener lsnr)
          Add event listener with the specified lsnr parameter.
abstract  int getBaudRate()
          Gets the baud rate (int) value.
abstract  int getDataBits()
          Gets the data bits (int) value.
abstract  int getFlowControlMode()
          Gets the flow control mode (int) value.
abstract  int getParity()
          Gets the parity (int) value.
abstract  int getStopBits()
          Gets the stop bits (int) value.
abstract  boolean isCD()
          Gets the cd (boolean) value.
abstract  boolean isCTS()
          Gets the cts (boolean) value.
abstract  boolean isDSR()
          Gets the dsr (boolean) value.
abstract  boolean isDTR()
          Gets the dtr (boolean) value.
abstract  boolean isRI()
          Gets the ri (boolean) value.
abstract  boolean isRTS()
          Gets the rts (boolean) value.
abstract  void notifyOnBreakInterrupt(boolean enable)
          Notify on break interrupt with the specified enable parameter.
abstract  void notifyOnCarrierDetect(boolean enable)
          Notify on carrier detect with the specified enable parameter.
abstract  void notifyOnCTS(boolean enable)
          Notify on cts with the specified enable parameter.
abstract  void notifyOnDataAvailable(boolean enable)
          Notify on data available with the specified enable parameter.
abstract  void notifyOnDSR(boolean enable)
          Notify on dsr with the specified enable parameter.
abstract  void notifyOnFramingError(boolean enable)
          Notify on framing error with the specified enable parameter.
abstract  void notifyOnOutputEmpty(boolean enable)
          Notify on output empty with the specified enable parameter.
abstract  void notifyOnOverrunError(boolean enable)
          Notify on overrun error with the specified enable parameter.
abstract  void notifyOnParityError(boolean enable)
          Notify on parity error with the specified enable parameter.
abstract  void notifyOnRingIndicator(boolean enable)
          Notify on ring indicator with the specified enable parameter.
abstract  void removeEventListener()
          Remove event listener.
abstract  void sendBreak(int millis)
          Send break with the specified millis parameter.
abstract  void setDTR(boolean dtr)
          Sets the dtr value.
abstract  void setFlowControlMode(int flowcontrol)
          Sets the flow control mode value.
 void setRcvFifoTrigger(int trigger)
          Sets the rcv fifo trigger value.
abstract  void setRTS(boolean rts)
          Sets the rts value.
abstract  void setSerialPortParams(int baudrate, int dataBits, int stopBits, int parity)
          Set serial port params with the specified baudrate, data bits, stop bits and parity parameters.
 
Methods inherited from class javax.comm.CommPort
close, disableReceiveFraming, disableReceiveThreshold, disableReceiveTimeout, enableReceiveFraming, enableReceiveThreshold, enableReceiveTimeout, getInputBufferSize, getInputStream, getName, getOutputBufferSize, getOutputStream, getReceiveFramingByte, getReceiveThreshold, getReceiveTimeout, isReceiveFramingEnabled, isReceiveThresholdEnabled, isReceiveTimeoutEnabled, setInputBufferSize, setOutputBufferSize, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATABITS_5

public static final int DATABITS_5
Define the databits5 (int) constant.

See Also:
Constant Field Values

DATABITS_6

public static final int DATABITS_6
Define the databits6 (int) constant.

See Also:
Constant Field Values

DATABITS_7

public static final int DATABITS_7
Define the databits7 (int) constant.

See Also:
Constant Field Values

DATABITS_8

public static final int DATABITS_8
Define the databits8 (int) constant.

See Also:
Constant Field Values

STOPBITS_1

public static final int STOPBITS_1
Define the stopbits1 (int) constant.

See Also:
Constant Field Values

STOPBITS_2

public static final int STOPBITS_2
Define the stopbits2 (int) constant.

See Also:
Constant Field Values

STOPBITS_1_5

public static final int STOPBITS_1_5
Define the stopbits15 (int) constant.

See Also:
Constant Field Values

PARITY_NONE

public static final int PARITY_NONE
Define the parity none (int) constant.

See Also:
Constant Field Values

PARITY_ODD

public static final int PARITY_ODD
Define the parity odd (int) constant.

See Also:
Constant Field Values

PARITY_EVEN

public static final int PARITY_EVEN
Define the parity even (int) constant.

See Also:
Constant Field Values

PARITY_MARK

public static final int PARITY_MARK
Define the parity mark (int) constant.

See Also:
Constant Field Values

PARITY_SPACE

public static final int PARITY_SPACE
Define the parity space (int) constant.

See Also:
Constant Field Values

FLOWCONTROL_NONE

public static final int FLOWCONTROL_NONE
Define the flowcontrol none (int) constant.

See Also:
Constant Field Values

FLOWCONTROL_RTSCTS_IN

public static final int FLOWCONTROL_RTSCTS_IN
Define the flowcontrol rtscts in (int) constant.

See Also:
Constant Field Values

FLOWCONTROL_RTSCTS_OUT

public static final int FLOWCONTROL_RTSCTS_OUT
Define the flowcontrol rtscts out (int) constant.

See Also:
Constant Field Values

FLOWCONTROL_XONXOFF_IN

public static final int FLOWCONTROL_XONXOFF_IN
Define the flowcontrol xonxoff in (int) constant.

See Also:
Constant Field Values

FLOWCONTROL_XONXOFF_OUT

public static final int FLOWCONTROL_XONXOFF_OUT
Define the flowcontrol xonxoff out (int) constant.

See Also:
Constant Field Values
Constructor Detail

SerialPort

public SerialPort()
Constructs an instance of this class.

Method Detail

addEventListener

public abstract void addEventListener(SerialPortEventListener lsnr)
                               throws java.util.TooManyListenersException
Add event listener with the specified lsnr parameter.

Parameters:
lsnr - The lsnr (SerialPortEventListener) parameter.
Throws:
java.util.TooManyListenersException - Too Many Listeners Exception.
See Also:
removeEventListener()

getBaudRate

public abstract int getBaudRate()
Gets the baud rate (int) value.

Returns:
The baud rate (int) value.

getDataBits

public abstract int getDataBits()
Gets the data bits (int) value.

Returns:
The data bits (int) value.

getFlowControlMode

public abstract int getFlowControlMode()
Gets the flow control mode (int) value.

Returns:
The flow control mode (int) value.
See Also:
setFlowControlMode(int)

getParity

public abstract int getParity()
Gets the parity (int) value.

Returns:
The parity (int) value.

getStopBits

public abstract int getStopBits()
Gets the stop bits (int) value.

Returns:
The stop bits (int) value.

isCD

public abstract boolean isCD()
Gets the cd (boolean) value.

Returns:
The cd (boolean) value.

isCTS

public abstract boolean isCTS()
Gets the cts (boolean) value.

Returns:
The cts (boolean) value.
See Also:
notifyOnCTS(boolean)

isDSR

public abstract boolean isDSR()
Gets the dsr (boolean) value.

Returns:
The dsr (boolean) value.
See Also:
notifyOnDSR(boolean)

isDTR

public abstract boolean isDTR()
Gets the dtr (boolean) value.

Returns:
The dtr (boolean) value.
See Also:
setDTR(boolean)

isRI

public abstract boolean isRI()
Gets the ri (boolean) value.

Returns:
The ri (boolean) value.

isRTS

public abstract boolean isRTS()
Gets the rts (boolean) value.

Returns:
The rts (boolean) value.
See Also:
setRTS(boolean)

notifyOnBreakInterrupt

public abstract void notifyOnBreakInterrupt(boolean enable)
Notify on break interrupt with the specified enable parameter.

Parameters:
enable - The enable (boolean) parameter.

notifyOnCTS

public abstract void notifyOnCTS(boolean enable)
Notify on cts with the specified enable parameter.

Parameters:
enable - The enable (boolean) parameter.

notifyOnCarrierDetect

public abstract void notifyOnCarrierDetect(boolean enable)
Notify on carrier detect with the specified enable parameter.

Parameters:
enable - The enable (boolean) parameter.

notifyOnDSR

public abstract void notifyOnDSR(boolean enable)
Notify on dsr with the specified enable parameter.

Parameters:
enable - The enable (boolean) parameter.

notifyOnDataAvailable

public abstract void notifyOnDataAvailable(boolean enable)
Notify on data available with the specified enable parameter.

Parameters:
enable - The enable (boolean) parameter.

notifyOnFramingError

public abstract void notifyOnFramingError(boolean enable)
Notify on framing error with the specified enable parameter.

Parameters:
enable - The enable (boolean) parameter.

notifyOnOutputEmpty

public abstract void notifyOnOutputEmpty(boolean enable)
Notify on output empty with the specified enable parameter.

Parameters:
enable - The enable (boolean) parameter.

notifyOnOverrunError

public abstract void notifyOnOverrunError(boolean enable)
Notify on overrun error with the specified enable parameter.

Parameters:
enable - The enable (boolean) parameter.

notifyOnParityError

public abstract void notifyOnParityError(boolean enable)
Notify on parity error with the specified enable parameter.

Parameters:
enable - The enable (boolean) parameter.

notifyOnRingIndicator

public abstract void notifyOnRingIndicator(boolean enable)
Notify on ring indicator with the specified enable parameter.

Parameters:
enable - The enable (boolean) parameter.

removeEventListener

public abstract void removeEventListener()
Remove event listener.

See Also:
addEventListener(SerialPortEventListener)

sendBreak

public abstract void sendBreak(int millis)
Send break with the specified millis parameter.

Parameters:
millis - The millis (int) parameter.

setDTR

public abstract void setDTR(boolean dtr)
Sets the dtr value.

Parameters:
dtr - The dtr (boolean) parameter.
See Also:
isDTR()

setFlowControlMode

public abstract void setFlowControlMode(int flowcontrol)
                                 throws UnsupportedCommOperationException
Sets the flow control mode value.

Parameters:
flowcontrol - The flowcontrol (int) parameter.
Throws:
UnsupportedCommOperationException - Unsupported Comm Operation Exception.
See Also:
getFlowControlMode()

setRTS

public abstract void setRTS(boolean rts)
Sets the rts value.

Parameters:
rts - The rts (boolean) parameter.
See Also:
isRTS()

setRcvFifoTrigger

public void setRcvFifoTrigger(int trigger)
Sets the rcv fifo trigger value.

Parameters:
trigger - The trigger (int) parameter.

setSerialPortParams

public abstract void setSerialPortParams(int baudrate,
                                         int dataBits,
                                         int stopBits,
                                         int parity)
                                  throws UnsupportedCommOperationException
Set serial port params with the specified baudrate, data bits, stop bits and parity parameters.

Parameters:
baudrate - The baudrate (int) parameter.
dataBits - The data bits (int) parameter.
stopBits - The stop bits (int) parameter.
parity - The parity (int) parameter.
Throws:
UnsupportedCommOperationException - Unsupported Comm Operation Exception.

1.0.0

Copyright (c) 1999, 2007 IBM