|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--serialComm
This is the serial communication class for the Seeker robot. It is based on the code from the CMUcamGUI demo program, but has been modified to use javax.comm
| Field Summary | |
(package private) static javax.comm.CommPortIdentifier |
commPortId
Reference to the javax.comm comm port |
(package private) static char |
four
Used by the readNum() function to convert the received characters into a single number. |
protected java.io.InputStream |
inStream
Reference to the serial input stream |
(package private) static char |
one
Used by the readNum() function to convert the received characters into a single number. |
protected java.io.OutputStream |
outStream
Reference to the serial output stream |
(package private) static javax.comm.SerialPort |
serialPort
Reference to the javax.comm serial port |
(package private) static char |
three
Used by the readNum() function to convert the received characters into a single number. |
(package private) static java.util.Date |
time
Used to check for serial timeouts when reading data in. |
(package private) static java.util.Date |
time2
Used to check for serial timeouts when reading data in. |
(package private) static char |
two
Used by the readNum() function to convert the received characters into a single number. |
(package private) static int |
val
Tmp storage used to hold read data before returning it. |
(package private) static long |
wdTimer
Used to check for serial timeouts when reading data in. |
| Constructor Summary | |
(package private) |
serialComm(java.lang.String commPort,
int Baudrate)
Calls initializeSerialPort to open and configure the serial port. |
| Method Summary | |
void |
initializeSerialPort(java.lang.String commPort,
int Baudrate)
Method to initialize the serial port (N81) at the given baud rate and set up the input and output streams. |
int |
readByte()
Reads in a byte of data from the serial port. |
char |
readNonBlock()
Checks to see if any data is waiting to be read. |
int |
readNum()
Reads in an ascii number and returns an int. This function blocks. |
void |
writeStr(java.lang.String in)
Sends the input string of characters out the serial port. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected java.io.InputStream inStream
protected java.io.OutputStream outStream
static javax.comm.SerialPort serialPort
static javax.comm.CommPortIdentifier commPortId
static char one
static char two
static char three
static char four
static java.util.Date time
static java.util.Date time2
static long wdTimer
static int val
| Constructor Detail |
serialComm(java.lang.String commPort,
int Baudrate)
commPort - Desired comm port to open.Baudrate - Baud rate to open the serial port at.| Method Detail |
public int readNum()
public int readByte()
public char readNonBlock()
public void writeStr(java.lang.String in)
in - String of btyes to write.
public void initializeSerialPort(java.lang.String commPort,
int Baudrate)
commPort - Desired comm port to open.Baudrate - Baud rate to open the serial port at.
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||