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.
-
byteToggle
- Selects if the lastData byte is not to be stored.
-
inputData
- Data read from the port.
-
lastData
- The last byte read in, so the system can store the pairs of bytes.
-
outputData
- Data to be written to the port.
-
serialPort
- The serial port to write the data to.
-
testPort
- Test port value.
-
SerialIO(String)
- Make the serial port with the port given.
-
flushInputData()
- Clear any data waiting to be read.
-
flushOutputData()
- Clear any commands waiting to go out.
-
outputAvailable()
- Checks if there is any available data to be written to the serial port.
-
outputData()
- Gets the next command to be written to the serial port.
-
read()
- Read from the port.
-
setReadData(byte)
- Add data that read in from the serial port.
-
write(String)
- Write the data to the port.
testPort
private final String testPort
- Test port value.
serialPort
private SerialPort serialPort
- The serial port to write the data to.
inputData
private Vector inputData
- Data read from the port.
outputData
private Vector outputData
- Data to be written to the port.
lastData
private byte lastData
- The last byte read in, so the system can store the pairs of bytes.
byteToggle
private int byteToggle
- Selects if the lastData byte is not to be stored.
SerialIO
public SerialIO(String port)
- Make the serial port with the port given.
param port serial port location.
read
public synchronized byte read() throws IOException
- Read from the port.
return the byte read from the port.
flushInputData
public synchronized void flushInputData()
- Clear any data waiting to be read.
flushOutputData
public synchronized void flushOutputData()
- Clear any commands waiting to go out.
setReadData
public synchronized void setReadData(byte data)
- Add data that read in from the serial port.
- Parameters:
- data - the byte read from the port.
write
public synchronized void write(String data) throws IOException
- Write the data to the port.
param data the data to write.
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.
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