ewe.io
Class SerialPortSpecs

java.lang.Object
  extended byewe.data.DataObject
      extended byewe.io.SerialPortSpecs
All Implemented Interfaces:
Comparable, Copyable, DataUnit
Direct Known Subclasses:
SerialPortOptions

public class SerialPortSpecs
extends DataObject

SerialPortOptions is a single object that specifies all the currently supported Serial Port options. To open a Serial Port, create one of these objects, setup the


Field Summary
 int baudRate
          The baud rate for communications - defaults to 9600.
 int bits
          The number of data bits - defaults to 8.
 int parity
          This should be one of the SerialPort Parity options - e.g.
 String portName
          The name of the port.
 int stopBits
          The number of stop bits - defaults to 1.
 
Constructor Summary
SerialPortSpecs()
           
 
Method Summary
 SerialPort connect()
          This attempts to create a new Serial Port with the current options.
 
Methods inherited from class ewe.data.DataObject
_getSetField, appendAllFields, compareTo, copied, copyFrom, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getDeclaredFieldValue, getFieldList, getFieldList, getMyFieldList, getNew
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, toString
 

Field Detail

portName

public String portName
The name of the port. On the PC it should be "COM1", "COM2" etc. On Unix/Linux it should be "TTY0" and "TTY1".


baudRate

public int baudRate
The baud rate for communications - defaults to 9600.


stopBits

public int stopBits
The number of stop bits - defaults to 1.


parity

public int parity
This should be one of the SerialPort Parity options - e.g. SerialPort.NOPARITY.


bits

public int bits
The number of data bits - defaults to 8.

Constructor Detail

SerialPortSpecs

public SerialPortSpecs()
Method Detail

connect

public SerialPort connect()
                   throws IOException
This attempts to create a new Serial Port with the current options.

Throws:
IOException - if the Serial Port could not be opened.