|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcomm.CommPort
comm.SerialPort
public abstract class SerialPort
This class models an RS-232 serial communications port.
Field Summary | |
---|---|
static int |
DATABITS_5
5 data bit format. |
static int |
DATABITS_6
6 data bit format. |
static int |
DATABITS_7
7 data bit format. |
static int |
DATABITS_8
8 data bit format. |
static int |
FLOWCONTROL_NONE
No flow control. |
static int |
FLOWCONTROL_RTSCTS_IN
RTS/CTS flow control on input. |
static int |
FLOWCONTROL_RTSCTS_OUT
RTS/CTS flow control on output. |
static int |
FLOWCONTROL_XONXOFF_IN
XON/XOFF flow control on input. |
static int |
FLOWCONTROL_XONXOFF_OUT
XON/XOFF flow control on output. |
static int |
PARITY_EVEN
Even parity. |
static int |
PARITY_MARK
MARK parity scheme. |
static int |
PARITY_NONE
No parity. |
static int |
PARITY_ODD
Odd parity. |
static int |
PARITY_SPACE
SPACE parity scheme. |
static int |
STOPBITS_1
1 stop bit. |
static int |
STOPBITS_1_5
1-1½ stop bits. |
static int |
STOPBITS_2
2 stop bits. |
Constructor Summary | |
---|---|
SerialPort()
Constructor. |
Method Summary | |
---|---|
abstract void |
addEventListener(SerialPortEventListener listener)
Adds the specified serial port listener to receive serial events. |
abstract boolean |
isCD()
Indicates if the CD bit is set. |
abstract boolean |
isCTS()
Indicates if the CTS bit is set. |
abstract boolean |
isDSR()
Indicates if the DSR bit is set. |
abstract boolean |
isRI()
Indicates if the RI bit is set. |
abstract boolean |
isRTS()
Indicates if the RTS bit is set. |
abstract void |
notifyOnBreakInterrupt(boolean enable)
Instructs the port to notify its listener when there is a break interrupt on the line. |
abstract void |
notifyOnCarrierDetect(boolean enable)
Instructs the port to notify its listener when the CD bit changes. |
abstract void |
notifyOnCTS(boolean enable)
Instructs the port to notify its listener when the CTS bit changes. |
abstract void |
notifyOnDataAvailable(boolean enable)
Instructs the port to notify its listener when input data is available. |
abstract void |
notifyOnDSR(boolean enable)
Instructs the port to notify its listener when the DSR bit changes. |
abstract void |
notifyOnFramingError(boolean enable)
Instructs the port to notify its listener when a framing error occurs. |
abstract void |
notifyOnOutputEmpty(boolean enable)
Instructs the port to notify its listener when the output buffer is empty. |
abstract void |
notifyOnOverrunError(boolean enable)
Instructs the port to notify its listener when an overrun error occurs. |
abstract void |
notifyOnParityError(boolean enable)
Instructs the port to notify its listener when a parity error occurs. |
abstract void |
notifyOnRingIndicator(boolean enable)
Instructs the port to notify its listener when the RI bit changes. |
abstract void |
removeEventListener()
Removes the current serial port listener. |
void |
setRcvFifoTrigger(int trigger)
Deprecated. |
Methods inherited from class comm.CommPort |
---|
close, getName, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface comm.SerialPortInterface |
---|
getBaudBase, getBaudRate, getCallOutHangup, getDataBits, getDivisor, getEndOfInputChar, getFlowControlMode, getLowLatency, getParity, getParityErrorChar, getStopBits, getUARTType, isDTR, sendBreak, setBaudBase, setCallOutHangup, setDivisor, setDTR, setEndOfInputChar, setFlowControlMode, setLowLatency, setParityErrorChar, setRTS, setSerialPortParams, setUARTType |
Field Detail |
---|
public static final int DATABITS_5
public static final int DATABITS_6
public static final int DATABITS_7
public static final int DATABITS_8
public static final int STOPBITS_1
public static final int STOPBITS_2
public static final int STOPBITS_1_5
public static final int PARITY_NONE
public static final int PARITY_ODD
public static final int PARITY_EVEN
public static final int PARITY_MARK
public static final int PARITY_SPACE
public static final int FLOWCONTROL_NONE
public static final int FLOWCONTROL_RTSCTS_IN
public static final int FLOWCONTROL_RTSCTS_OUT
public static final int FLOWCONTROL_XONXOFF_IN
public static final int FLOWCONTROL_XONXOFF_OUT
Constructor Detail |
---|
public SerialPort()
Method Detail |
---|
public void setRcvFifoTrigger(int trigger)
setRcvFifoTrigger
in interface SerialPortInterface
trigger
- the trigger levelpublic abstract boolean isRTS()
isRTS
in interface SerialPortInterface
SerialPortInterface.setRTS(boolean)
public abstract boolean isCTS()
isCTS
in interface SerialPortInterface
SerialPortInterface.setDTR(boolean)
public abstract boolean isDSR()
isDSR
in interface SerialPortInterface
public abstract boolean isRI()
isRI
in interface SerialPortInterface
public abstract boolean isCD()
isCD
in interface SerialPortInterface
public abstract void addEventListener(SerialPortEventListener listener) throws java.util.TooManyListenersException
addEventListener
in interface SerialPortInterface
listener
- the listener to add
java.util.TooManyListenersException
public abstract void removeEventListener()
removeEventListener
in interface SerialPortInterface
public abstract void notifyOnDataAvailable(boolean enable)
notifyOnDataAvailable
in interface SerialPortInterface
enable
- true if asynchronous events are desired, false
otherwisepublic abstract void notifyOnOutputEmpty(boolean enable)
notifyOnOutputEmpty
in interface SerialPortInterface
enable
- true to enable notification, false otherwisepublic abstract void notifyOnCTS(boolean enable)
notifyOnCTS
in interface SerialPortInterface
enable
- true to enable notification, false otherwisepublic abstract void notifyOnDSR(boolean enable)
notifyOnDSR
in interface SerialPortInterface
enable
- true to enable notification, false otherwisepublic abstract void notifyOnRingIndicator(boolean enable)
notifyOnRingIndicator
in interface SerialPortInterface
enable
- true to enable notification, false otherwisepublic abstract void notifyOnCarrierDetect(boolean enable)
notifyOnCarrierDetect
in interface SerialPortInterface
enable
- true to enable notification, false otherwisepublic abstract void notifyOnOverrunError(boolean enable)
notifyOnOverrunError
in interface SerialPortInterface
enable
- true to enable notification, false otherwisepublic abstract void notifyOnParityError(boolean enable)
notifyOnParityError
in interface SerialPortInterface
enable
- true to enable notification, false otherwisepublic abstract void notifyOnFramingError(boolean enable)
notifyOnFramingError
in interface SerialPortInterface
enable
- true to enable notification, false otherwisepublic abstract void notifyOnBreakInterrupt(boolean enable)
notifyOnBreakInterrupt
in interface SerialPortInterface
enable
- true to enable notification, false otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |