|
2008-02-07 1.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.soda.dk.core.EscObject
org.eclipse.soda.dk.connection.Connection
org.eclipse.soda.dk.connection.StreamConnection
org.eclipse.soda.dk.serial.connection.SerialConnection
public class SerialConnection
The SerialConnection class implements the ConnectionService interface to support reading and writing to the serial port.
ConnectionService,
String| Field Summary | |
|---|---|
protected static char[] |
TOSTRING_NAME
Define the tostring name (char[]) constant. |
| Fields inherited from class org.eclipse.soda.dk.connection.Connection |
|---|
CLIENT_WAIT_RESOURCE, CLOSE_RESOURCE, CLOSED_RESOURCE, configurationService, OPEN_RESOURCE, OPENFAILED_RESOURCE, READ_BYTES_RESOURCE, readByteCount, WRITE_BYTES_RESOURCE, writeByteCount |
| Fields inherited from class org.eclipse.soda.dk.core.EscObject |
|---|
CLONE_EXCEPTION_RESOURCE, EMPTY_BYTES, EMPTY_STRING, ERROR_OCCURRED_EXCEPTION_RESOURCE, ID_FILTER_KEY, ID_KEY, ID_KEY_ANY, INTEGER_TABLE, INTEGER_TABLE_SIZE, KEY_KEY, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_TRACE, LOG_WARNING, PREFIX_KEY, RESOURCE_BUNDLE, SLEEP_EXCEPTION_RESOURCE, SYSTEM_INFO_RESOURCE, TO_STRING_CONFIGURATION_KEYS, TRACE_LEVEL_HIGH, TRACE_LEVEL_LOW, TRACE_LEVEL_MAX, TRACE_LEVEL_MIN, TRACE_LEVEL_NONE, TRACE_LEVEL_NORMAL, TRACELEVEL_KEY, UNKNOWN_ERROR_RESOURCE |
| Fields inherited from interface org.eclipse.soda.dk.serial.connection.service.SerialConnectionService |
|---|
BAUDRATE_KEY, COMPORT_KEY, CONNECTION_TYPE, DATABITS_5, DATABITS_6, DATABITS_7, DATABITS_8, DATABITS_KEY, DEFAULT_BAUDRATE, DEFAULT_COMPORT, DEFAULT_DATABITS, DEFAULT_HARDWAREFLOWCONTROL, DEFAULT_PARITY, DEFAULT_READINTERVALTIMEOUT, DEFAULT_READTOTALTIMEOUT, DEFAULT_SOFTWAREFLOWCONTROL, DEFAULT_STOPBITS, DEFAULT_WRITETOTALTIMEOUT, FACTORY_SERVICE_NAME, HARDWAREFLOWCONTROL_KEY, PARITY_EVEN, PARITY_KEY, PARITY_MARK, PARITY_NONE, PARITY_ODD, PARITY_SPACE, READINTERVALTIMEOUT_KEY, READTOTALTIMEOUT_KEY, SERVICE_NAME, SOFTWAREFLOWCONTROL_KEY, STOPBITS_1, STOPBITS_1_5, STOPBITS_2, STOPBITS_KEY, WRITETOTALTIMEOUT_KEY |
| Fields inherited from interface org.eclipse.soda.dk.connection.service.ConnectionService |
|---|
CONNECTION_KEY, DEFAULT_CONNECTION |
| Constructor Summary | |
|---|---|
SerialConnection(ConfigurationService configuration)
Constructs an instance of this class from the specified configuration parameter. |
|
SerialConnection(java.util.Dictionary properties)
|
|
SerialConnection(int portNumber,
int baudRate,
int dataBits,
int parity,
int stopBits,
int hardwareFlowControl,
int softwareFlowControl,
int readTotalTimeout,
int readIntervalTimeout,
int writeTotalTimeout)
Constructs an SerialConnection object using the input
parameter(s). |
|
SerialConnection(java.lang.String portName,
int baudRate,
int dataBits,
int parity,
int stopBits,
int hardwareFlowControl,
int softwareFlowControl,
int readTotalTimeout,
int readIntervalTimeout,
int writeTotalTimeout)
Constructs an instance of this class from the specified port name, baud rate, data bits, parity, stop bits, hardware flow control, software flow control, read total timeout, read interval timeout and write total timeout parameters. |
|
| Method Summary | |
|---|---|
void |
changeBaudRate(int baudRate)
Perform the changeBaudRate action method. |
void |
close()
Perform the close action method. |
java.lang.String |
getOutputName()
Gets the output name (String) value. |
static java.lang.String |
getPortName(int portNumber)
|
long |
getReceivedTotalTimeout()
Gets the received total timeout (long) value. |
java.lang.String |
getType()
Gets the String type property value. |
void |
open()
Perform the open action method. |
int |
read(byte[] bytes)
Read bytes. |
int |
read(byte[] bytes,
int offset,
int length)
Read bytes. |
void |
setReceivedTotalTimeout(long timeout)
|
| Methods inherited from class org.eclipse.soda.dk.connection.StreamConnection |
|---|
flush, getInputStream, getOutputStream, setInputStream, setOutputStream, write, write |
| Methods inherited from class org.eclipse.soda.dk.connection.Connection |
|---|
attemptRecoveryFromError, exit, finalize, getConfigurationService, getDefaultResource, getErrorSeverity, getLogDetails4, getLogDetails5, getReadByteCount, getResource, getWriteByteCount, isOpen, setConfigurationService, setOpen, setReadByteCount, setWriteByteCount, toStringInfo, updateReadByteCount, updateWriteByteCount |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.soda.dk.connection.service.ConnectionService |
|---|
exit, flush, isOpen, write, write |
| Field Detail |
|---|
protected static final char[] TOSTRING_NAME
| Constructor Detail |
|---|
public SerialConnection(int portNumber,
int baudRate,
int dataBits,
int parity,
int stopBits,
int hardwareFlowControl,
int softwareFlowControl,
int readTotalTimeout,
int readIntervalTimeout,
int writeTotalTimeout)
throws java.lang.IllegalArgumentException
SerialConnection object using the input
parameter(s).
int
int
int
int
int
int
int
int
int
int
The exception description.
portNumber - The port number (int) parameter.baudRate - The baud rate (int) parameter.dataBits - The data bits (int) parameter.parity - The parity (int) parameter.stopBits - The stop bits (int) parameter.hardwareFlowControl - The hardware flow control (int) parameter.softwareFlowControl - The software flow control (int) parameter.readTotalTimeout - The read total timeout (int) parameter.readIntervalTimeout - The read interval timeout (int) parameter.writeTotalTimeout - The write total timeout (int) parameter.
java.lang.IllegalArgumentException - Illegal Argument Exception.SerialConnection(String,int,int,int,int,int,int,int,int,int),
SerialConnection(Dictionary),
SerialConnection(ConfigurationService)
public SerialConnection(java.lang.String portName,
int baudRate,
int dataBits,
int parity,
int stopBits,
int hardwareFlowControl,
int softwareFlowControl,
int readTotalTimeout,
int readIntervalTimeout,
int writeTotalTimeout)
throws java.lang.IllegalArgumentException
String) parameter.
The baud rate (int) parameter.
The data bits (int) parameter.
The parity (int) parameter.
The stop bits (int) parameter.
The hardware flow control (int) parameter.
The software flow control (int) parameter.
The read total timeout (int) parameter.
The read interval timeout (int) parameter.
The write total timeout (int) parameter.
Illegal Argument Exception.
portName - The port name (String) parameter.baudRate - The baud rate (int) parameter.dataBits - The data bits (int) parameter.parity - The parity (int) parameter.stopBits - The stop bits (int) parameter.hardwareFlowControl - The hardware flow control (int) parameter.softwareFlowControl - The software flow control (int) parameter.readTotalTimeout - The read total timeout (int) parameter.readIntervalTimeout - The read interval timeout (int) parameter.writeTotalTimeout - The write total timeout (int) parameter.
java.lang.IllegalArgumentException - Illegal Argument Exception.SerialConnection(int,int,int,int,int,int,int,int,int,int),
SerialConnection(Dictionary),
SerialConnection(ConfigurationService)public SerialConnection(java.util.Dictionary properties)
properties - The properties (Dictionary) parameter.SerialConnection(int,int,int,int,int,int,int,int,int,int),
SerialConnection(String,int,int,int,int,int,int,int,int,int),
SerialConnection(ConfigurationService)public SerialConnection(ConfigurationService configuration)
ConfigurationService)
parameter.
configuration - The configuration (ConfigurationService) parameter.SerialConnection(int,int,int,int,int,int,int,int,int,int),
SerialConnection(String,int,int,int,int,int,int,int,int,int),
SerialConnection(Dictionary)| Method Detail |
|---|
public static java.lang.String getPortName(int portNumber)
portNumber - The port number (int) parameter.
String) value.
public void changeBaudRate(int baudRate)
throws java.lang.RuntimeException
int
Runtime Exception.
baudRate - The baud rate (int) parameter.
java.lang.RuntimeException - Runtime Exception.
public void close()
throws java.io.IOException
close in interface ConnectionServiceclose in class StreamConnectionjava.io.IOException - IOException.ConnectionService.close()public java.lang.String getOutputName()
getOutputName in class EscObjectString) value.public long getReceivedTotalTimeout()
long) value.setReceivedTotalTimeout(long)public java.lang.String getType()
String type property value.
String) value.
public void open()
throws java.io.IOException
open in interface ConnectionServiceopen in class Connectionjava.io.IOException - IOException.ConnectionService.open()
public int read(byte[] bytes)
throws java.io.IOException
StreamConnection
read in interface ConnectionServiceread in class StreamConnectionbytes - The bytes (byte[]) parameter.
int) value.
java.io.IOException - IOException.read(byte[],int,int)
public int read(byte[] bytes,
int offset,
int length)
throws java.io.IOException
StreamConnectionb to store the read bytes. the maximum number of bytes
to store in b.
read in interface ConnectionServiceread in class StreamConnectionbytes - The bytes (byte[]) parameter.offset - The offset (int) parameter.length - The length (int) parameter.
int) value.
java.io.IOException - IOException.read(byte[])public void setReceivedTotalTimeout(long timeout)
timeout - The timeout (long) parameter.getReceivedTotalTimeout()
|
2008-02-07 1.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||