testspd.h


Headers Index Help      Within this page: Functions Constants Variables


Overview

testspd, a SerialPort client used for testing.

This is a test harness for libsp.a, the C SerialPort interface and spd, the serial port server. It is designed for regression testing within the spd_regress script.

The program runs one or more test scripts, which are files named on the command line. The only acceptable option, apart from -?, is the debug option, -d. This causes diagnostic output on stderr. Progressively more debug options cause additional diagnostic detail to be output.

Within a script blank lines and comment lines starting with # are ignored. The commands prefixed by sp_ correspond to the functions in the C SerialPort interface though the parameters may differ in number and order. The other commands have been added to make the scripting language easier to use. Commands must be written on a single line and may be followed by a comment which starts with a #. A command consists of a command word that may be followed by a number of space separated parameters. Commands are documented below:

pause 999
pause the script for 999 milliseconds. This has nothing to do with the SerialPort interface. It is a convenience function that makes scripting easier.
login name [password]
Login sequence. The password is only needed if the login name demands one. This command is built from SerialPort interface functions combined with conditional expressions that the scripting language doesn't support.
sp_create hostname port
start a SerialPort session
sp_delete
end a SerialPort session
sp_listports
list available serial ports
sp_open serialport
open a serial port
sp_close TRUE|FALSE
close the serial port
sp_setport baud dbits parity sbits
set port conditions
sp_getport
display port operating conditions
sp_delay delay
set transmission delay between characters
sp_setsep active sepchar external
set field terminator active/inactive, specify the terminator character and specify it as external/part of the field. Active and external are T/F, t/f or 1/0. The separator character may be a normal character, \n (system newline), \r (CR), \l (LF), \t (tab) or \0 (null). Any other character prefixed with \ takes its own value.
sp_reset line_settings tx_delay separator
cause the line settings, tx delay and record separator to be selectively reset to default values. All three parameters are T/F, t/f or 1/0. If a parameter is T,t or 1 the associated set of control values are reset.
sp_put text
send data
sp_get 999
retrieve up to 999 characters
sp_echo text 999 adj
send 'text', wait adj mS, receive up to 999 chars
sp_query
display bytes in input and output queues
sp_sleep 999 adj
wait while up to 999 chars are received + adj mS

SerialPort - serial connections for Java
Copyright (C) 2005 Martin C Gregorie

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Contact Martin Gregorie at martin@gregorie.org


Public functions were not declared.
Public constants were not declared.
Public variables were not declared.
Return to the top