home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / mskermit / msmzyxel.scr < prev    next >
Text File  |  2020-01-01  |  6KB  |  138 lines

  1. ; FILE ZYXEL.SCR
  2. ;
  3. ; An MS-DOS Kermit script program for dialing the ZyXEL 1496
  4. ; modem, to be used with MS-DOS Kermit 3.11 or later.  The modem is set
  5. ; up for compression, error correction, all types of fallback.
  6. ; RTS/CTS flow control, fixed interface speed of 57600 or 38400.
  7. ;
  8. ; Authors: Christine M. Gianone, Frank da Cruz; Columbia U, June 1993.
  9. ;   PP14400.SCR adapted for Zoom modem by:
  10. ;   Phillip Feldman <feldman@wiener.pstat.ucsb.edu>, Sept 1993.
  11. ;   Further modified for ZyXEL modem by:
  12. ;   Richard Stanton <stanton@haas.berkeley.edu>
  13. ;
  14. ;   This script is almost identical to ZOOM.SCR.  Changes:
  15. ;
  16. ;   W1 means nothing to ZyXEL.
  17. ;   S95 register doesn't exist.
  18. ;   X5 gives more information than X4.
  19. ;   &N0 tells modem to negotiate highest rate possible.
  20. ;   &H3 gives RTS/CTS flow control, rather than &K3.
  21. ;   &Y1 tells modem to send nondestructive, expedited breaks.
  22. ;   &K4 tells modem to try V42/V42bis, then work down (through MNP etc.)
  23. ;   No forced hangup settings.
  24.  
  25. def errfail echo \%1, hangup, goto fail ; Macro to handle failures.
  26. if < VERSION 312 errfail {MS-DOS Kermit 3.12 or later required.}
  27. if eq "\v(system)" "UNIX" if = \v(local) 0 stop 1 You must SET LINE first
  28.  
  29. define chkerr if fail stop 1 \%1
  30. define chkok input 3 OK, if fail stop 1 \%1
  31.  
  32. set input echo on               ; So we can watch what happens.
  33. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE.
  34. set input case ignore           ; Use caseless string comparisons
  35.  
  36. ;set parity none                ; Avoid parity foulups
  37. set flow none                   ; Avoid flow control deadlocks
  38. hangup                          ; Begin by dropping DTR
  39. pause 1                         ; for one second
  40.  
  41. set speed 57600                 ; Modem autobauds up to 57600
  42.  
  43. echo Configuring ZyXEL U-1496E modem on \v(line)...
  44.  
  45. :INIT
  46. output ATQ0V1\13                ; Enable word result codes
  47. chkok {Can't get modem's attention}
  48.  
  49. echo Enabling verbose result codes...
  50. output AT E1 &D2 X5\13 ; Echoing, result codes, etc.
  51. chkok {Can't initialize modem}
  52.  
  53. echo Enabling modulation negotiation...
  54. output AT &N0 N1\13             ; Start modulation speed negotiation at V32bis
  55. chkok {Can't enable modulation speed negotiation}
  56. echo Enabling hardware flow control...
  57. output AT &H3\13                ; RTS/CTS hardware flow control
  58. chkok {Can't enable RTS/CTS}    ; On modem
  59. wait 5 cts
  60. if fail errfail {Modem is not asserting CTS!}
  61. set flow rts/cts                ; And in Kermit too, but only now
  62. echo Configuring modem to ignore BREAK...
  63. output AT &Y1\13            ; Make modem ignore BREAK
  64. chkok {Can't become transparent to BREAK}
  65. echo Enabling error correction and data compression...
  66. output AT &K4\13  ; Enable error correction & compression
  67.                                 ; with automatic speed buffering
  68. chkok {Can't enable compression EC and fallback}
  69.  
  70. if def \%1 if not equal "\%1" "=" goto BEGIN
  71. echo Modem initialization complete, no number to dial
  72. end 0
  73.  
  74. :BEGIN                          ; Now DIAL.
  75. clear                           ; Clear INPUT buffer.
  76. set count 100                     ; Dialing retry counter, 5 tries allowed.
  77. echo Dialing \%1 on \v(line) at \v(speed) bps, wait...
  78. echo
  79. pause 1
  80. goto dial                       ; 1st time, skip pause and Redialing message
  81.  
  82. :REDIAL
  83. set alarm 30
  84. pause 30                        ; Wait 30 seconds before redialing.
  85. if not alarm errfail {Dialing canceled.}
  86. echo Redialing...               ; Message for redialing.
  87. pause 1
  88.  
  89. :DIAL
  90. output ATD\%1\13                ; Dial the number.
  91. set alarm 200                   ; (For detecting keyboard interruptions.)
  92. if > VERSION 312 clear input    ; Clear echo from INPUT buffer.
  93. if < VERSION 313 clear
  94. input 100 \10                    ; Wait for the linefeeds...
  95.  
  96. :GETMSG
  97. input 100 \10                    ; ...that surround the response message.
  98. if success goto gotmsg          ; Got a message.
  99. if alarm errfail {No response from modem.} ; No response in 90 seconds.
  100. hangup                          ; User interrupted from keyboard,
  101. output \13                      ; cancel dialing by sending carriage return,
  102. goto again                      ; and go try again right away.
  103.  
  104. :GOTMSG
  105. reinput 1 CONNECT               ; Got a message, was it CONNECT?
  106. if success goto done            ; If so, we're done.
  107. reinput 1 BUSY                  ; Line is busy.
  108. if success goto busy            ; Go wait a while and then dial again.
  109. reinput 1 ERROR                 ; Command syntax error.
  110. if success errfail {Dialing command error}
  111. reinput 1 NO CARRIER            ; Phone didn't answer or no carrier.
  112. if success errfail {No answer or no carrier}
  113. reinput 1 NO DIALTONE           ; No dialtone when phone taken off hook.
  114. if success errfail {No dialtone - Is your modem connected to the phone line\63}
  115. goto getmsg                     ; None of the above, get another message.
  116.  
  117. :BUSY
  118. if < \v(count) 2 goto quit      ; Don't wait 30 seconds if tries are used up.
  119. Echo Line is busy, will dial again in 30 seconds
  120. echo Press any key to cancel...
  121. output \13                      ; CR cancels dialing
  122. hangup                          ; Hang up.
  123. :AGAIN
  124. if count goto redial            ; Then go redial.
  125. :QUIT
  126. errfail {It never answers!  I give up.} ; Too many tries.
  127.  
  128. :DONE                           ; Connected.
  129. echo \7                         ; Celebrate with a beep.
  130. define errfail                  ; Erase local macro definitions...
  131. end 0                           ; Finished, return success code.
  132.  
  133. :FAIL                           ; Dialing failed, no beep.
  134. define errfail                  ; Erase local macro definitions...
  135. end 1                           ; Return failure code.
  136.  
  137. ; End of ZYXEL.SCR
  138.