|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
SerialEchoEvent
Simple SerialEcho example, using javaxcomm.
This program receives serial data on any JStamp/JStik/SaJe com port RXD line,
echos it back out the same com port TXD line, and prints the hex value and
ASCII char in Charade.
This is a good basic serial I/O test program.
#echo
initializeSerialPort()
public static final int SBX2CS1 = 0x380080; // SBX2 UART in TINI address space
This will be TINI's "serial2"
| Field Summary | |
static com.dalsemi.system.DataPort |
dp
This DataPort is used to print out and set the stretch cycles on serial ports and is also used to probe UART register values. |
protected java.io.InputStream |
inStream
reference to the serial input stream |
protected java.io.OutputStream |
outStream
reference to the serial output stream |
static int |
PortAddress
PortAddress is the actual address of the port to be used for the serial port in this project. |
static byte |
rcvVal
Last byte read from a serial port |
static int |
SBX2
This constant is the hardware address of sbx2 serial port on TINI |
static int |
SimmSerialA
This constant is the hardware address of SimmSerial port A on TINI |
static int |
SimmSerialB
This constant is the hardware address of SimmSerial port B on TINI |
static int |
whichport
whichport is the port number on TINI. |
| Constructor Summary | |
SerialEchoEvent()
|
|
| Method Summary | |
void |
blockThread()
method to block a thread This lets the main routine do nothin. |
void |
initializeSerialPort()
Method to initialize the serial port and set up the input and output streams - this is where you change the baud rate and com port. |
static void |
main(java.lang.String[] args)
Instantiate our class then wait this thread. |
void |
serialEvent(javax.comm.SerialPortEvent ev)
Javax.comm will call this method whenever a Data Available event occurs On serial ports without hardware flow control this is the only event supported. |
static void |
setExtUartTiming2()
This is a native method declaration. |
| Field Detail |
protected java.io.InputStream inStream
protected java.io.OutputStream outStream
public static final int SimmSerialA
public static final int SimmSerialB
public static final int SBX2
public static int PortAddress
public static com.dalsemi.system.DataPort dp
public static int whichport
public static byte rcvVal
| Constructor Detail |
public SerialEchoEvent()
| Method Detail |
public static void setExtUartTiming2()
public void serialEvent(javax.comm.SerialPortEvent ev)
public void initializeSerialPort()
none, - but edit the source code here to change com port and baud rate.
public static void main(java.lang.String[] args)
public void blockThread()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||