1 * ***********************************************************
  2 * *                                                         *
  3 * * Copyright, (C) Honeywell Information Systems Inc., 1982 *
  4 * *                                                         *
  5 * * Copyright (c) 1972 by Massachusetts Institute of        *
  6 * * Technology and Honeywell Information Systems, Inc.      *
  7 * *                                                         *
  8 * ***********************************************************
  9 
 10 
 11 * HISTORY COMMENTS:
 12 *  1) change(86-02-14,Kozlowski), approve(88-08-15,MCR7965),
 13 *     audit(88-09-08,Farley), install(88-09-20,MR12.2-1115):
 14 *     Autobaud with <cr>, "l" and "L" at 9600, 4800, 2400, 1200 and 300 baud.
 15 *  2) change(86-03-12,Kozlowski), approve(88-08-15,MCR7965),
 16 *     audit(88-09-09,Farley), install(88-09-20,MR12.2-1115):
 17 *     Allow 60 seconds for autobauding and removed 133 autobaud code.
 18 *  3) change(88-07-22,Beattie), approve(88-08-15,MCR7965),
 19 *     audit(88-09-09,Farley), install(88-09-20,MR12.2-1115):
 20 *     Prepared for installation.
 21 *                                                      END HISTORY COMMENTS
 22 
 23 
 24           lbl       ,autobaud_tables
 25           ttl       control tables for automatic baud selection
 26           editp     on
 27           pmc       off
 28           detail    off
 29           pcc       off
 30           rem
 31           rem
 32 auto      null
 33           symdef    auto
 34           symdef    autost
 35           rem
 36           symref    begin     return here in control tables after hanging up
 37           symref    signal    after baud set, return here to signal dialup
 38           symref    diftyp    exit to control tables here for 1050 or 2741
 39           symref    cct.2     cct for 2741 or 1050
 40           symref    cct.br    cct to break on all characters
 41           rem
 42           start     auto
 43           rem
 44           rem
 45           pmc       save,on
 46           csbits
 47           tconst
 48           cctdef
 49           rem
 50           tib
 51           pmc       restore
 52           rem
 53           ttls
 54 *         These control tables assume the user has hit  carriage
 55 *         return or typed either an upper case or lower case "l" at
 56 *         some unknown baud  rate. The character(s) read at 4800 baud
 57 *         are tested to determine the baud rate. The speeds supported
 58 *         are:
 59 *
 60 *         300 baud input
 61 *         <cr>, lc-"l", and uc-"L" all show up as a line break only
 62 *
 63 *         1200 baud input
 64 *         <cr>    = 1111000 1111110            (170 176    ) any   parity
 65 *         lc-"l" and uc-"L" show up as a line break plus
 66 *         lc-"l"  = 1111000 1111000            (170 170    ) space parity
 67 *         lc-"l"  = 1111000 1111000 1111000    (170 170 170) mark  parity
 68 *         uc-"L"  = 0000000 0000000 1111000    (170 000    ) space parity
 69 *         uc-"L"  = 0000000                    (000        ) mark  parity
 70 *
 71 *         2400 baud input
 72 *         <cr>    = 1100110 0000000            (146 000    ) space parity
 73 *         <cr>    = 1100110 1100000            (146 140    ) mark  parity
 74 *         lc-"l"  = 1100000 0011110            (140 036    ) space parity
 75 *         lc-"l"  = 1100000 1111110            (140 176    ) mark  parity
 76 *         uc-"L"  = 1100000 0011000            (140 030    ) space parity
 77 *         uc-"L"  = 1100000 1111000            (140 170    ) mark  parity
 78 *         4800 baud input
 79 *         <cr>    = 0001101                    (015        ) any   parity
 80 *         lc-"l"  = 1101100                    (154        ) any   parity
 81 *         uc-"L"  = 1001100                    (114        ) any   parity
 82 *         9600 baud input
 83 *         <cr>    = 1111110                    (176        ) space parity
 84 *         <cr>    = 1111111                    (177        ) mark  parity
 85 *                 = 1111001                    (171        ) sometimes...
 86 *         lc-"l"  = 1111101                    (175        ) any   parity
 87 *         uc-"L"  = 1111101                    (175        ) any   parity
 88           rem
 89 *         define character codes for making these tests
 90           rem
 91 cc.000    bool      000
 92 cc.015    bool      015
 93 cc.030    bool      030
 94 cc.036    bool      036
 95 cc.114    bool      114
 96 cc.140    bool      140
 97 cc.146    bool      146
 98 cc.154    bool      154
 99 cc.170    bool      170
