|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.systronix.TINI_Serial.HandshakingEvents
Title: Handshaking Events Description: Test the DUART on SIMMSerial using events, This code actually uses a combination of events and a blocking read. This illustrates the point that TINI may not recieve as many events as bytes, try to packetize your information and read all available serial information in the serial event thread. Copyright: Copyright (c) 2001 Company: Systronix
| Field Summary | |
static int |
BytesToTest
BytesToTest is the packet size used in the current test. |
private boolean |
CountUp
CountUp determines whether the output stream counts up from 0 or down from 255. |
boolean |
Done
Done tells the reporting thread when the serial test is done so it can print out data. |
private int |
i
a counting variable used to reduce space on the stack |
private java.io.InputStream |
in
The input stream used to read data into RecieveData |
private int |
j
a counting variable used to reduce space on the stack |
int |
num
num does not neccesarily have to be a class variable anymore. |
static int |
NumberOfPackets
NumberOfPackets is the number of packets sent before a test passes. |
private java.io.OutputStream |
out
The output stream used to write data from the buffers in TransmitData |
byte[] |
RecieveData
This is where data is stored to be compared to what is transmitted. |
private javax.comm.SerialPort |
sp
this instance variable is the serial port being used by this class. |
static long |
StartTime
StartTime is the time a packet was last read. |
static int |
TimesThroughLoop
TimesThroughLoop is a count of the number of packets actually sent through both serial ports. |
byte[][] |
TransmitData
This is a byte array array so multiple patterns can be written out the serial port. |
| Constructor Summary | |
HandshakingEvents(javax.comm.SerialPort MyPort,
boolean up)
The constructor sets up the transmit and recieve buffers for the object. |
|
| Method Summary | |
void |
Clear()
Clears the requested uart so no residual erroneous data is sent or recieved. |
protected void |
finalize()
This code is here because using version 1.02d of the tini tools, external serial ports did not close properly. |
static void |
main(java.lang.String[] args)
This version of main sets up event listeners on each serial port so that the user will be notified if a serial error occurs. |
void |
serialEvent(javax.comm.SerialPortEvent Ev)
This is the event handler function. |
void |
TestHandShaking()
TestHandShaking tests to make sure RTS and CTS both go up and down, as well as DTR and DSR. |
| Field Detail |
private javax.comm.SerialPort sp
private boolean CountUp
public static long StartTime
private java.io.InputStream in
RecieveDataprivate java.io.OutputStream out
TransmitDatapublic byte[][] TransmitData
public byte[] RecieveData
private int i
private int j
public int num
public boolean Done
public static int TimesThroughLoop
public static final int BytesToTest
public static final int NumberOfPackets
| Constructor Detail |
public HandshakingEvents(javax.comm.SerialPort MyPort,
boolean up)
MyPort - is the serial port for this tester object to use.up - determines whether the output stream will count up or down.| Method Detail |
protected void finalize()
com.dalsemi.system.TINIOS#enableSerialPort1 to use serial port 1see TINISerial port for more information.public void Clear()
public void serialEvent(javax.comm.SerialPortEvent Ev)
MultithreadBlockingRead because it
uses events to wait for serial data instead of using a blocking read. Both tests test the serial
handshaking lines to make sure they are set and reset when the calls through the api are made.public void TestHandShaking()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||