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.


Constructor Index

 o SerialPort(String, SerialIO)

Method Index

 o dataAvailable()
Checks if data is available in the port.
 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.

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 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.

Parameters:
data - the data to write.

All Packages  Class Hierarchy  This Package  Previous  Next  Index