100 cc.171    bool      171
101 cc.175    bool      175
102 cc.176    bool      176
103 cc.177    bool      177
104           rem
105 *         character strings for testing results of autobaud test
106           rem
107 ck1200    chstr     (rescan,match,cc.170)
108 cl1200    chstr     (rescan,match,cc.000)
109 ck2400    chstr     (rescan,match,cc.146,ignore,cmplst,cc.140,cc.000)
110 cl2400    chstr     (rescan,match,cc.140
111           etc       ,ignore,cmplst,cc.176,cc.170,cc.036,cc.030)
112 ck4800    chstr     (rescan,cmplst,cc.015,cc.154,cc.114)
113 ck9600    chstr     (rescan,cmplst,cc.177,cc.176,cc.175,cc.171)
114           eject
115 autost    clrflg    (tfkybd,tfprtr,tfctrl,tfsftr)
116           rem
117 retry     stpchn
118           dumpin
119           config              configure initially to 4800 baud
120           baud      4800
121           rmode     fg.lpr+fg.lpo       receive parity off
122           smode     fg.lps+fg.8bt       send 8-bit chars with parity
123           contrl    stat      check current status
124           wait      0,0,0
125           status    0,cts,ldoff
126           status    0,cd,ldoff
127           status    suprec,0,st1200     this means new 1200 baud modem
128           status    0,suprec,normal     this means old-style modems
129           rem
130 normal    setcct    cct.br    cct to break on all characters
131           contrl    rxmit+srec
132           rem
133           setime    60        Wait a reasonable time
134           wait      hang,0,0
135           status    0,cts,ldoff
136           status    0,cd,ldoff
137           status    brkchr,0,gotchr     a character found
138           status    break,0,ckbrk       give character time to arrive
139           rem
140 ckbrk     contrl    stat      check current status
141           wait      0,0,0     incoming char should be here by now
142           status    0,cd,ldoff
143           status    0,cts,ldoff
144           status    brkchr,0,gotchr     a character found is likely 1200
145           status    break,brkchr,set300
146           rem       break with no characters is 300 baud
147 
148 gotchr    setime    -250      wait 1/4 second for rest
149           rem
150           wait      ready,0,0
151           status    0,cd,ldoff
152           status    0,cts,ldoff
153           rem
154 ready     stpchn
155           rem
156 scan1     inscan    ck1200,scan2
157           goto      st1200
158 scan2     inscan    cl1200,scan3
159           goto      st1200
160 scan3     inscan    ck2400,scan4
161           goto      st2400
162 scan4     inscan    cl2400,scan5
163           goto      st2400
164 scan5     inscan    ck4800,scan6
165           goto      st4800
166 scan6     inscan    ck9600,retry
167           goto      st9600
168           rem
169 *         come here when baud determined
170           rem
171 st9600    scntr     9600
172           goto      join
173           rem
174 st4800    scntr     4800
175           goto      join
176           rem
177 st2400    scntr     2400
178           goto      join
179           rem
180 st1200    scntr     1200
181           goto      join
182           rem
183 set300    scntr     300
184           goto      join
185           rem
186 *         come here to finish up and return
187           rem
188 join      config
189           baud      0         baud rate is in counter
190           dumpin
191           setcct    scc.df    to normal hsla cct for modes
192           goto      signal    back to signal dialup
193           rem
194 *         come here if a vital dataset lead drops
195           rem
196 ldoff     setime    3         give it a chance to change its mind
197           wait      hang,0,0  but after 3 secs give up
198           status    dsr+cts+cd,0,retry line is back to normal, start over
199           rem
200 *         come here to hang up terminal after timeout
201           rem
202 hang      stpchn
203           dumpin
204           dmpout
205           contrl    rdtr
206           setime    5
207           wait      hung,0,0
208           status    0,cts,hung
209 hung      goto      begin     back to top of control tables
210           rem
211           end