home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
sysutl
/
comsnd14.arc
/
COMSEND.DOC
next >
Wrap
Text File
|
1988-11-08
|
10KB
|
258 lines
COMSEND (Version 1.40)
(C) Copyright 1988 Venu P. Gopal
All Rights Reserved.
-------------------------------------------------------------------------------
DISTRIBUTION NOTICE
This program may be freely distributed to anyone as long as the documentation
(COMSEND.DOC) and the program (COMSEND.EXE) are in no way modified (except for
the configuration) and the program and the documentation are distributed
together.
-------------------------------------------------------------------------------
NAME
comsend - send file(s) over the serial communications line
SYNOPSIS
comsend [-options] file1 file2 ...
DESCRIPTION
COMSEND is a program that will send files over a communications line
connected to one of the serial ports (COM1: or COM2:) of the PC.
COMSEND will automatically set up the speed, parity, number of data
bits and stop bits for the serial port before sending the file(s).
It can also use flow control.
In addition, COMSEND can go through a sequence of operations
needed to establish the connection. This sequence is specified by a
string of characters called the CONNECT SEQUENCE.
After the connnection is established and the file(s) transmitted,
COMSEND can go through another sequence of operations to disconnect.
This sequence is specified by the DISCONNECT SEQUENCE.
If no filename is specified, the standard input is used. Wildcard
characters are allowed in filenames.
CONFIGURATION
COMSEND needs to be configured to set up the default parameters
(speed, parity, connect/disconnect sequences etc.). In order to
configure COMSEND, `cd' to the directory that contains COMSEND.EXE
and enter
comsend -C
For each parameter, the choices are displayed along with the
current value. To keep the current value, press the return key.
To change it, enter a value from the choices displayed.
Configuration cannot be done if COMSEND.EXE file is not in the
current directory or is READ-ONLY.
COMMAND LINE OPTIONS
Any of the configured values may be overridden during execution
of the program by entering a command line option. For example,
entering "comsend -b1200 somefile" will use 1200 baud even though
COMSEND may be configured for 9600 baud.
Available command line options are:
-bxxxx use baud rate xxxx. xxxx = 110, 150, 300
600, 1200, 2400, 4800 or 9600
-px use parity x. x = N, O or E
N=none, O=Odd parity, E=Even parity
-nx use x as number of data bits. x = 7 or 8
-sx use x as number of stop bits. x = 1 or 2
-mx use serial port COMx:. x = 1 or 2
-fx use x as flow control. x=D for DTR/CTS, X for XON/XOFF,
N for No flow control
-cx..x use connect sequence x..x. Sequence x..x should not contain
any spaces - use \s for a space
(see section on connect/disconnect sequences)
-dx..x use disconnect sequence x..x. Sequence x..x should not contain
any spaces - use \s for a space
(see section on connect/disconnect sequences)
-v verbose mode: displays incoming characters and additional
information (see NOTES section)
-C Configure COMSEND (see CONFIGURATION section)
CONNECT/DISCONNECT SEQUENCES
These are two sequences of commands that are to be executed
in order to establish connection and break the connection.
These sequences are specified during configuration
and may be overridden by the -c and -d command line options.
The list of commands available is shown below:
t Toggle DTR (set low (0), delay, set high (1)).
Delay duration 500 ms unless set by command T (below).
Tnnn Set DTR toggle time period to nnn X 0.1 seconds.
'nnn' MUST be a 3 digit number - 000 to 999
(0 to 99.9 seconds).
b Send break.
Duration 200 ms unless set by command B (below).
Bnnn Set break time period to nnn X 0.1 seconds.
'nnn' MUST be a 3 digit number - 000 to 999
(0 to 99.9 seconds).
p Pause for 0.5 seconds.
P Pause for 2 seconds.
Dnnn Pause (delay) for nnn X 0.1 seconds.
'nnn' MUST be a 3 digit number - 000 to 999
(0 to 99.9 seconds)
r Transmit a carriage return over the COM port.
n Transmit a line feed (newline) over the COM port.
R Transmit a carriage return followed by a line feed
over the COM port.
"xx..xx" Transmit the string in quotes over the COM port.
The string may contain special characters (\r,\n,
\" etc. - listed in the next section).
d"xx..xx" Display the string in quotes on screen.
The string may contain special characters.
m"xx..xx" Try to match the characters received over the
communications line with the string in quotes.
If the match FAILS, COMSEND issues an error
message and ends.
The string may contain special characters.
The time period over which COMSEND will wait to find
a match may be set by command M (below).
After a command m, it is a good idea to use a command
p, P or dnnn followed by a command f to make sure
that all characters received after the match will
be read and flushed before the next operation.
Mnnn Set timeout for the m command to nnn seconds.
'nnn' MUST be a 3 digit number - 000 to 999
(0 to 999 seconds). The default is 20 seconds.
q"xx..xx""yy..yy"
Try to match the characters received over the
communications line with the first quoted string.
If the match SUCCEEDS, COMSEND displays the second
string and ends.
Both strings may contain special characters.
The time period over which COMSEND will wait to find
a match may be set by command Q (below).
If the second string is to be empty, use "".
After a command q , it is a good idea to use a command
p, P or dnnn followed by command f to make sure
that all characters received after the match will
be read and flushed before the next operation.
Qnnn Set timeout for command q to nnn seconds.
'nnn' MUST be a 3 digit number - 000 to 999
(0 to 999 seconds). The default is 5 seconds.
e Turn echo mode on. Displays incoming characters
as they are read by one of the other commands.
E Turn echo mode off (see command e).
f Flush receive buffer. It is a good idea to use one of
the delay commands (p,P,dnnn) before this.
If verbose mode is turned on from the command line,
characters will be displayed as they are flushed.
EXAMPLE: For example, the connect sequence PRp"dial"m"no""123\r"
will cause the following to occur before file transmission:
1) Pause for 2 seconds.
2) Transmit a carriage return followed by a linefeed.
3) Pause for 0.2 seconds.
4) Transmit the string "dial"
5) Wait till the string "no" is received.
6) Transmit the string "123" followed by a carriage return.
SPECIAL CHARACTERS ALLOWED IN STRINGS
The following special characters are allowed in strings (i.e. within
double quotes) :
\r carriage return (without an added linefeed)
\n line feed (newline)
\f formfeed
\s space
\e escape
\b backspace
\\ the character `\'
\" the character `"'
\nnn the character with ascii code nnn (3 digits, DECIMAL)
For example, the string "\fmyname\r\n\f" consists of a
formfeed followed by `myname' followed by a <CR>, a <LF> and a
formfeed.
NOTES ON WRITING CONNECT/DISCONNECT SEQUENCES
Use of a command p, P or dnnn followed by a command f is recommended
before sending a reply to the device being communicated with.
This ensures that all characters that were sent by the device are
read before the device is replied to.
The results obtained when using the verbose or echo mode may be
different from when not using it: this is because in these modes,
the program runs slower and the receive buffer is not emptied out
as fast.
While transmitting the file(s), all characters that are received
accumulate in the receive buffer. These may be displayed by
placing appropriate commands in the disconnect sequence.
Flow control is used only for transmission.
If a connect fails, COMSEND will still try to disconnect using
the disconnect sequence.
All screen output maybe redirected into a file.
VERSION HISTORY
V 1.40 - Allows upto 173 chars in the Connect Sequence.
V 1.30 - Allows path name for files.
Allows multiple files to be transmitted.
Allows wild card characters in filenames.
Changed format of connect/ disconnect sequences.
Sets exit error code that may be tested with the "errorlevel"
command in batch files (Codes: 1=command line error,
2=some files not found, 3=no files found, 4=connect error,
5=disconnect error, 6=connect and disconnect error).
V 1.21 - Fixed a bug that gave invalid communication errors
V 1.20 - Changed format of connect/disconnect sequences
V 1.10 - First official release.