All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pinball.io.SerialPort

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----pinball.io.SerialPort

public class SerialPort
extends Thread
Reads and writes data to the serial port.


Variable Index

 o serialIO
The area where serial data is stored.
 o serialPortIn
The input from the port.
 o serialPortOut
The output to the port.

Constructor Index

 o SerialPort(String, SerialIO)

Method Index

 o dataAvailable()
Checks if data is available in the port.
 o pause()
The thread is waiting for data to become available.
 o read()
Read from the port.
 o run()
Keep doing IO on the serial port.
 o wakeup()
Wake the thread up, data is available.
 o write(Vector)
Write the data to the port.

Variables

 o serialPortOut
 private DataOutputStream serialPortOut
The output to the port.

 o serialPortIn
 private DataInputStream serialPortIn
The input from the port.

 o serialIO
 private SerialIO serialIO
The area where serial data is stored.

Constructors

 o SerialPort
 public SerialPort(String port,
                   SerialIO io)
Parameters:
port - the port of the serial port.
io - the location of to store and get the data for the port.

Methods

 o wakeup
 public synchronized void wakeup()
Wake the thread up, data is available.

 o pause
 private synchronized void pause()
The thread is waiting for data to become available.

 o run
 public void run()
Keep doing IO on the serial port.

Overrides:
run in class Thread
 o dataAvailable
 public synchronized boolean dataAvailable()
Checks if data is available in the port. return the status of data.

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

 o write
 public synchronized void write(Vector data) throws IOException
Write the data to the port. param data the data to write.


All Packages  Class Hierarchy  This Package  Previous  Next  Index