.; INIMOD IND command file .; For use with TSX version 6 and later .; Designed to initialize modem, called from DETACH.TSX .; .;**************************************************************; .; ; .; Copyright (c) 1986, 87 Bob Schor ; .; Rockefeller University ; .; 1230 York Ave ; .; New York, NY 10021 ; .; ; .; All rights reserved. May not be copied without this notice. ; .; ; .;**************************************************************; .;**************************************************************; .; ; .; Copyright (c) 1988 Bob Schor ; .; Eye and Ear Hospital ; .; 230 Lothrop St. ; .; Pittsburgh, PA 15213 ; .; ; .; All rights reserved. May not be copied without this notice. ; .; ; .;**************************************************************; .;**************************************************************; .; ; .; Copyright (c) 1989 Bob Schor ; .; Eye and Ear Institute ; .; 203 Lothrop St. ; .; Pittsburgh, PA 15213 ; .; ; .; All rights reserved. May not be copied without this notice. ; .; ; .;**************************************************************; .; Version 6.12 -- first incarnation (after PHONE v 6.12) .; Version 7.1 -- minor rearrangement to ensure device allocated .; Version 7.1 -- allow several retries .; Version 7.2 -- force auto-answer after first ring .; Version 7.2 -- define clline .; Version 7.4 -- minor corrections .; Version 7.5 -- raise DTR dropout time to 100 msec .; Version 8.1 -- more "verbal" to allow better interactive use .; Version 8.1 -- "wait 5 seconds and repeat" eliminated .; Version 8.1 -- auto-customization option for BSTSX or VWTSX .; Version 8.1 -- add new features, MNP Class 5, inactivity .; Version 8.1 -- attn, CR factored out, commands strung together .; Version 8.1 -- configuration saved in NVRAM .; Version 8.3 -- modem and serial baud rates set to allow MNP Class 5 .; Version 8.7 -- customized for Vestibular Clinic 11/73 .; Version 8.7 -- vestibular clinic version, no auto-answer .; Version 9.8 -- pre-customize by defining PHN: (CLn, used for phone) and .; command SETPHN (set phn line=n) to set phone line. Since .; customization otherwise removed, "autans" defined .; Note that for proper functioning, this file should .; be installed with privilege "terminal" .; This has been done in DETACH.TSX .;initialization .enable quiet .enable substitution .disable suffix .disable prefix .sets versn "INIMOD, Version 9.8" .sett autans ;permit auto-answer .ifndf autans .setf autans .sets CR "<15>" .setn tries 5 ; ;'versn' ; .; First see if device has been allocated .start: ;Reset modem setphn .if = .goto setxl ;Cannot set PHN: to modem line .goto oops .setxl: assign phn xl xlbusy .if = .goto initl deassign xl set phn line = 0 ;XL device, assigned to PHN:, currently allocated elsewhere .goto oops .initl: .; Set up XL alloc xl set xl reset set xl tab,nolfout .delay 1S .; Set up modem .sets attn "AT" ;attention .sets noecho "E0Q1" ;echo off, quiet .sets echo "E1Q0V1X1" ;echo on, result codes .sets baoff "$BA0" ;baud adjust off .sets nmode "&E0" ;normal mode .sets armode "&E1" ;auto-reliable mode .sets flow "&E5" ;XON/XOFF flow control .sets hangup "H" ;hang up the phone .sets answer "S0=1" ;answer after first ring .sets noans "S0=0" ;no answer .sets dtrdrp "S25=1" ;increase DTR dropout time to 100 msec .sets mreset "Z" ;reset the modem .sets nocomp "&E14" ;compression disabled .sets comp "&E15" ;compression enabled .sets mb2400 "$MB2400" ;modem baud rate 2400 .sets sb9600 "$SB9600" ;serial baud rate 9600 .sets noinac "&I0" ;disable inactivity timer .sets inac30 "&I2" ;30-minute inactivity timer .sets save "&W0" ;save configuration .; Send initialization sequence sendxl 'attn''mreset''CR' .delay 1S .ift autans ;Set noecho, XON/XOFF, auto-answer, autoreliable .iff autans ;Set noecho, XON/XOFF, no auto-answer, autoreliable .ift autans sendxl 'attn''noecho''flow''baoff''answer''armode''CR' .iff autans sendxl 'attn''noecho''flow''baoff''noans''armode''CR' .delay 1S ;Set modem (2400) and serial port (9600) baud rates sendxl 'attn''mb2400''sb9600''CR' .delay 1S ;Set 100 msec DTR drop, MNP Class 5, 30-minute inactivity sendxl 'attn''dtrdrp''comp''inac30''CR' .delay 1S ;Save configuration sendxl 'attn''save''CR' .delay 1S .; Modem should now be initialized ;Modem initialized dealloc xl deassign xl set phn line = 0 .exit .; Error 1 -- improper customization definition .error1: ;Improper customization definition .exit .; Error-processing -- count failure, sleep, retry later .oops: .dec tries .if tries > 1 ;Wait one minute, try 'tries' more times .if tries = 1 ;Wait one minute, try 'tries' more time .if tries > 0 .delay 1M .if tries > 0 .goto start ;Persistant failure -- abort .exit