home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / zcm_scrp.zip / BAUD.T next >
Text File  |  1989-11-21  |  2KB  |  49 lines

  1.     set home "/host";  cd; dis -d
  2.     if "m" echo "Characters Received From Modem"
  3.     while "L<50&&!c" sleep 1    : wait for carrier detect 5 seconds
  4.     if "!c" echo "No Carrier Detect from Modem"
  5.     pq4            : we want a quick response to pattern match
  6.     set s1 "!"        : counter
  7.     on "!c" dis -v; kill; pe0; return
  8.     ena -vv            : make control chars show as ^c
  9. b1:    obey "set s1 %s1!"
  10.     nulls 2; speed 1200; gosub b2.%lib/baud.t    :set nulls, try speed
  11.     nulls 5; speed 2400; gosub b2.%lib/baud.t
  12.     nulls 0; speed  300; gosub b2.%lib/baud.t
  13.     if !is1,!!!!! goto b1                : give up eventually
  14.     speed 1200
  15.     echo "Bad Line - Cannot Detect Carriage Returns: Try AT&T"
  16.     speed 300
  17.     echo "Bad Line - Cannot Detect Carriage Returns: Try AT&T"
  18.     o; fail
  19.  
  20.     : subroutine to check for response at given speed
  21. b2    if %emdir mput "\5"
  22.     pat
  23.     pat 1i "\r"            : carriage return is expected
  24.     if %twxfile pat 3i "\5"        : accept ENQ for twx protocol
  25.     if %emdir   pat 4i "\1"        : SOH means incoming file
  26.     pat 9i "\256"            : matches anything
  27.     sleep 1; kill; purgek; wait -f7    : 7 seconds to get something
  28.     if !c return
  29.     if 4 goto rx
  30.     if 3 goto twx
  31.     if 1 pat 2i "\n"; wait -f7; if 1 dis -v; fail : see note (1)
  32.     if "2&&%twxfile" goto twx        : if CR,LF get twx message
  33.     if !9 speed 1200; dis -v; fail        : if no char, assume 1200
  34.     return
  35. twx:    kill        : receive a TWX protocol message
  36.     cd %emdir
  37.     mput "%answerback"
  38.     create -hqx+7e %twxfile
  39.     t -!v
  40.     dis -hqx
  41.     ena -8n
  42.     kill
  43.     o
  44.     fail
  45. rx:    if %emdir cd %emdir        : receive a file with YMODEM BATCH
  46.     restrict rb
  47.     o
  48.     dis -v; fail
  49.