|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdea.hc.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.
Field Summary |
Fields inherited from interface javax.comm.CommPortOwnershipListener |
PORT_OWNED, PORT_OWNERSHIP_REQUESTED, PORT_UNOWNED |
Constructor Summary | |
SerialConnection(SerialDemo parent,
SerialParameters parameters,
java.awt.TextArea messageAreaOut,
java.awt.TextArea messageAreaIn)
Creates a SerialConnection object and initilizes variables passed in as params. |
Method Summary | |
void |
closeConnection()
Close the port and clean up associated elements. |
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. |
void |
sendBreak()
Send a one second break signal. |
void |
serialEvent(SerialPortEvent e)
Handles SerialPortEvents. |
void |
setConnectionParameters()
Sets the connection parameters to the setting in the parameters object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SerialConnection(SerialDemo parent, SerialParameters parameters, java.awt.TextArea messageAreaOut, java.awt.TextArea messageAreaIn)
parent
- A SerialDemo object.parameters
- A SerialParameters object.messageAreaOut
- The TextArea that messages that are to be sent out
of the serial port are entered into.messageAreaIn
- The TextArea that messages comming into the serial
port are displayed on.Method Detail |
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.
SerialConnectionException
public void setConnectionParameters() throws SerialConnectionException
SerialConnectionException
public void closeConnection()
public void sendBreak()
public boolean isOpen()
public void serialEvent(SerialPortEvent e)
serialEvent
in interface SerialPortEventListener
public void ownershipChange(int type)
ownershipChange
in interface CommPortOwnershipListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |