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.
-
SerialPort(String, SerialIO)
-
-
dataAvailable()
- Checks if data is available in the port.
-
read()
- Read from the port.
-
run()
-
Keep doing IO on the serial port.
-
wakeup()
- Wake the thread up, data is available.
-
write(Vector)
- Write the data to the port.
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.
wakeup
public synchronized void wakeup()
- Wake the thread up, data is available.
run
public void run()
- Keep doing IO on the serial port.
- Overrides:
- run in class Thread
dataAvailable
public synchronized boolean dataAvailable()
- Checks if data is available in the port.
return the status of data.
read
public synchronized byte read() throws IOException
- Read from the port.
return the byte read from the port.
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