DCT Lightfoot v3 API specification

javax.comm
Class SerialPort

java.lang.Object
  |
  +--javax.comm.CommPort
        |
        +--javax.comm.SerialPort

public abstract class SerialPort
extends CommPort

Serial port


Field Summary
static int DATABITS_5
          5 data bits
static int DATABITS_6
          6 data bits
static int DATABITS_7
          7 data bits
static int DATABITS_8
          8 data bits
static int FLOWCONTROL_NONE
          No flow control
static int FLOWCONTROL_RTSCTS_IN
          RTS/CTS input flow control
static int FLOWCONTROL_RTSCTS_OUT
          RTS/CTS output flow control
static int FLOWCONTROL_XONXOFF_IN
          XON/XOFF input flow control
static int FLOWCONTROL_XONXOFF_OUT
          XON/XOFF output flow control
static int PARITY_EVEN
          Even parity bit
static int PARITY_MARK
          Mark parity
static int PARITY_NONE
          No parity bit
static int PARITY_ODD
          Odd parity bit
static int PARITY_SPACE
          Space parity
static int STOPBITS_1
          1 stop bit
static int STOPBITS_1_5
          1.5 stop bits
static int STOPBITS_2
          2 stop bits
 
Fields inherited from class javax.comm.CommPort
name
 
Constructor Summary
SerialPort()
          Create a new serial port
 
Method Summary
abstract  void addEventListener(SerialPortEventListener listener)
          Add an event listener
abstract  int getBaudRate()
          Get the baud rate
abstract  int getDataBits()
          Get the data bits
abstract  int getFlowControlMode()
          Get the flow control mode
abstract  int getParity()
          Get the parity
abstract  int getStopBits()
          Get the stop bits
abstract  boolean isCD()
          Gets the state of CD
abstract  boolean isCTS()
          Gets the state of CTS
abstract  boolean isDSR()
          Gets the state of DSR
abstract  boolean isDTR()
          Gets the state of DTR
abstract  boolean isRI()
          Gets the state of RI
abstract  boolean isRTS()
          Gets the state of RTS
abstract  void notifyOnBreakInterrupt(boolean enable)
          Set notification on break interrupt
abstract  void notifyOnCarrierDetect(boolean enable)
          Set notification on carrier detect
abstract  void notifyOnCTS(boolean enable)
          Set notification on CTS
abstract  void notifyOnDataAvailable(boolean enable)
          Set notification on data available
abstract  void notifyOnDSR(boolean enable)
          Set notification on DSR
abstract  void notifyOnFramingError(boolean enable)
          Set notification on framing error
abstract  void notifyOnOutputEmpty(boolean enable)
          Set notification on output empty
abstract  void notifyOnOverrunError(boolean enable)
          Set notification on overrun error
abstract  void notifyOnParityError(boolean enable)
          Set notification on parity error
abstract  void notifyOnRingIndicator(boolean enable)
          Set notification on ring indicator
abstract  void removeEventListener(SerialPortEventListener listener)
          Remove an event listener
abstract  void sendBreak(int millis)
          Send a break
abstract  void setDTR(boolean dtr)
          Set DTR
abstract  void setFlowControlMode(int mode)
          Set the flow control mode
abstract  void setRTS(boolean rts)
          Set RTS
abstract  void setSerialPortParams(int baudrate, int dataBits, int stopBits, int parity)
          Set the serial port 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATABITS_5

public static final int DATABITS_5
5 data bits

See Also:
Constant Field Values

DATABITS_6

public static final int DATABITS_6
6 data bits

See Also:
Constant Field Values

DATABITS_7

public static final int DATABITS_7
7 data bits

See Also:
Constant Field Values

DATABITS_8

public static final int DATABITS_8
8 data bits

See Also:
Constant Field Values

STOPBITS_1

public static final int STOPBITS_1
1 stop bit

See Also:
Constant Field Values

STOPBITS_2

public static final int STOPBITS_2
2 stop bits

See Also:
Constant Field Values

STOPBITS_1_5

public static final int STOPBITS_1_5
1.5 stop bits

See Also:
Constant Field Values

PARITY_NONE

public static final int PARITY_NONE
No parity bit

See Also:
Constant Field Values

PARITY_ODD

public static final int PARITY_ODD
Odd parity bit

See Also:
Constant Field Values

PARITY_EVEN

public static final int PARITY_EVEN
Even parity bit

See Also:
Constant Field Values

PARITY_MARK

public static final int PARITY_MARK
Mark parity

See Also:
Constant Field Values

PARITY_SPACE

public static final int PARITY_SPACE
Space parity

See Also:
Constant Field Values

FLOWCONTROL_NONE

public static final int FLOWCONTROL_NONE
No flow control

See Also:
Constant Field Values

