|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.cli.serial.SerialCommSession
This class can be used to establish CLI session with the desired device over Serial port. The Session can be established by passing the port Identifier as argument to open() or the portId can be set and later the open() method without any argument can be called.
| Constructor Summary | |
SerialCommSession()
Default constructor |
|
SerialCommSession(java.lang.String portId)
This creates a SerialCommSession with the portId set. |
|
| Method Summary | |
void |
close()
Closes the Serial port session. |
int |
getFlowControlMode()
Gets the flow control mode set. |
java.lang.String |
getPortId()
Gets the portId set. |
int |
getReadTimeout()
Gets the Read Timeout. |
void |
open()
Opens a Serial Port connection through the port identifier already set using setPortId. |
void |
open(java.lang.String portId)
Opens a Serial Port connection through the port identifier specified. |
byte[] |
read()
Reads the data over the opened Serial Port connection. |
void |
serialEvent(javax.comm.SerialPortEvent event)
This method is called if any Serial Port Event occurs. |
void |
setFlowControlMode(int flowcontrol)
Sets the flow control mode. |
void |
setPortId(java.lang.String portId)
Sets the portId through which the session is to be established. |
void |
setReadTimeout(int timeout)
Sets the Read Timeout. |
void |
setSerialCommParameters(int baudRate,
int dataBits,
int stopBits,
int parity)
Sets the various Communication parameters. |
void |
write(byte[] data)
Writes the data over the opened Serial Port connection. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public SerialCommSession()
public SerialCommSession(java.lang.String portId)
portId - the port Identifier as a String| Method Detail |
public void open()
throws java.lang.Exception
public void open(java.lang.String portId)
throws java.lang.Exception
portId - the port Identifier as a String
public void setSerialCommParameters(int baudRate,
int dataBits,
int stopBits,
int parity)
throws javax.comm.UnsupportedCommOperationException
baudRate - the baud ratedataBits - the number of data bits to be usedstopBits - the number of stop bits to be usedparity - the parity typepublic void setFlowControlMode(int flowcontrol)
flowcontrol - the flow control mode.public int getFlowControlMode()
public void serialEvent(javax.comm.SerialPortEvent event)
event - the SerialPortEvent.
public void write(byte[] data)
throws java.io.IOException
data - the byte array containing the data to be written.
public byte[] read()
throws java.io.IOException
public void close()
throws java.lang.Exception
public void setReadTimeout(int timeout)
timeout - the read timeout in milliseconds.public int getReadTimeout()
public void setPortId(java.lang.String portId)
portId - the port Identifier as a String.public java.lang.String getPortId()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||