ttytest(1)

TTYTEST(1) ttytest TTYTEST(1)

NAME

ttytest - async read-write test and logical stub for terminal lines

SYNOPSIS

ttytest [options] <tty_dev>

DESCRIPTION

ttytest program is small and simply console test of serial lines (connection between two serial devices). The idea of test is in asynchronous writing test sequence into serial device and, at the same time, reading this test sequence from same device and output data to terminal (tty). For creating a data loopback can be used the standard serial port hardware stub or two serial ports, witch are connected with Nullmodem cable, in the late case at one side must be run ttytest in stub mode (see --mode option). If the result of testing is well then ttytest print "staircase" of unterminated test sequence e.i.:


test test test test test
test test test test test
test test test test test
test test test test test
test test test test test
test test test test test
test test test test test
test test test test test

OPTIONS

ttytest support short and long options of POSIX.

-h --help
Show command line help.
-V --version
Show version information.
-v --verbose
Increase verbosity (debug output).
-dSTRING, --data-string=STRING
Option customise the test STRING. Value:

"test test test test test"

is used by default.

EXAMPLE: ttytest --data-string="THIS IS A CUSTOM TEST STRING!!!"

-e, --enum-strings
If this option is set then the data-string is enumerated before write to device. Seqence is :


1 test test test test test
2 test test test test test
3 test test test test test
4 test test test test test

-u, --no-offset
this option disable autoinsert periodical offset ( "staircase") before test string


test test test test test
test test test test test
test test test test test
test test test test test

-pSECONDS, --pause=SECONDS
Option set a sleep interval in SECONDS ( decimal notation can be used ) before start of test ( no pause by default )
-mMODE, --mode=MODE
Option set a start MODE of ttytest. The MODE can be set into values "loopback", "read", "stub", "terminal" and "write". Value of MODE is case insensitive.

loopback: in this ( default ) mode the ttytest creates a two async threads for receiver and transmitter. The transmitter thread of ttytest write the test STRING configured by -d, -e, -u options into serial device (<tty_dev>) . Transmitter process can be controlled by -a, -w and -q options. At the same time, the receiver thread read data from same device and write received data to ttytests standard output.

stub: in this mode the ttytest implement a "logical stub". Program read any data from serial device ( <tty_dev> ) and write this data backward. The readed data writted to ttytests standard output as the same in loopback mode

terminal: is same as loopback, so transmitter read data from standard input ( keyboard ) and write it to serial device ( <tty_dev> ).

read: in this mode work only receiver.

write: in this mode work only transmitter.

-a, --adaptive-tx
if this option is set the transmitter support output queue with maximal empty state. For control of the queue transmitter use a statistic from TIOCGICOUNT IOCTL return. If -q or -w options are presented then -a has no effect.
-w, --wait-tx
if this option is set then the transmitter wait ( tcdrain function used ) of complete data transfer after writing every test STRING
-qCOUNT, --queue-size=COUNT
this option set the maximal COUNT of characters in the output transmitter queue. Transmitter use a TIOCOUTQ IOCTL for control of the queue size.
-s, --send-interval=SECONDS
the option set a time between sending of two test strings in SECONDS ( decimal notation can be used ) By default the sended data stream is unterminated.
-x, --hex-dump
if this option is set then the readed from serial device ( <tty_dev> ) bytes printed to output as hex dump. The option has effect only in sttub mode.
-BBAUD, --tty-baud=BAUD
set a tty BAUD rate ( 50, 100, 200 ... )
-WBITS, --tty-databits=BITS
set a data BITS count ( 1..8 )
-SBITS, --tty-stopb=BITS
set a tty stop BITS ( 1, 1.5, 2 )
-PPARITY, --tty-parity=PARITY
set PARITY check control. Value of PARITY can be one of "no", "odd","even", "mark" and space
-R, --tty-crtscts
RTS/CTS flow control can be used
-C, --tty-codepage
tty remote codepage in iconv style (MTK-2 included)
-N, --tty-nonprint_show
tty show nonprintable registry switches chars (in MTK encoding)
-U, --mtk-rprefix
tty registry chars in MTK encoding must be prefixed
-X, --tty-xonxoff
Xon/Xoff flow control can be used
-D, --tty-dsr
reciever is DSR sensibility

EXAMPLES

Quick usage:


Connect COM1 and COM2 ports with nullmodem cable
Open two consoles
Execute at one console the command
ttytest --mode=stub /dev/ttyS1
Execute at two console the command
ttytest --mode=loop /dev/ttyS0


Or


Connect a hardware stub to COM1 port
Open a console and execute the command
ttytest /dev/ttyS0


See at consoles the "staircase" of test strings.

SEE ALSO

stty(1) ioctl_list(2)

26 November 2008 ttytest 1.1