All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pinball.io.SerialIO

java.lang.Object
   |
   +----pinball.io.SerialIO

public class SerialIO
extends Object
Class for allowing IO via the serial port.


Variable Index

 o byteToggle
Selects if the lastData byte is not to be stored.
 o inputData
Data read from the port.
 o lastData
The last byte read in, so the system can store the pairs of bytes.
 o outputData
Data to be written to the port.
 o serialPort
The serial port to write the data to.
 o testPort
Test port value.

Constructor Index

 o SerialIO(String)
Make the serial port with the port given.

Method Index

 o flushInputData()
Clear any data waiting to be read.
 o flushOutputData()
Clear any commands waiting to go out.
 o outputAvailable()
Checks if there is any available data to be written to the serial port.
 o outputData()
Gets the next command to be written to the serial port.
 o read()
Read from the port.
 o setReadData(byte)
Add data that read in from the serial port.
 o write(String)
Write the data to the port.

Variables

 o testPort
 private final String testPort
Test port value.

 o serialPort
 private SerialPort serialPort
The serial port to write the data to.

 o inputData
 private Vector inputData
Data read from the port.

 o outputData
 private Vector outputData
Data to be written to the port.

 o lastData
 private byte lastData
The last byte read in, so the system can store the pairs of bytes.

 o byteToggle
 private int byteToggle
Selects if the lastData byte is not to be stored.

Constructors

 o SerialIO
 public SerialIO(String port)
Make the serial port with the port given. param port serial port location.

Methods

 o read
 public synchronized byte read() throws IOException
Read from the port. return the byte read from the port.

 o flushInputData
 public synchronized void flushInputData()
Clear any data waiting to be read.

 o flushOutputData
 public synchronized void flushOutputData()
Clear any commands waiting to go out.

 o setReadData
 public synchronized void setReadData(byte data)
Add data that read in from the serial port.

Parameters:
data - the byte read from the port.
 o write
 public synchronized void write(String data) throws IOException
Write the data to the port. param data the data to write.

 o outputAvailable
 public synchronized boolean outputAvailable()
Checks if there is any available data to be written to the serial port.

Returns:
if output data is available.
 o outputData
 public synchronized Vector outputData()
Gets the next command to be written to the serial port.

Returns:
The data to be written to the serial port.

All Packages  Class Hierarchy  This Package  Previous  Next  Index