Previous | Next | Contents | Index |
Script files contain a series of commands which tell MASTER what to send to the terminal in order to establish a connection with a remote PhoneNet slave. These files are all located in one of the channel-specific subdirectories of the PMDF table directory, as explained in Section 26.3.1.
Script file commands are provided to send strings to a serial device, to wait until a specified string is received and to terminate script processing and start up the dial protocol.
The available commands are described below. The quotedstring appearing in the descriptions is any sequence of characters enclosed in double quotes.
xmit quotedstring
Send quotedstring to the terminal line. The sequence\x
in the string causes a one-second transmission delay at the point where it appears in the string.recv quotedstring timeout
Wait until quotedstring is received before proceeding. Any characters leading up to quotedstring are ignored. Script processing is terminated if the quotedstring is not received within timeout seconds and timeout termination processing is enabled (the default).toff
Disable timeout termination processing on all subsequent recv commands. Any timeouts that occur are ignored.ton
Enable timeout termination processing on all subsequent recv commands. Any timeouts that occur will cause program termination. This is the default unless a toff command has been previously issued.go
Start protocol. After the protocol finishes processing of the script file will resume after the go command.end
Terminate script processing. This should be the last command in every script file.init begin
init end
Theinit begin
andinit end
commands can be used to mark a sequence of script commands as being initialization commands. Any commands appearing after ainit begin
and before the nextinit end
commands will be treated as initialization commands.
Table 26-1 lists special control sequences and their interpretation which can be used with script files.
Sequence | Interpretation |
---|---|
\r | carriage return (ASCII 13) |
\n | newline or line feed (ASCII 10) |
\f | form feed (ASCII 12) |
\t | tab (ASCII 9) |
\ddd | ASCII value ddd (in octal) |
\\ | backslash character (ASCII 92) |
\b | break |
\x | delay one second (only for xmit command) |
!
, in column one.
All characters received and transmitted are logged in the dial protocol transaction log.
A typical script file contains commands to initialize a modem, dial a number, make a connection with a remote system and tell the remote the channel to use. An annotated sample script file is shown in Example 26-4 below.
Example 26-4 Sample PhoneNet Script |
---|
! p_script.sample - Annotated script to establish dial-out connection ! ! To actually use this file as a dialing script, remove text ! enclosed in parentheses. Comment lines (those beginning with ! "!" can remain or they can be removed if desired. ! ! SECTION 1 - Tell your modem to call a number. Note that this ! section is modem-dependent. You will need to replace ! the example dialog of xmit/recv commands with the ! correct ones for your modem's user interface. ! init begin (begin script command which ready the device) xmit "\r\r" (send carriage returns - get this modem's attn) init end (end script commands which ready the device) recv "$" 15 (wait 15 sec. for your modem to answer (a $)) xmit "\xK" (your reply - tell it to dial a number) recv "NUMBER" 15 (wait 15 sec. for your modem's number prompt) xmit "\x16175551212\r" (give number - remember 1 and area code) recv "ON-LINE" 30 (wait 30 sec - for modems that report carrier) ! ! SECTION 2 - Log in to the remote machine (e.g., RELAY.CS.NET). ! if the remote system is also running PMDF, then the account ! to log in is the PMDF server account, usually called "PMDF" ! xmit "\r\x\r" (send carriage returns - alert remote machine) recv "ogin:" 30 (wait 30 sec for Login (or login) prompt) xmit "siteacct\r" (transmit your account name to remote machine) recv "assword:" 30 (wait for Password (or password) prompt) xmit "mypasswd\r" (transmit password - remember carriage return) recv "annel:" 120 (wait for Channel (or channel) prompt) xmit "channelname\r" (transmit remote's channel name) go (starts the PhoneNet session) end (hangs up and ends the script) |
Additional example PhoneNet script files can be found in Section 28.4.1.4.
Previous | Next | Contents | Index |