home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
mskermit
/
msmwang14.scr
< prev
next >
Wrap
Text File
|
2020-01-01
|
10KB
|
295 lines
; FILE WANG14.SCR (MSMWANG14.SCR)
;
; MS-DOS Kermit dialing script for the Wang 14/14i (internal) or
; 14/14e (external).
;
; Modified from da Cruz and Gianone's ULTRA144.SCR (MSMULTRA.SCR)
; by John Pritchard (jdp10@columbia.edu), 2/94
; Many notes taken from "User Manual", second edition, January 1993,
; Copyright (C) Wang Laboratories, Inc., 1992.
; Original Authors: Christine M. Gianone, Frank da Cruz; Columbia U, June 1993.
;
; Some defaults with their AT commands (* = changed here)
; E1 command echo
; L2 medium speaker volume
; N1 permit handshaking at any speed supported by communicating modems
; Q0 allow result codes sent to DTE (interface (to system bus) to Kermit)
; V1 verbose result codes
;* W0 error-correction negotiation progress NOT reported
; X4 extended result codes for "BUSY", "NO DIAL TONE", and "CARRIER xxxx"
; &C0 RLSD (DCD -- Hayes default) is ON regardless of the state of the
; data carrier from the remote modem
;* &D0 modem ignores DTR (Hayes default setting; prevents HANGUP from working)
; &K3 enable RTS/CTS - DTE<->DCE flow control
; &Q5 enable error-correction negotiation with fallback per register S36
; &R0 CTS tracks RTS (&R1 ignores RTS and CTS is locked ON) see S26
; &S0 DSR is constantly ON
; \A1 MNP block size of 128; 0:64; 2:192; 3:256
; \L0 MNP block transfer control in stream mode (1:block mode)
; %C1 data compression enabled
;* %E0 auto-retrain disabled
; %M3 two-way compression
; %S32 maximum string length for compresion [6,250]
; S25=5 delay to DTR. async mode meaning: time=n*0.01 seconds; change
; in DTR less than n/100 seconds has no effect on modem. [0,255]
; S26=1 CTS tracking delay: time=n*0.01 seconds [0,255]
; S36=7 negotiation failure (of LAPM) condition: fallback to MNP,
; and then fallback to ASB (automatic speed buffering) -- "normal",
; asynchronous connection.
;* S40=57 (0011 0111) MNP:
; (bit number:binary:identical AT code:interpreted command parameter);
; 0,1:00:\N:0; 2,3,4:110:\K:6 (which should be invalid, want \K5);
; 5,6:11:\A:3; 7:1:\G:1
;* S41=1 (none==0000 0001) MNP:
; (bit number:binary:identical AT code:interpreted command parameter);
; 0:0:%C:0; 1:0:%E:0; 2:0:\L:0; bits 3-7 not used.
;* S46= none - controls selection of compression; 136 - error correction
; without compression; 138 - EC with compression.
; S48=7 enable V.42 negotiation
; Check Kermit version
if < VERSION 312 errfail {MS-DOS Kermit 3.12 or later required.}
define max_speed 57600
define errfail echo \%1,-
echo,-
hangup,-
goto fail
define chkerr if fail echo \%1 -
echo -
stop
define chkok input 3 OK,-
if fail echo %1-
echo -
stop
define atok -
if def \%1 set speed \%1, -
echo Trying \%1..., -
output ATQ0V1\13, -
input 3 OK, -
if success goto gotok
set speed \m(max_speed) ;
set input echo on ; So we can watch what happens.
set input timeout proceed ; Allow IF SUCCESS, IF FAILURE.
set input case ignore ; Use caseless string comparisons
set parity none ; Avoid parity foulups
set flow RTS/CTS
hangup ; Begin by dropping DTR
pause 1 ; for one second
; Check if modem has been initialized with this script during this instance
; of Kermit, and assume modem DSR & CTS are on. Might want to either
; reorder script or put some brief modem checking after RUN to make the
; script bullet-proof. INIT can be defined in MSCUSTOM.INI to zero. This
; process can be expanded for Kermit use with multiple modems, ports,
; network, etc, by including this piece of code in each initialization
; script.
;
if def init if equal \m(init) wang14 goto run
define init zero
echo { Modem initialization variable set to \%i}
echo
echo { Configuring Wang 14 on \v(line) }
; Check modem signals that should be on
wait 0 DSR
chkerr { No DSR signal - check your modem! }
wait 0 CTS
chkerr { No CTS signal - check your modem! }
echo
echo { Checking modem command set at data speeds...}
atok ; Try to connect at current speed, whatever it is.
atok 300
atok 2400
atok 9600
atok \m(max_speed) ; Highest speed permitted.
stop 1 Can't get modem's attention
:GOTOK
; Check modem command mode
set count 3 ; three tries to get response to AT command
;
:LOOP ; called only from "if count" below
echo trying modem...
if = \v(count) 3 echo once
if = \v(count) 2 echo twice
if = \v(count) 1 echo three times, we're out!
echo
pause
output AT\13
input 3 OK
echo
if success goto init
if count goto loop ; subtract one from "\v(count)" and goto :LOOP
Stop 1 { Can't communicate with modem at \v(speed) }
:INIT ; Initialize the modem.
echo { Initializing modem options... }
echo
; &D2 hangup if DTR drops, so Kermit's HANGUP command will work
; L1 low speaker volume
; W1 enable error correction call progress messages
; X4 enable full range of result codes
; S40= 234 (1110 1010) - 0,1:\N3 (select auto-reliable link-mode),
; 2,3,4:\K5 (conditional break control),
; 5,6:\A1 (select maximum MNP block size to 128 chars),
; 7:\G0 (disable XON/XOFF flow control)
; S41= 224 (1110 0000) - 0:%C1 (enable data compression),
; 1:%E1 (enable auto-retrain),
; 2:%L0 (report received signal level),
; bits 3-7 not used
; S95= 116 (0111 0100 - bits 0,1,2,3,5 on)
; Enables CARRIER xxxx (with DTE speed & /ARQ),
; PROTOCOL xxxx, and COMPRESSION result codes
;
; (limit command line to less than 40 chars including spaces)
;
output AT &D2 L1 W1 X4\13
chkok { Can't initialize modem (1) }
echo
output AT S40=234 S41=224 S95=116\13
chkok { Can't initialize modem (2) }
echo
; Specify treatment of BREAK signal
;
echo { Configuring modem to ignore BREAK... }
output AT S82=128\13 ; Make modem pass BREAK transparently
chkok { Can't become transparent to BREAK }
echo
;
; negotiate error correction and compression: V.42 negotiation with LAPM
; else MNP5 negotiation with MNP4 protocol.
; S38=1 pause: When DTR from PC goes off, hang up after 1 second
; S46=138 execute error correction protocol with compression (In addition
; to V.42/bis the modem implements MNP5 data compression. V.42 is
; used only with LAPM, and MNP5 only with MNP4.
;
echo { Enabling error correction and data compression... }
output AT S38=1 S46=138\13
chkok { Can't enable compression and EC }
echo
;
; NVRAM User Profile Zero is start-up configuration, important for
; Kermie's signal checking which drops DTR in "hangup", see default AT&D
; &W0 save settings in profile zero
; &Y0 designate profile zero start-up configuration
;
echo { Saving configuration as User Profile Zero in NVRAM... }
output AT&W0&Y0\13
chkok { Failed to save configuration in NVRAM }
echo
; define initialization complete for this instance of Kermit
define \%i wang14
;
:RUN
if def \%1 if not equal "\%1" "=" goto BEGIN
;
; else...
; user only wanted to initialize the modem...
; display configuration
;
define \%i wang14
echo { Wang 14 initialized OK: }
echo
end 0
:BEGIN ; User wants to dial.
clear ; Clear INPUT buffer.
set count 5 ; Dialing retry counter, 5 tries allowed.
echo Dialing \%1 on \v(line) at \v(speed) bps, wait...
echo
pause 1
goto dial ; 1st time, skip pause and Redialing message
:REDIAL
; called from again
set alarm 30
pause 30 ; Wait 30 seconds before redialing.
if not alarm errfail { redial: dialing cancelled }
echo Redialing... ; Message for redialing.
pause 1
;
:DIAL
output ATD\%1\13 ; Dial the number.
set alarm 90 ; (For detecting keyboard interruptions.)
if > VERSION 312 clear input ; Clear echo from INPUT buffer.
if < VERSION 313 clear
input 30 \10 ; Wait for the linefeeds
; .
:GETMSG ; .
; called from GOTMSG and AGAIN ; .
input 60 \10 ; that surround the response message.
if success goto gotmsg ; Got a message.
if alarm errfail { No response from modem } ; No response in 90 seconds, fail.
hangup ; User interrupted from keyboard,
output \13 ; cancel dialing by sending carriage return,
goto again ; and go try againw right away.
:GOTMSG
; called from GETMSG
echo
reinput 1 CONNECT ; Success
if success goto done
reinput 1 BUSY ; Line is busy.
if success goto busy ; Go wait a while and then dial again.
reinput 1 ERROR ; Command syntax error.
if success errfail { Dialing command error }
reinput 1 NO ANSWER ; No answer
if success errfail { No answer, please try again later }
reinput 1 NO CARRIER ; Phone didn't answer or no carrier.
if success goto nocarrier
reinput 1 NO DIALTONE ; No dialtone when phone taken off hook.
if success errfail { No dialtone - Is modem connected to phone line\63 }
reinput 1 RING ; Phone is ringing
if success errfail { Somebody is calling this number }
goto getmsg ; None of the above, get another message.
;
:BUSY ; \v(count) set in BEGIN
if < \v(count) 2 goto quit ; Don't wait 30 seconds if tries are used up.
echo Line is busy, will dial again in 30 seconds.
echo Press any key to cancel...
;
:AGAIN
; called from getmsg
if count goto redial ; Then go redial.
:QUIT
errfail { It never answers! I give up. } ; Too many tries.
:FAIL ; Dialing failed, no beep.
define errfail ; Erase local macro definitions...
define max_speed
;
:NOCARRIER
; called from GOTMSG and fall-off from FAIL
echo Connection failed, the first event contributing to the loss of carrier...
echo
output ATS86?\13
reinput 1 000
if success echo { Normal Disconnect }
reinput 0 004
if success echo { Loss of Carrier }
reinput 0 005
if success echo { -
V.42 negotiation failed to detect an error-correcting modem at the other end}
reinput 0 009
if success echo { The modems could not find a common protocol }
reinput 0 012
if success echo { -
Remote modem does not respond after ten re-transmissions of the same message}
reinput 0 013
if success echo { Apparently no dialtone }
reinput 0 014
if success echo { Protocol violation }
end 1 ; Return failure code.
:DONE ; Connected.
echo \7\7 ; Celebrate with a beep.
define errfail ; Erase local macro definitions...
define max_speed
end 0 ; Finished, RETURN success code.
; End of File WANG14.SCR