|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.elexis.rs232.Connection
public class Connection
Nested Class Summary | |
---|---|
static interface |
Connection.ComPortListener
|
Field Summary |
---|
Fields inherited from interface ch.elexis.rs232.PortEventListener |
---|
CR, ETX, LF, NAK, STX, XOFF, XON |
Constructor Summary | |
---|---|
Connection(java.lang.String portName,
java.lang.String port,
java.lang.String settings,
Connection.ComPortListener l)
|
Method Summary | |
---|---|
void |
awaitFrame(int start,
int end,
int following,
int timeout)
Wait for a frame of the device to be sent. |
void |
close()
|
boolean |
connect()
|
static java.lang.String[] |
getComPorts()
|
boolean |
isOpen()
Reports the open status of the port. |
void |
openConnection(SerialParameters parameters)
Attempts to open a serial connection and streams using the parameters in the SerialParameters object. |
void |
readLine(byte delimiter,
int timeout)
Read a line of input from the serial port. |
boolean |
send(java.lang.String data)
|
void |
sendBreak()
Send a one second break signal. |
void |
serialEvent(SerialPortEvent e)
Handles SerialPortEvents. |
void |
setConnectionParameters(SerialParameters parameters)
Sets the connection parameters to the setting in the parameters object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Connection(java.lang.String portName, java.lang.String port, java.lang.String settings, Connection.ComPortListener l)
Method Detail |
---|
public boolean connect()
public void openConnection(SerialParameters parameters) 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(SerialParameters parameters) throws SerialConnectionException
SerialConnectionException
public void awaitFrame(int start, int end, int following, int timeout)
start
- character defining the start of a frameend
- character singalling end of framefollowing
- number of bytes after end to wait for (e.g. checksum)timeout
- number of seconds to wait for a frame to complete before givng uppublic void readLine(byte delimiter, int timeout)
delimiter
- The delimiter to recognize the end of linetimeout
- number of seconds to wait at most before giving uppublic void serialEvent(SerialPortEvent e)
public void close()
public boolean isOpen()
public void sendBreak()
public boolean send(java.lang.String data)
public static java.lang.String[] getComPorts()
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |