|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--vfstagecontroller.SerialConnection
A class that handles the details of a serial connection. Reads from one TextArea and writes to a second TextArea. Holds the state of the connection.
Inner Class Summary | |
(package private) class |
SerialConnection.KeyHandler
A class to handle KeyEvent s generated by the messageAreaOut.
|
Fields inherited from interface javax.comm.CommPortOwnershipListener |
PORT_OWNED, PORT_OWNERSHIP_REQUESTED, PORT_UNOWNED |
Constructor Summary | |
SerialConnection(SerialParameters parameters)
Creates a SerialConnection object and initilizes variables passed in as params. |
|
SerialConnection(SerialParameters parameters,
java.awt.TextArea tArea)
|
Method Summary | |
void |
closeConnection()
Close the port and clean up associated elements. |
(package private) java.io.InputStream |
getInputStream()
Return input stream |
(package private) java.io.OutputStream |
getOutputStream()
Rerturn outupStrem |
boolean |
isOpen()
Reports the open status of the port. |
void |
openConnection()
Attempts to open a serial connection and streams using the parameters in the SerialParameters object. |
void |
ownershipChange(int type)
Handles ownership events. |
boolean |
sendAck(long msTimeOut)
Send command to serial port |
void |
sendBreak()
Send a one second break signal. |
java.lang.String |
sendCommand(java.lang.String command)
Send command to serial port |
void |
serialEvent(javax.comm.SerialPortEvent e)
Handles SerialPortEvents. |
void |
setConnectionParameters()
Sets the connection parameters to the setting in the parameters object. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public SerialConnection(SerialParameters parameters)
parameters
- A SerialParameters object.
port are displayed on.public SerialConnection(SerialParameters parameters, java.awt.TextArea tArea)
Method Detail |
java.io.OutputStream getOutputStream()
java.io.InputStream getInputStream()
public void openConnection() throws SerialConnectionException
SerialConnectionException
, and returns.
Gives a timeout of 30 seconds on the portOpen to allow other applications
to reliquish the port if have it open and no longer need it.public void setConnectionParameters() throws SerialConnectionException
public void closeConnection()
public void sendBreak()
public boolean isOpen()
public void serialEvent(javax.comm.SerialPortEvent e)
serialEvent
in interface javax.comm.SerialPortEventListener
public void ownershipChange(int type)
ownershipChange
in interface javax.comm.CommPortOwnershipListener
public java.lang.String sendCommand(java.lang.String command)
public boolean sendAck(long msTimeOut)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |