home *** CD-ROM | disk | FTP | other *** search
- /* get modem info, save as reg data (binary bytes).
-
- if there isn't a modem, or it isn't hayes compatable and if the
- setup isn't normal (i.e. like mine :-), this script will hang.
- */
-
- reg.0.type = 0
- reg.1.type = -1
- reg.2.type = 1
- reg.3.type = 1
- reg.4.type = 1
- reg.5.type = 1
- reg.6.type = 0
- reg.7.type = 0
- reg.8.type = 0
- reg.9.type = 0
- reg.10.type = 0
- reg.11.type = -1
- reg.12.type = 0
- reg.13.type = -1
- reg.14.type = 2
- reg.15.type = -1
- reg.16.type = -1
- reg.17.type = -1
- reg.18.type = -1
- reg.19.type = -1
- reg.20.type = -1
- reg.21.type = 2
- reg.22.type = 2
- reg.23.type = 2
- reg.24.type = -1
- reg.25.type = 1
- reg.26.type = 1
- reg.27.type = 2
-
-
- if (~show('L','rexxsupport.library')) then do
- call addlib('rexxsupport.library',0,-30,0)
- end
-
- call open(serf,'SER:')
-
- call waitforok
-
- save = ''
- do regs=0 to 27
- if reg.regs.type = -1 then iterate /* skip unused stuff */
- call writech(serf,'ATS'||regs||'?'||'0d'x)
- call readresp /* echo */
- call readresp /* goodie! */
- save = save || d2c(+substr(ach,1,3))
- call readresp /* pad */
- call readresp /* ok */
- end
-
- say save
-
- exit
-
-
- readresp:
-
- ach = ""
- do until (tchar = '0a'x)
- tchar = readch(serf,1)
- ach = ach || tchar
- end
- return
-
-
- waitforok:
-
- call writech(serf,'AT'||'0d'x)
- call readresp
- call readresp
- return
-