home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / util / comm / arateleb.txt < prev    next >
Internet Message Format  |  1992-11-05  |  6KB

  1. Date: Thu, 9 Jan 92 13:43:39 CST 
  2. From: Werner Uhrig <werner@rascal.ics.utexas.edu>
  3. Subject: ARA-script for Telebit T3000 
  4.  
  5.  
  6.  
  7.     [ with thanks to friends at Apple ... ]
  8.  
  9. ! "Telebit T3000 Modem 11/11/91" JFK
  10. ! 11/14/91 JFK - Added a ton o' comments...
  11. !  
  12. !
  13. @ORIGINATE
  14. @ANSWER
  15. !
  16. ! Talk to the modem at 19,200 bps.  the T3000 should auto-baud this
  17. ! unless the user has locked the port to a particular speed.  If it
  18. ! locked to a different speed, the user will need to change that.
  19. !
  20. serreset 19200, 0, 8, 1
  21. !
  22. ! First recall the factory configuration
  23. ! F9 is the built in preconfigured setting for CTS/RTS handshaking.
  24. ! Since it's possible for the user to modify F0 parameters, this is a 
  25. ! little safer.
  26. !
  27. ! AT&F9 sets:
  28. ! &C1 - DCD is on after connect
  29. ! &D2 - DTR on/off disconnects
  30. ! S58=2 - Use RTS/CTS flow control in full-duplex mode
  31. !
  32. settries 0
  33. matchclr
  34. @LABEL 1
  35. matchstr 1 4 "OK\13\10"
  36. write "AT&F9\13"
  37. matchread 30
  38. inctries
  39. iftries 2 59
  40. ! Modem is not responding, reset and send a break
  41. DTRClear
  42. pause 5
  43. DTRSet
  44. SBreak
  45. jump 1
  46. !
  47. ! Next, Set up the configuration: drop connection after losing DTR
  48. !                Turn off auto answer and echo, and set it to dial fast...
  49. !
  50. ! &D3 - DTR on/off resets modem 
  51. ! S0=0 - Don't answer calls
  52. ! E0 - Turn command echo off
  53. @LABEL 4
  54. matchclr
  55. pause 5
  56. matchstr 1 5 "OK\13\10"
  57. write "AT&D3S0=0E0\13"
  58. matchread 30
  59. jump 59
  60. !
  61. ! Next, disable MNP and error control
  62. ! turn on internal buffering (for V.32bis),
  63. ! and extended result codes (CTS/RTS flow control was set when we
  64. !                            issued &F9, so we don't need to
  65. !                            do it here).
  66. !
  67. ! S180=0 - Turn off all error detection/correction (ARA does MNP and
  68. !          compression itself.  It needs these turned off in the modem).
  69. ! S181=1 - Turn *on* DTE <-> line buffering if there is no error control
  70. !                            (which there is not).  Since we will be
  71. !                            talking to the Mac at 19,200 bps no matter
  72. !                            what speed we connect at, we need this on.
  73. ! X2 - Issue extended result codes.  This will display busy, connect XXX, etc.
  74. !      X2 will say "CONNECT XXX"  Where XXX is the line speed.  We need this
  75. !      so we can tell ARA what speed we are really communicating at
  76. !      (for timing)
  77. !
  78. @LABEL 5
  79. pause 5
  80. matchstr 1 6 "OK\13\10"
  81. write "ATS180=0S181=1X2\13"
  82. matchread 30
  83. jump 59
  84. !
  85. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  86. !
  87. @LABEL 6
  88. ifstr 2 8 "1"
  89. pause 5
  90. matchstr 1 8 "OK\13\10"
  91. write "ATM0\13"
  92. matchread 30
  93. jump 59
  94. !
  95. ! The modem is ready so enable answering, or originate a call
  96. !
  97. @LABEL 8
  98. pause 5
  99. ifANSWER 30
  100. note "Dialing ^1" 3
  101. write "ATDT^1\13"
  102. !
  103. @LABEL 9
  104. matchstr 1  11 "CONNECT 1200\13\10"
  105. matchstr 2  12 "CONNECT 2400\13\10"
  106. matchstr 3  13 "CONNECT 4800\13\10"
  107. matchstr 4  19 "CONNECT 7200\13\10"
  108. matchstr 5  14 "CONNECT 9600\13\10"
  109. matchstr 6  20 "CONNECT 12000\13\10"
  110. matchstr 7  18 "CONNECT 14400\13\10"
  111. matchstr 8  50 "NO CARRIER\13\10"
  112. matchstr 9  50 "ERROR\13\10"
  113. matchstr 10 52 "NO DIAL TONE\13\10"
  114. matchstr 11 53 "BUSY\13\10"
  115. matchstr 12 54 "NO ANSWER\13\10"
  116. matchread 700
  117. jump 59
  118. !
  119. ! Notice that all we do for different connect speeds is issue a 
  120. ! "CommunicatingAt" command.  Remember, we locked the interface speed
  121. ! to 19,200 bps so we don't want to reset the serial speed after we connect.
  122. ! CommuicatingAt tells ARA what the actual line speed is so that it
  123. ! can set it's timers appropriately.  I guess your performance would be
  124. ! sub-optimal if you don't set this...
  125. !
  126. @LABEL 11
  127. note "Communicating at 1200 bps." 2
  128. CommunicatingAt 1200
  129. jump 15
  130. !
  131. @LABEL 12
  132. note "Communicating at 2400 bps." 2
  133. CommunicatingAt 2400
  134. jump 15
  135. !
  136. @LABEL 13
  137. note "Communicating at 4800 bps." 2
  138. CommunicatingAt 4800
  139. jump 15
  140. !
  141. @LABEL 19
  142. note "Communicating at 7200 bps." 2
  143. CommunicatingAt 7200
  144. jump 15
  145. !
  146. @LABEL 14
  147. note "Communicating at 9600 bps." 2
  148. CommunicatingAt 9600
  149. jump 15
  150. !
  151. @LABEL 20
  152. note "Communicating at 12000 bps." 2
  153. CommunicatingAt 12000
  154. jump 15
  155. !
  156. @LABEL 18
  157. note "Communicating at 14400 bps." 2
  158. CommunicatingAt 14400
  159. jump 15
  160. !
  161. ! Set CTS handshaking ON in the serial port (that's the 1 in the HSReset
  162. ! command below )
  163. !
  164. @LABEL 15
  165. HSReset 0 1 0 0 0 0 
  166. ifANSWER 16
  167. pause 30
  168. @LABEL 16
  169. exit 0
  170. !
  171. ! @ANSWER
  172. ! Set up the modem to answer
  173. !
  174. @LABEL 30
  175. write "ATS0=1\13"
  176. matchstr 1 31 "OK\13\10"
  177. matchread 30
  178. jump 59
  179. !
  180. @LABEL 31
  181. matchstr 1  32 "RING\13\10"
  182. matchstr 2  11 "CONNECT 1200\13\10"
  183. matchstr 3  12 "CONNECT 2400\13\10"
  184. matchstr 4  13 "CONNECT 4800\13\10"
  185. matchstr 5  19 "CONNECT 7200\13\10"
  186. matchstr 6  14 "CONNECT 9600\13\10"
  187. matchstr 7  20 "CONNECT 12000\13\10"
  188. matchstr 8  18 "CONNECT 14400\13\10"
  189. matchstr 9  50 "NO CARRIER\13\10"
  190. matchstr 10 50 "ERROR\13\10"
  191. matchstr 11 52 "NO DIAL TONE\13\10"
  192. matchstr 12 53 "BUSY\13\10"
  193. matchstr 13 54 "NO ANSWER\13\10"
  194. matchread 700
  195. jump 31
  196. !
  197. @LABEL 32
  198. userhook 1
  199. note "Answering phoneI" 2
  200. jump 31
  201. !
  202. ! 50: error messages
  203. !
  204. @LABEL 50
  205. exit -6021
  206. !
  207. @LABEL 52
  208. exit -6020
  209. !
  210. @LABEL 53
  211. exit -6022
  212. !
  213. @LABEL 54
  214. exit -6023
  215. !
  216. @LABEL 59
  217. exit -6019
  218. !
  219. ! Hang up the modem
  220. !
  221. @HANGUP
  222. @LABEL 60
  223. settries 0
  224. HSReset 0 0 0 0 0 0 
  225. @LABEL 61
  226. write "ATH\13"
  227. matchclr
  228. matchstr 1 63 "NO CARRIER\13\10"
  229. matchstr 2 63 "OK\13\10"
  230. matchstr 3 63 "ERROR\13\10"
  231. matchread 30
  232. inctries
  233. iftries 3 63
  234. ! no response, try escape sequence
  235. write "+++"
  236. matchclr
  237. matchstr 1 62 "OK\13\10"
  238. matchread 15
  239. !
  240. ! No Response from modem, toggle DTR
  241. !
  242. DTRClear
  243. pause 5
  244. DTRSet
  245. jump 61
  246. !
  247. @LABEL 62
  248. ! Pause 1 second before to ensure we meet the escape time delay
  249. pause 10
  250. Flush
  251. write "ATH\13"
  252. matchstr 1 63 "OK\13\10"
  253. matchstr 2 63 "NO CARRIER\13\10"
  254. matchstr 3 63 "ERROR\13\10"
  255. matchread 30
  256. jump 61
  257. !
  258. !
  259. ! recall the factory settings.  Use &F9 again (see note at top of script)
  260. !
  261. @LABEL 63
  262. matchclr
  263. matchstr 1 64 "OK\13\10"
  264. pause 15
  265. write "AT&F9\13"
  266. matchread 30
  267. !
  268. ! Turn off auto answer, set S51 so modem will check interface
  269. ! speed on next connection.  If you don't do this, the modem
  270. ! will not try to autobaud, with the result being it exits the 
  271. ! script with an error
  272. ! S51=255 - Autobaud (9600 bps default)
  273. ! S0=0 - Don't try to answer the phone
  274. !
  275. @LABEL 64
  276. pause 5
  277. matchstr 1 65 "OK\13\10"
  278. write "ATS51=255S0=0\13"
  279. matchread 20
  280. !
  281. @LABEL 65
  282. exit 0
  283.  
  284.  
  285.  
  286. xD
  287.  
  288.  
  289.