|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface for serial port classes. Using this interface allows a common code set for working with serial ports both locally and remotely.
| Field Summary | |
static int |
RXREADYCOUNT
|
| Method Summary | |
void |
close()
Close a port object. |
void |
configure(SerialConfig cfgObj)
Configures port with the parameters in the SerialConfig object See documentation for details on the SerialConfig parameters. |
int |
getByte()
Get the next available byte from the receive buffer. |
SerialConfig |
getConfig()
Gets the configuration object for the port. |
int |
getData(byte[] buf)
Transfers bytes into the data buffer from the serial port receive buffer. |
int |
getData(byte[] buf,
int off,
int len)
Transfers bytes into the data buffer from the serial port receive buffer. |
int |
getLibVer()
Returns the version number of the current serial port DLL |
java.lang.String |
getName()
Returns the name of this serial port object |
int |
getPortNum()
Returns the port number for this serial port object |
int |
getTimeoutRx()
Returns the receive (rx) timeout interval of serial port object. |
int |
getTimeoutTx()
Returns the transmit (tx) timeout interval of serial port object. |
boolean |
isSupported(java.lang.String name)
Indicates support for the requested feature. |
void |
putByte(byte data)
Send byte to the serial port. |
void |
putData(byte[] data)
Send byte array contents to the to the serial port. |
void |
putData(byte[] data,
int off,
int dLen)
Send specified length of byte array contents to the serial port. |
void |
putString(java.lang.String s)
Send String contents to the serial port. |
int |
rxFlush()
Flushes the objects receive buffer (contents are discarded) |
boolean |
rxOverflow()
Returns true if the objects receive buffer overflowed since the last call to this method. |
int |
rxReadyCount()
Returns number of bytes in the objects receive buffer |
void |
sendBreak(int tmo)
Send a break signal on the line |
void |
setConfig(SerialConfig cfgObj)
Sets the configuration object for the port. |
void |
setDTR(boolean onOff)
Set the DTR signal of objects serial port |
void |
setName(java.lang.String spName)
Sets the name of this serial port object |
void |
setRTS(boolean onOff)
Set the RTS signal of objects serial port |
void |
setTimeoutRx(int tmoRx)
Sets the receive timeout of the serial port object. |
void |
setTimeoutTx(int tmoTx)
Sets the transmit timeout of the serial port object. |
boolean |
sigBreak()
Returns true if the serial port for this object detected a break on the line since the last call to this method. |
boolean |
sigCD()
Returns state of serial port CD (Carrier Detect) signal |
boolean |
sigCTS()
Returns state of serial port CTS (Clear To Send) signal |
boolean |
sigDSR()
Returns state of serial port DSR (Data Set Ready) signal |
boolean |
sigFrameErr()
Returns true if the serial port for this object had a Framing Error since last call to this method. |
boolean |
sigOverrun()
Returns true if the serial port UART for this object had a was Overrun since last call to this method. |
boolean |
sigParityErr()
Returns true if the serial port for this object had a Parity Error since last call to this method. |
boolean |
sigRing()
Returns true if the serial port for this object detected a Ring on the line since the last call to this method. |
int |
txBufCount()
Returns number of bytes in the objects transmit buffer |
int |
txDrain()
Drains the objects transmit buffer (contents are sent) |
int |
txFlush()
Flushes the objects transmit buffer (contents are discarded) |
| Field Detail |
public static final int RXREADYCOUNT
| Method Detail |
public void setConfig(SerialConfig cfgObj)
cfgObj - The serial port configuration objectpublic SerialConfig getConfig()
public void configure(SerialConfig cfgObj)
throws java.io.IOException
cfgObj - The serial port configuration object
java.io.IOException - if error
public void close()
throws java.io.IOException
java.io.IOException - if error
public void putByte(byte data)
throws java.io.IOException
data - The byte of data to output to the objects serial port
java.io.IOException - if error
public void putString(java.lang.String s)
throws java.io.IOException
s - The string to output to the objects serial port.
java.io.IOException - if error
public void putData(byte[] data)
throws java.io.IOException
data - The byte array of data to output to the objects serial port
are not sent to the transmit buffer
java.io.IOException - if error
public void putData(byte[] data,
int off,
int dLen)
throws java.io.IOException
data - The byte array of data to output to the objects serial portdLen - The length from the beginning of the byte array that will be
output to the objects serial port.
java.io.IOException - if error
public int getByte()
throws java.io.IOException
java.io.IOException - if error
public int getData(byte[] buf)
throws java.io.IOException
buf - The byte array that will contain the data read from the objects
serial port.
java.io.IOException - if port not open
public int getData(byte[] buf,
int off,
int len)
throws java.io.IOException
buf - the byte array buffer where data will be put when readoff - the offset in the buffer where data will be putlen - the length of data requested to be put in the buffer
java.io.IOException - if an error occurs.
public int rxFlush()
throws java.io.IOException
java.io.IOException - if error
public int txFlush()
throws java.io.IOException
java.io.IOException - if error
public int txDrain()
throws java.io.IOException
java.io.IOException - if error
public int rxReadyCount()
throws java.io.IOException
java.io.IOException - if error
public int txBufCount()
throws java.io.IOException
java.io.IOException - if error
public boolean rxOverflow()
throws java.io.IOException
java.io.IOException - if error
public boolean sigDSR()
throws java.io.IOException
java.io.IOException - if error
public boolean sigCTS()
throws java.io.IOException
java.io.IOException - if error
public boolean sigCD()
throws java.io.IOException
java.io.IOException - if error
public boolean sigFrameErr()
throws java.io.IOException
java.io.IOException - if error
public boolean sigOverrun()
throws java.io.IOException
java.io.IOException - if error
public boolean sigParityErr()
throws java.io.IOException
java.io.IOException - if error
public boolean sigRing()
throws java.io.IOException
java.io.IOException - if error
public boolean sigBreak()
throws java.io.IOException
java.io.IOException - if error
public void setDTR(boolean onOff)
throws java.io.IOException
onOff - The state that the objects DTR line will be set to.
java.io.IOException - if error
public void setRTS(boolean onOff)
throws java.io.IOException
onOff - The state that the objects RTS line will be set to.
java.io.IOException - if error
public void sendBreak(int tmo)
throws java.io.IOException
java.io.IOException - if error
public int getTimeoutRx()
throws java.io.IOException
java.io.IOException - if error
public int getTimeoutTx()
throws java.io.IOException
java.io.IOException - if error
public void setTimeoutRx(int tmoRx)
throws java.io.IOException
tmoRx - The number of milliseconds for the timeout.
java.io.IOException - if error
public void setTimeoutTx(int tmoTx)
throws java.io.IOException
java.io.IOException - if error
public int getLibVer()
throws java.io.IOException
java.io.IOException - if errorpublic int getPortNum()
public void setName(java.lang.String spName)
public java.lang.String getName()
public boolean isSupported(java.lang.String name)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||