home *** CD-ROM | disk | FTP | other *** search
- If QTERM is invoked with no arguments, it starts up, and after signing
- on, you are immediately connected with the modem. If an argument file
- is provided, then it is assumed to be a chat script (see 'X'), and the
- chat script is immediately activated. With this file as with all others
- that can be entered, user numbers can be included in the filespecification:
- B3:CHAT.XYZ will look for the file in user area 3 on drive B: Either the
- drive or the user alone can be given: A:FOO.FOO and 7:BAZ.BAR are both
- acceptable, anything not given defaults to the current values. On
- completion of the chat script, command passes to normal connected
- operation. All special actions are initiated by typing the escape
- character, what happens next is determined by the next character typed.
- Note that while all letters here are shown in upper case, lower case works
- equally well: so <escape> b also activates the code to set the baud rate.
- As delivered, the escape character is set to control backslash, however it
- can be changed by patching QTERM: see QTERM.PAT for details, so to print
- help type '^\' '?', etc. In all the descriptions that follow, references to
- the escape character refer to this (i.e. '^\' and not the ESC key - '^[')
-
-
- Retyping the escape character (i.e. typing it twice) sends a single copy
- of the escape character to the remote system.
-
-
- Other characters and what they do are:
-
- ? - Print help - QTERM provides a brief synopsis of the available commands.
-
- . - Send a break - If QTERM has been patched to do it, this will transmit
- a tenth of a second break.
-
- , - Hang up modem - This is done by deactivating DTR for a short time, which
- causes most modems to hang up. Again QTERM has to be patched to do this.
- Alternatively, if your modem doesn't respond to DTR, it is possible to
- have QTERM transmit a string to cause a hangup: for example the
- '<delay> +++ <delay> ATH0'
- as required by a HAYES compatible modem.
-
- B - Change baud rate and mode - This will first prompt you, your response
- must look like the following:
-
- nnnn
- nnnn mmm -x y z
- * mmm
-
- where 'nnnn' is a number specifying the baud rate. Up to eight options
- are available: 300 600 1200 2400 4800 9600 19200 and 38400, although not
- all of these may be enabled. 'mmm' is a byte format specifier made up
- of three characters. The first must be '7 ' or '8' to specify the number
- of data bits; the second 'E', 'O', or 'N' for even, odd, or no parity;
- and the third '1' or '2' for the number of stop bits. The * in the last
- example is used as a place holder when the mode is to be changed, but
- not the baud rate. So, for example: '1200' would change to 1200 baud
- leaving the mode as is; '300 8n1' would switch to 300 baud, and select
- 8 data bits, no parity, and 1 stop bit; and '* 7E2' would change the
- format to 7 data bits, even parity, and 2 stop bits, while leaving the
- baud rate alone. The '-' option is a way of specifying three delays
- that can be set. The first is a delay in seconds after a control S is
- sent. QTERM uses ^S / ^Q as flow control, to turn off transmission at
- the remote end while it is writing to disk or the printer (see 'C' catch
- and 'O' printer output). Since some systems take longer to respond to a
- ^S than others, the delay time can be changed. QTERM starts up with one
- second of delay, but by specifying -3 or -6 or whatever, this delay can
- be changed. -0 is possible, but not recommended unless your remote system
- responds instantly. The second number is a delay in milliseconds between
- character sends in 'P' transmits (see below). Note that this time is
- the time between the start of each character transmission, rather than
- a time between the end of one and the start of the next. So if this
- delay was set to 15 milliseconds at 1200 BPS, where each character
- takes about 8 milliseconds to transmit, there would be 8 milliseconds
- spent sending the character, and then 7 milliseconds of idle time: the
- total being 15. The third number is the delay at the end of a line in
- 'P' transmission: this is also a count of milliseconds, and this delay
- occurs after transmission of a carriage return. Note that it is possible
- to selectively set these values: if a '*' is entered as a place holder
- then the delay value for that position will not be changed, i.e.
-
- -* 20
-
- would leave the ^S delay alone, set the character delay to 20
- milliseconds, and leave the end of line delay alone. Note that while
- the 'nnn' option for setting the communication mode requires a place
- holder, the -x option is detected by the '-'. Hence no place holder
- is needed, but the -x must be the last thing on the line. So:
-
- 300 -2 * 200
- * 7o2 -1 15
- -4 20 300
-
- are all acceptible commands, but:
-
- 2400 -2 8n1
-
- will set the baud rate to 2400, the ^S delay to 2 seconds, but will not
- change the communication mode. Instead it would do undefined things to
- the character and end of line delays. Although QTERM always claims to
- have made the changes to the baud rate and communication mode, they will
- only happen if the necessary patches are applied. Note that for the
- second character of the mode specifier, both lower and upper case are
- accepted.
-
- C - Open an input catch file - This prompts for a filename, and then opens
- that file for output. All subsequent data received up the line from the
- modem port will be written to the file.
-
- Y - Put catch file on hold - This keeps the output file open, but temporarily
- disables transfer of data. A second <escape> 'Y' will re-enable capture
- of data.
-
- Z - Close a catch file - This closes the output file, and disables data
- capture until another catch file is opened.
-
- D - Display local directory - This prompts for a single CP/M wildcard
- file specificier, and then lists all files that match. Note that an
- empty filename is assumed to be '*.*'. This option will only work
- with CP/M 2.2 and compatible systems: it is disabled under CP/M 3.0.
- When the files are being printed, QTERM will stop after each screenful
- (23 lines), hitting return will print a single line, any other key will
- print a full page.
-
- E - Toggle remote echo - This toggles echo to the remote system. This will
- most likely be used when the remote system is a terminal or another
- computer running a terminal program. It causes all characters received
- from the modem to be re-transmitted back to the modem, creating the
- impression that the far end is running in half duplex mode. Caution
- should be used to make sure that you don't set up an 'infinite loop'
- where the remote system is also echoing: because then the first
- character that returns will be sent out again by QTERM, to be returned
- by the remote, to be sent out again by QTERM .....
-
- H - Toggle half duplex - This simply causes all keyboard input to be
- echoed to the screen.
-
- I - Print status Information - This prints a summary of QTERM's current
- state, showing the state of the various toggles, delays, what the
- current drive and user are, etc.
-
- J - Junk control characters - This causes QTERM to discard all control
- characters received from the remote system that are not considered
- important. Important control characters are: carriage return (0x0d);
- linefeed (0x0a); backspace (0x08); tab (0x09); and escape (0x1b).
- In this mode, if the remote system is sending characters with the
- MSB set, and bit 7 masking is not enabled (see 'M'), then all
- characters with bit 7 set will also be discarded.
-
- L - Toggle linefeed transmit for 'P' - When 'P' is used to send a file to
- the remote system, it normally transmits all useful characters: i.e.
- all printable ascii characters from ' ' to '~', tabs, and carriage
- returns. This toggle ensables the transmission of line feeds, for
- cases where it is needed. Note that when QTERM starts, this is off,
- i.e. the default is not to transmit linefeeds.
-
- M - Toggle bit 7 mask - When this is enabled, all characters received from
- the remote have the most significant bit stripped. This may be useful
- when QTERM is running in 8n1 mode, but the remote is transmitting in
- 7e1 mode - the top bit will contain parity, and this strips it off.
-
- N - New default drive and user. This will prompt, and allow entry of a drive
- user specification (i.e 'A7:' or 'B14:' or 'C:' or '9:'), this then
- becomes the default for all file operations. Note that it is possible
- to user the CP/M BDOS functions to set drive and user during the entry
- hook code (see QTERM.PAT), so if the entry code selects D2:, and all
- scripts are on D2: just entering QTERM SCRIPT at the CCP prompt would
- find SCRIPT on D2:. Also note that after the entry hook code, QTERM makes
- a note of where it is (i.e. in the above case D2: ) When a chat script
- is invoked with the 'X' command, QTERM will first look at the drive
- given, or on the default if no drive is specified. If that fails, then
- QTERM will take a second look in the drive/user area as saved after the
- entry hook. The rationale behind this is to place all chat scripts in
- one place: these can subsequently move the default around (see the '!'
- section of chat scripts), or 'N' commands can be used to move around.
- However it does not matter what the current default drive/user is, QTERM
- can always find the scripts by lookng back at the area it noted.
-
- O - Toggle output to the printer - This simply toggles a switch that causes
- all data received to be transmitted to the printer.
-
- P - Print a file to remote - This prompts for a filename, and then transmits
- that file to the remote system. While this transfer is in progress, the
- keyboard is ignored, except that typing control 'X' will cancel the
- transfer. Note that the 'L' command may come in useful with this command,
- check how your remote system behaves.
-
- T - Type a local file - This also prompts for a filename, and then prints that
- file to the screen locally. While this is in progress, a control 'X' will
- cancel it, Output can also be paused by typing control 'S', which will
- halt until another character is typed. If this character is control 'X'
- the output will be aborted, any other continues the printout.
-
- V - Toggle VT100 emulation. This function requires the following screen
- abilities be specified before it will work (see QTERM.PAT for details):
- clear to end of line, and clear to end of screen. Note that the VT100
- emulation is as complete as it can be, however the alternate character
- sets and display attribute commands will not be recognised.
-
- W - Toggle split window mode. This requires that the insert line and delete
- line screen abilities be specified (see QTERM.PAT for details). It puts
- QTERM into a mode where send and receive text are shown in two separate
- windows. This can be useful when using QTERM to communicate with another
- communication program running in terminal mode, because it keeps what
- is typed on the keyboard separate from what is received from the remote
- system. After selecting window mode, QTERM prompts for window size: there
- are two options, 'b' or 's' (big or small). This refers to the receive
- window: when small, the screen is split exactly in half: 11 lines for
- both send and receive. Big mode makes the receive window 18 lines deep,
- the send window is only 4 lines: this will be useful when far more text
- is being received than is being sent.
-
- R - Receive a file using protocol - This option prompts for a mode and
- optional receive file information. Xmodem and Kermit are both supported.
- Respond with 'k' to go into Kermit receive, or 'x' to go into Xmodem
- receive. Normally files are received on the current default drive,
- however by entering a drive or a user (e.g. 'k b7:') files will be
- received in the specified location. In addition, if Xmodem is not
- being used in batch mode, a filename can be given here. Non-batch
- Xmodem has a default filename, this can be used to override it. Note
- that a space MUST be present between the k or the x and the
- filename / drive specification for proper operation. Normally QTERM
- is silent, however if an 'a' option is given immediately after the
- 'x' or 'k' (as in 'ka c4:') QTERM will alert on termination of transfer
- by ringing the terminal bell. While the transfer is in progress, a
- control 'X' will abort it.
-
- S - Send a file using protocol - This also prompts, the response should be
- 'k filelist ....' or 'x filelist ....' where 'filelist ....' is a list
- of CP/M filespecifiers: wildcards are permitted. Single filespecifiers
- are separated from one another by spaces, and there must be a space
- before the first filespecifier. There are options that can be given
- immediately following the k / x. For Kermit, the only option available
- is a 'b' that forces binary mode. Kermit usually sends files in text
- mode (i.e. 0x1a is taken as end of file) - If you want to transfer a
- binary file, specify the mode as 'kb filename.com'. Xmodem has the
- following options: 'b' - use Xmodem batch (AKA Modem7 batch mode);
- 'y' - use Ymodem batch mode; 'k' - use 1K packets. So 'xbk a12:*.com'
- would send all .COM files on drive A:, user area 12, using Modem7
- batch mode and 1K packets. To match names to various combinations:
- xyk will give true Ymodem (known sometimes as ymodem batch), xk gives
- Xmodem 1K (sometimes incorrectly called ymodem), xy gives Ymodem batch,
- but forces 128 byte packets, xbk will use Modem7 batch mode, but with
- 1K packets. Note that the Kermit implementation can attempt to use both
- hi bit quoting and repeat character packing for sending, these are
- enabled by adding a 'p' to the kermit options for pack, and a 'h' for
- high bit quoting. As with protocol reception, this procedes in silence,
- however if an 'a' option (i.e. 'xkya 4:*.txt') is given, QTERM will
- ring the bell on completion; in addition, a control 'X' will abort the
- transfer.
-
- K - Program a function key - This prompts for a key number and a string
- to be loaded under that key. The first character entered may be an
- 's' to specify the string should be sent slowly. Normally function
- key strings are transmitted at full speed, however the 's' creates
- a tenth second delay between characters. Following the 's' (if given)
- or as the first character if no 's' is given, must be a digit between
- '0' and '9': this specifies the key number. Finally comes the string
- that will be loaded under the key. Maximum string length is 14
- characters, longer strings are truncated. Backslash escape sequences
- are permitted, see the description in the section on chat scripts
- for a full explanation of what is available. As a few examples:
-
- s2hello\r
-
- would program function key 2 to send 'hello <cr>' slowly, and:
-
- 3userid = 17\e
-
- would program function key 3 to send 'userid = 17 <esc>' at full speed.
- (\r is an escape sequence that maps to a single carriage return, and
- \e maps to a single escape. See chat scripts below for more detail)
-
- 0-9 - Send function key string - After <escape> 'K' has been used to load
- strings into the function keys, <escape> '0' etc. will activate the
- function key, causing the string it contains to be sent.
-
- X - Activate a chat script - This prompts for a filename, then it reads the
- file, and does the chat script given. A chat script is a means for
- getting QTERM to automatically call up a remote system, log in to it,
- and do whatever else in wanted. A line in a chat script contains six
- fields: an example of such a line is:
-
- .AT\r.OK\r\n.3.2.3.0.
-
- In this example the '.' (first character) is the delimiter used to
- separate fields. Any character can be used, but whatever character is
- chosen cannot appear in the strings. Also note that chosing a delimiter
- from the characters above 'z' in the ASCII character set
- (i.e. '{', '|', '}', and '~') has a special effect, which is explained
- below. Taking the fields in order they are SEND, EXPECT, TIME, TRIES,
- SUCCESS, and FAIL. SEND is a string that is transmitted by QTERM, so in
- the example above QTERM would transmit 'AT<carriage return>'. Since the
- file must be printable ascii, special escape sequences are provided to
- allow arbitrary characters in. All of these escape sequences start with
- a backslash '\', and the following are provided: '\r' carriage return
- (0x0d), '\n' linefeed (0x0a), '\t' tab (0x09) '\b' backspace (0x08),
- '\e' escape (0x1b), '\k' break, and '\d' delay. '\k' causes a break to
- be sent, and '\d' causes a delay of two seconds in the transmission.
- In addition a backslash can be followed by up to three octal digits to
- send the character with that representation: so '\177' would send a
- delete, and '\003' or '\3' would send a control C; this can also be
- done for hexadecimal representations: in this case '\x' is the leadin,
- and it is followed by up to two hexadecimal digits: so '\x7f' would
- again send a delete, and '\xd' could be used in place of '\r' to send
- a carriage return. The rule for determining how many characters are
- used when scanning an octal or hex number is as follows: octal has a
- maximum of three, hex a maximum of two: use at most that many characters,
- or stop early if an inappropriate character is encountered. As was noted
- above, delimiters above 'z' have a special effect: they cause the SEND
- string to be written out slowly: there is a tenth of a second delay
- after each character. EXPECT is a string that QTERM is looking for in
- response to it's SEND string: so in the above example, QTERM would be
- looking for the 'OK<carriage return><linefeed>' that a Hayes compatible
- modem would respond with, when presented with the 'AT<return>' that
- QTERM sent.
-
- The remining four fields are all decimal numbers, and can be omitted
- as QTERM will provide default values. TIME is the number of seconds
- to wait before assuming failure, if not given it defaults to 15. TRIES
- is the number of times to retry on failure, so taking our first example,
- TRIES is 2. If it matched the EXPECT string on the first sending of SEND,
- all is well, but on the first failure it would resend the SEND string
- and look for the EXPECT string a second time. If it failed on this second
- attempt, only then would it consider this line to have failed. SUCCESS
- specifies the line number to transfer to in the chat script if it matched
- the EXPECT string. The default for this is the line following the current
- line. FAIL is the line to transfer to if the EXPECT string is not
- matched. This can be a line in the chat script, or as shown above 0 is
- allowed, which terminates the script immediately. In another example, if
- the first line were:
-
- .AT\r.OK\r\n..5.
-
- Since TIME is empty, it defaults to 15, but as TRIES is 5, this line
- would try five times before giving up. Note also from the second
- example that there are two ways of causing QTERM to default a value:
- an empty field (TIME) or end of the string (SUCCESS and FAIL). Note
- however that the closing '.' after the 5 for TRIES is necessary. It is
- possible that either of SEND or EXPECT can be empty: an empty SEND
- causes nothing to be sent, but the EXPECT must be matched to continue;
- an empty EXPECT automatically matches. Note that if both are empty then
- the chat script will terminate when it hits that line.
-
- There is another special cases for the "delimiter": '!'. This allows
- other <escape> commands to be executed in the middle of a chat script.
- Following the '!' must be the letter of the command to be executed,
- and following this must be any input that would normally be prompted
- for. Hence:
-
- '!b1200 8n1'
-
- would cause the baud rate to be set to 1200, and the communications
- mode to 8 data bits, no parity, and one stop bit; likewise:
-
- '!.'
-
- would send a break. Note that there should be no space between the '!'
- and the command letter, although spaces after are permitted. Not all
- commands are available: ',', '.' (hangup and break), 'B' (set baud
- rate), 'E' (set local echo), 'H' (set half duplex), 'J' (toggle
- junking control characters), 'L' (set linefeed send for 'P'), 'M' (set
- bit 7 mask), 'N' (select new drive/user), 'V' (toggle VT100 emulation),
- 'W' (toggle split window mode), 'K' (program function key), 'P' (print
- file to remote), 'R' (receive), 'S' (send) and 'X' (activate chat script)
- are the only commands available. Note also that the toggles ('E', 'H',
- 'J', 'L', 'M', 'V' and 'W') behave a little differently. Since the state
- of these toggles is not defined when a chat script starts, there are
- three ways of invoking these. Using 'H' (half duplex) as an example:
-
- '!h'
-
- behaves as would an <escape> 'H' in normal operation, i.e. it toggles
- the half duplex switch. However, if the following is given:
-
- '!h1'
-
- the trailing '1' forces half duplex to be enabled, irrespective of
- it's original state, and:
-
- '!h0'
-
- guarantees to turn half duplex off. The other toggles work in the same
- manner: a trailing '0' always disables, and a trailing '1' always
- enables.
-
- The 'X' command to activate a chat script can be used to chain scripts
- together: when an 'X' is encountered the specified chat script is
- invoked, however the current script is lost: it is overwritten by the
- new one.
-
- There are two other command that are not normally available: 'A', and
- 'F'.
-
- 'A' simply alerts it's passing by ringing the terminal bell, this may
- be useful if a chat script is being used to repeatedly call a number
- until a connection is made: by putting a '!a' into the script, the
- system will beep when a connection is made.
-
- Since 'C' catch files are disabled during chat script operation, 'F'
- is provided as an alternative means for data capture. A typical 'F' line
- would be:
-
- '!fb:catch.txt 6 string'
-
- This would open B:CATCH.TXT for output, then send 'string' out, and
- transfer all subsequent data to that file until a timeout of 6 seconds
- occurred. 'string' is a string that can contain backslash escape
- sequences, just like a SEND string in normal chat operation. Any
- timeout can be given, up to about 250 seconds. Note that since this
- uses the same buffer as the <escape> C command, if there is already a
- catch file open, it will be automatically closed prior to execution
- of a '!f'.
-
- Finally, if you wish to terminate a chat script prematurely, typing
- control 'X' will do so, and return to normal operation.
-
- Q - Quit - This terminates QTERM, returning to CP/M. Note that the modem is
- not hung up, unless the exit code explicitly does so, or an <escape> ','
- sequence is used before terminating QTERM.
-
-
- To finish - here is an example of a chat script, with a 'blow by blow' account
- of every line.
-
- !b1200 8n1 -2 25 500 [1]
- !k0C;CP/M\r [2]
- !k1C;POST\r [2]
- .AT\r.OK\r\n..5. [3]
- .ATDT1234567\r.CONNECT 1200.30. [4]
- ..inue: . [5]
- .\r.\r\n. [6]
- .\013.name: . [7]
- |david goodenough\r|word: | [7]
- |XXXXXXXX\r|| [7]
-
- [1] - set the baud rate for 1200, and 8n1 as the communications mode, set
- for 2 seconds delay to respond to ^S, set for 25 milliseconds
- delay between character sends during <escape> P and set for 500
- milliseconds of delay at the end of each line in <escape> P
-
- [2] - load function key 0 with 'C;CP/M <return>', and function key 1 with
- 'C;POST <return>' - these are a couple of commands that I use a
- lot on the BBS associated with this chat script.
-
- [3] - send 'AT<return>' to the modem, and look for the 'OK<return><linefeed>'
- response. This line is tried five times before giving up.
-
- [4] - dial the number, and wait for the 'CONNECT 1200' response. Note here
- that the timeout is thirty seconds, to give the modem time to dial,
- make the connection, and establish carrier with the other modem.
-
- [5] - send nothing, but wait for 'inue: '. This is part of a string typed
- by the BBS: 'Hit any key to continue: ' - here we are just looking
- for the last six characters. Note that all four numeric fields
- default here, so wait 15 seconds, only try it once, success goes
- to the next line, and failure exits,
-
- [6] - send a <return>, and wait for a <return> <linefeed>.
-
- [7] - send a control K ('\013'), and wait for 'name: '; then send my
- name, and wait for 'word: ' (part of the password prompt);
- finally send my password, and expect nothing - we're all done.
- Note also the '|' delimiter, the system can't take the name
- and password at full speed, so they are sent slowly.
-
- To provide a second example, a local BBS has two possible numbers to
- call it on. The following script will try the first, if that fails
- then try the second
-
- .AT\r.OK\r\n..5. [1]
- .ATDT7654321\r.CONNECT 1200.30..5.3. [2]
- .AT\r.OK\r\n..5. [3]
- .ATDT7651234\r.CONNECT 1200.30. [4]
- %\r%inue....% [5]
- . .FIRST name? . [6]
- .david\r.LAST name? . [6]
-
- [1] - Get the modem's attention: send AT <return> till the modem responds.
-
- [2] - Try the first number. If we succeed go to line 5, on a fail go to line
- 3 which is the next line.
-
- [3] - Resync with the modem.
-
- [4] - Try the second number. If we succeed, carry on, otherwise fail.
- Effectively failure only occurs if both numbers don't work.
-
- [5] - Start the login process, this line shows also how any delimiter can
- be used: since '.' is part of the expect string there is another
- character in use for the delimiter.
-
- [6] - Continue logging in.
-
- By expanding the process above, it is possible to cause the modem to test
- many numbers, and by suitably adjusting the failure value of the last
- line where a number is dialed it is possible to make the script try several
- numbers in a loop test pattern indefinitely till one of them succeeds.