home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / MODEMS / CW_HAYES.ZIP / CW.BAS (.txt) next >
Encoding:
GW-BASIC  |  1986-09-03  |  2.0 KB  |  38 lines

  1. 10  'This short program solves the problem of call waiting interrupting
  2. 20  'a communications session. Just run this before your communcations
  3. 21  ' program. It remains in effect until you reset your Hayes Smartmodem
  4. 22  '
  5. 30  COLOR 15,9
  6. 31  CLS:LOCATE 12,18
  7. 32  PRINT CHR$(7);"Setting Hayes Smartmodem 1200 for Call Waiting"
  8. 35  OUT 1020,4:GOSUB 110:OUT 1020,3:GOSUB 110
  9. 40  OPEN "COM1:1200,N,8,1,DS" AS #1:GOSUB 110
  10. 50  MSG$="ATS10=100"+CHR$(13):GOSUB 100:GOSUB 110
  11. 70  CLOSE
  12. 71  LOCATE 12,1:PRINT SPACE$(80)
  13. 72  LOCATE 12,22:PRINT CHR$(7);"Now execute comm"
  14. 80  SYSTEM
  15. 100  FOR X=1 TO LEN(MSG$):PRINT #1,MID$(MSG$,X,1);:NEXT
  16. 110  FOR X=1 TO 2000:NEXT
  17. 120  RETURN
  18. 125  '
  19. 130  ' Line 35: Port 1020 (3FC) is the MCR (Modem Control Register). The
  20. 131  '          bits are described on page 6-9 of the Hayes Smartmodem
  21. 132  '          1200 manual. First CALLWAIT sends a 4, which enables the
  22. 133  '          interrupt line drivers, and allows the UART to interrupt
  23. 134  '          the controller. If there are any problems with the serial
  24. 135  '          port, this command should generate some kind of error.
  25. 136  '          OUT 1020,3 will reset the modem and is equivalent to
  26. 137  '          power off/power on. This must be held for at least 50 ms.
  27. 138  '          This is done using the timing loop at line 110.
  28. 139  '
  29. 140  ' Line 40: Open the COM1 port for 1200 baud, no parity and 8 bit words
  30. 141  '          using buffer #1.
  31. 142  '
  32. 143  ' Line 50: Sends a command to the modem. The AT is the ATtention code,
  33. 144  '          which must precede all modem commands. The S10=100 is
  34. 145  '          described on page 6-7 of the manual. It allows the carrier
  35. 146  '          signal to momentarily disappear. The S10=100 sets the time
  36. 147  '          interval for which the carrier may be lost. This interval
  37. 148  '          is adjustable in tenths of a second.
  38.