|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--com.systronix.TINI_Serial.MultithreadBlockingRead
Title: SimmSerial Test Program #1 Description: Test the DUART on SIMMSerial using a blocking read Copyright: Copyright (c) 2001 Company: Systronix
| Field Summary | |
static int |
BaudRate
This is the baud rate of the serial port. |
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 |
k
a counting variable used to reduce space on the stack k is used to select a transmit buffer to be transmitted. |
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 |
private static int |
PortNum
PortNum keeps track of which port number is to be initialized for external serial ports. |
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 helps main detect overflows. |
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. |
| Fields inherited from class java.lang.Thread |
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ |
| Constructor Summary | |
MultithreadBlockingRead(javax.comm.SerialPort MyPort,
boolean up)
The constructor sets up the transmit and recieve buffers for the object. |
|
| Method Summary | |
void |
Clear()
flushes the input and output ports for the serial port so no false data is read or written. |
protected void |
finalize()
This code is here because using version 1.02d of the tini tools, external serial ports did not close properly. |
static javax.comm.SerialPort |
InitializeExternalSerialPort(java.lang.String portName)
This function sets up external serial ports before they are actually initialized using javax.comm. |
static javax.comm.SerialPort |
InitializeInternalSerialPort(int PortNum)
InitializeInternalSerialPort initializes the internal TINI serial port, or an external port that has already been set up in the TINI OS. |
static void |
main(java.lang.String[] args)
This version of main starts to child threads running, one for each serial port. |
void |
run()
This version of the serial tester program uses a blocking read to wait for input data before more output data is transmitted. |
void |
TestHandShaking()
TestHandShaking tests to make sure RTS and CTS both go up and down, as well as DTR and DSR. |
| Methods inherited from class java.lang.Thread |
|
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private javax.comm.SerialPort sp
private boolean CountUp
public static final int BaudRate
public static long StartTime
System#currentTimeMillis if the code goes too
long without reading a packet of data, the system prints out the number of packets read
along with the current input and output buffers for both serial ports being tested.private java.io.InputStream in
RecieveDataprivate java.io.OutputStream out
TransmitDatapublic byte[][] TransmitData
public byte[] RecieveData
private int i
private int j
public int k
public boolean Done
public static int TimesThroughLoop
public static final int BytesToTest
public static final int NumberOfPackets
private static int PortNum
| Constructor Detail |
public MultithreadBlockingRead(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 1finalize in class java.lang.Objectsee TINISerial port for more information.public void Clear()
public void run()
run in class java.lang.Threadpublic void TestHandShaking()
public static void main(java.lang.String[] args)
public static javax.comm.SerialPort InitializeExternalSerialPort(java.lang.String portName)
portName - is the name of the external serial port being initialized.
These names match the labels on SimmSerial, serialA and SerialB are the possible parameters.public static javax.comm.SerialPort InitializeInternalSerialPort(int PortNum)
InitializeExternalSerialPort(java.lang.String) to initialize a simmserial external serial port.PortNum- 0
- is TINI internal UART 0. To use this port, call "downserver -s"
from the TINI shell command prompt to stop the shell from using port 0.
InitializeExternalSerialPort(java.lang.String) to initialize SimmSerialInitializeExternalSerialPort(java.lang.String) to initialize SimmSerial
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||