com.engidea.comm
Class SerialPort
java.lang.Object
com.engidea.comm.CommPort
com.engidea.comm.SerialPort
- Direct Known Subclasses:
- WinjcomPort
public abstract class SerialPort
- extends CommPort
Defines a generic serial port, concrete implementation may have more methods
but this should be fairly general.
Constructor Summary |
SerialPort(java.lang.String portName)
COnstructor needed since portName is final |
Methods inherited from class com.engidea.comm.CommPort |
available, close, disableReceiveFraming, disableReceiveThreshold, disableReceiveTimeout, enableReceiveFraming, enableReceiveThreshold, enableReceiveTimeout, flush, getInputBufferSize, getName, getOutputBufferSize, getReceiveFramingByte, getReceiveThreshold, getReceiveTimeout, isReceiveFramingEnabled, isReceiveThresholdEnabled, isReceiveTimeoutEnabled, open, read, setInputBufferSize, setOutputBufferSize, toString, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DATABITS_5
public static final int DATABITS_5
- See Also:
- Constant Field Values
DATABITS_6
public static final int DATABITS_6
- See Also:
- Constant Field Values
DATABITS_7
public static final int DATABITS_7
- See Also:
- Constant Field Values
DATABITS_8
public static final int DATABITS_8
- See Also:
- Constant Field Values
PARITY_NONE
public static final int PARITY_NONE
- See Also:
- Constant Field Values
PARITY_ODD
public static final int PARITY_ODD
- See Also:
- Constant Field Values
PARITY_EVEN
public static final int PARITY_EVEN
- See Also:
- Constant Field Values
PARITY_MARK
public static final int PARITY_MARK
- See Also:
- Constant Field Values
PARITY_SPACE
public static final int PARITY_SPACE
- See Also:
- Constant Field Values
STOPBITS_1
public static final int STOPBITS_1
- See Also:
- Constant Field Values
STOPBITS_2
public static final int STOPBITS_2
- See Also:
- Constant Field Values
STOPBITS_1_5
public static final int STOPBITS_1_5
- See Also:
- Constant Field Values
FLOWCONTROL_NONE
public static final int FLOWCONTROL_NONE
- See Also:
- Constant Field Values
FLOWCONTROL_RTSCTS_IN
public static final int FLOWCONTROL_RTSCTS_IN
- See Also:
- Constant Field Values
FLOWCONTROL_RTSCTS_OUT
public static final int FLOWCONTROL_RTSCTS_OUT
- See Also:
- Constant Field Values
FLOWCONTROL_XONXOFF_IN
public static final int FLOWCONTROL_XONXOFF_IN
- See Also:
- Constant Field Values
FLOWCONTROL_XONXOFF_OUT
public static final int FLOWCONTROL_XONXOFF_OUT
- See Also:
- Constant Field Values
SerialPort
public SerialPort(java.lang.String portName)
- COnstructor needed since portName is final
- Parameters:
portName
-
setSerialPortParams
public abstract void setSerialPortParams(int baudrate,
int databits,
int stopbits,
int parity)
throws java.io.IOException
- Throws:
java.io.IOException
getBaudRate
public abstract int getBaudRate()
throws java.io.IOException
- Throws:
java.io.IOException
getDataBits
public abstract int getDataBits()
throws java.io.IOException
- Throws:
java.io.IOException
getStopBits
public abstract int getStopBits()
throws java.io.IOException
- Throws:
java.io.IOException
getParity
public abstract int getParity()
throws java.io.IOException
- Throws:
java.io.IOException
setFlowControlMode
public abstract void setFlowControlMode(int flowcontrol)
throws java.io.IOException
- Throws:
java.io.IOException
getFlowControlMode
public abstract int getFlowControlMode()
throws java.io.IOException
- Throws:
java.io.IOException
isDTR
public abstract boolean isDTR()
throws java.io.IOException
- Throws:
java.io.IOException
setDTR
public abstract void setDTR(boolean state)
throws java.io.IOException
- Throws:
java.io.IOException
setRTS
public abstract void setRTS(boolean state)
throws java.io.IOException
- Throws:
java.io.IOException
isCTS
public abstract boolean isCTS()
throws java.io.IOException
- Throws:
java.io.IOException
isDSR
public abstract boolean isDSR()
throws java.io.IOException
- Throws:
java.io.IOException
isCD
public abstract boolean isCD()
throws java.io.IOException
- Throws:
java.io.IOException
isRI
public abstract boolean isRI()
throws java.io.IOException
- Throws:
java.io.IOException
isRTS
public abstract boolean isRTS()
throws java.io.IOException
- Throws:
java.io.IOException
sendBreak
public abstract void sendBreak(int duration)
throws java.lang.InterruptedException,
java.io.IOException
- Throws:
java.lang.InterruptedException
java.io.IOException
setEventListener
public abstract void setEventListener(SerialPortEventListener lsnr)
notifyOnDataAvailable
public abstract void notifyOnDataAvailable(boolean enable)
throws java.io.IOException
- Throws:
java.io.IOException
notifyOnOutputEmpty
public abstract void notifyOnOutputEmpty(boolean enable)
throws java.io.IOException
- Throws:
java.io.IOException
notifyOnCTS
public abstract void notifyOnCTS(boolean enable)
throws java.io.IOException
- Throws:
java.io.IOException
notifyOnDSR
public abstract void notifyOnDSR(boolean enable)
throws java.io.IOException
- Throws:
java.io.IOException
notifyOnRingIndicator
public abstract void notifyOnRingIndicator(boolean enable)
throws java.io.IOException
- Throws:
java.io.IOException
notifyOnCarrierDetect
public abstract void notifyOnCarrierDetect(boolean enable)
throws java.io.IOException
- Throws:
java.io.IOException
notifyOnOverrunError
public abstract void notifyOnOverrunError(boolean enable)
throws java.io.IOException
- Throws:
java.io.IOException
notifyOnParityError
public abstract void notifyOnParityError(boolean enable)
throws java.io.IOException
- Throws:
java.io.IOException
notifyOnFramingError
public abstract void notifyOnFramingError(boolean enable)
throws java.io.IOException
- Throws:
java.io.IOException
notifyOnBreakInterrupt
public abstract void notifyOnBreakInterrupt(boolean enable)
throws java.io.IOException
- Throws:
java.io.IOException