FLOWCONTROL_RTSCTS_IN

public static final int FLOWCONTROL_RTSCTS_IN
RTS/CTS input flow control

See Also:
Constant Field Values

FLOWCONTROL_RTSCTS_OUT

public static final int FLOWCONTROL_RTSCTS_OUT
RTS/CTS output flow control

See Also:
Constant Field Values

FLOWCONTROL_XONXOFF_IN

public static final int FLOWCONTROL_XONXOFF_IN
XON/XOFF input flow control

See Also:
Constant Field Values

FLOWCONTROL_XONXOFF_OUT

public static final int FLOWCONTROL_XONXOFF_OUT
XON/XOFF output flow control

See Also:
Constant Field Values
Constructor Detail

SerialPort

public SerialPort()
Create a new serial port

Method Detail

getBaudRate

public abstract int getBaudRate()
Get the baud rate

Returns:
the baud rate

getDataBits

public abstract int getDataBits()
Get the data bits

Returns:
the number of data bits

getStopBits

public abstract int getStopBits()
Get the stop bits

Returns:
the stop bits

getParity

public abstract int getParity()
Get the parity

Returns:
the parity

sendBreak

public abstract void sendBreak(int millis)
Send a break

Parameters:
millis - The duration in milliseconds

setFlowControlMode

public abstract void setFlowControlMode(int mode)
                                 throws UnsupportedCommOperationException
Set the flow control mode

Parameters:
mode - The flow control mode
Throws:
UnsupportedCommOperationException - if the operation fails

getFlowControlMode

public abstract int getFlowControlMode()
Get the flow control mode

Returns:
the flow control mode

setSerialPortParams

public abstract void setSerialPortParams(int baudrate,
                                         int dataBits,
                                         int stopBits,
                                         int parity)
                                  throws UnsupportedCommOperationException
Set the serial port parameters

Parameters:
baudrate - The baud rate
dataBits - The data bits
stopBits - The stop bits
parity - The parity
Throws:
UnsupportedCommOperationException - if the operation fails

setDTR

public abstract void setDTR(boolean dtr)
Set DTR

Parameters:
dtr - True to set dtr, false to clear it

isDTR

public abstract boolean isDTR()
Gets the state of DTR

Returns:
true if set, false if not

setRTS

public abstract void setRTS(boolean rts)
Set RTS

Parameters:
rts - True to set RTS, false to clear it

isRTS

public abstract boolean isRTS()
Gets the state of RTS

Returns:
true if set, false if not

isCTS

public abstract boolean isCTS()
Gets the state of CTS

Returns:
true if set, false if not

isDSR

public abstract boolean isDSR()
Gets the state of DSR

Returns:
true if set, false if not

isRI

public abstract boolean isRI()
Gets the state of RI

Returns:
true if set, false if not

isCD

public abstract boolean isCD()
Gets the state of CD

Returns:
true if set, false if not

addEventListener

public abstract void addEventListener(SerialPortEventListener listener)
Add an event listener

Parameters:
listener - The event listener

removeEventListener

public abstract void removeEventListener(SerialPortEventListener listener)
Remove an event listener

Parameters:
listener - The event listener to remove

notifyOnDataAvailable

public abstract void notifyOnDataAvailable(boolean enable)
Set notification on data available

Parameters:
enable - True to enable, false to disable

notifyOnOutputEmpty

public abstract void notifyOnOutputEmpty(boolean enable)
Set notification on output empty

Parameters:
enable - True to enable, false to disable

notifyOnCTS

public abstract void notifyOnCTS(boolean enable)
Set notification on CTS

Parameters:
enable - True to enable, false to disable

notifyOnDSR

public abstract void notifyOnDSR(boolean enable)
Set notification on DSR

Parameters:
enable - True to enable, false to disable

notifyOnRingIndicator

public abstract void notifyOnRingIndicator(boolean enable)
Set notification on ring indicator

Parameters:
enable - True to enable, false to disable

notifyOnCarrierDetect

public abstract void notifyOnCarrierDetect(boolean enable)
Set notification on carrier detect

Parameters:
enable - True to enable, false to disable

notifyOnOverrunError

public abstract void notifyOnOverrunError(boolean enable)
Set notification on overrun error

Parameters:
enable - True to enable, false to disable

notifyOnParityError

public abstract void notifyOnParityError(boolean enable)
Set notification on parity error

Parameters:
enable - True to enable, false to disable

notifyOnFramingError

public abstract void notifyOnFramingError(boolean enable)
Set notification on framing error

Parameters:
enable - True to enable, false to disable

notifyOnBreakInterrupt

public abstract void notifyOnBreakInterrupt(boolean enable)
Set notification on break interrupt

Parameters:
enable - True to enable, false to disable

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification