home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 592a.lha / RexxModem / modemsave.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1991-11-12  |  1.2 KB  |  77 lines

  1. /*    get modem info, save as reg data (binary bytes).
  2.  
  3.     if there isn't a modem, or it isn't hayes compatable and if the
  4.     setup isn't normal (i.e. like mine :-), this script will hang.
  5. */
  6.  
  7. reg.0.type = 0
  8. reg.1.type = -1
  9. reg.2.type = 1
  10. reg.3.type = 1
  11. reg.4.type = 1
  12. reg.5.type = 1
  13. reg.6.type = 0
  14. reg.7.type = 0
  15. reg.8.type = 0
  16. reg.9.type = 0
  17. reg.10.type = 0
  18. reg.11.type = -1
  19. reg.12.type = 0
  20. reg.13.type = -1
  21. reg.14.type = 2
  22. reg.15.type = -1
  23. reg.16.type = -1
  24. reg.17.type = -1
  25. reg.18.type = -1
  26. reg.19.type = -1
  27. reg.20.type = -1
  28. reg.21.type = 2
  29. reg.22.type = 2
  30. reg.23.type = 2
  31. reg.24.type = -1
  32. reg.25.type = 1
  33. reg.26.type = 1
  34. reg.27.type = 2
  35.  
  36.  
  37. if (~show('L','rexxsupport.library')) then do
  38.     call addlib('rexxsupport.library',0,-30,0)
  39. end
  40.  
  41. call open(serf,'SER:')
  42.  
  43. call waitforok
  44.  
  45. save = ''
  46. do regs=0 to 27
  47. if reg.regs.type = -1 then iterate /* skip unused stuff */
  48. call writech(serf,'ATS'||regs||'?'||'0d'x)
  49. call readresp /* echo */
  50. call readresp /* goodie! */
  51. save = save || d2c(+substr(ach,1,3))
  52. call readresp /* pad */
  53. call readresp /* ok */
  54. end
  55.  
  56. say save
  57.  
  58. exit
  59.  
  60.  
  61. readresp:
  62.  
  63. ach = ""
  64. do until (tchar = '0a'x)
  65.     tchar = readch(serf,1)
  66.     ach = ach || tchar
  67. end
  68. return
  69.  
  70.  
  71. waitforok:
  72.  
  73. call writech(serf,'AT'||'0d'x)
  74. call readresp
  75. call readresp
  76. return
  77.