home *** CD-ROM | disk | FTP | other *** search
- Article 362 of comp.sys.amiga:
- Path: mcdsun!noao!hao!nbires!seismo!lll-crg!ames!ucbcad!ucbvax!CORY.BERKELEY.EDU!dillon
- From: dillon@CORY.BERKELEY.EDU (Matt Dillon)
- Newsgroups: comp.sys.amiga
- Subject: A great program to autorun your favorite modem program from boot!
- Message-ID: <8612020407.AA07315@cory.Berkeley.EDU>
- Date: 2 Dec 86 04:07:23 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Organization: University of California at Berkeley
- Lines: 214
-
- Problem:
-
- I want to execute my modem program from my workbench startup program,
- but only if my modem is on.
-
- Answer:
- CHECKMODEM [cli-command] [-s ascii string to transmit]
-
- Preference serial parameters are used.
-
- The cli-command is sent and the ascii string transmited only if the
- program finds the modem connected. The program determines if the
- modem is connected by sending some characters over and waiting
- for them to be echo'd back. The program will wait for up to
- 3/50's of a second.
-
- As far as I know, any modem's local echo is quick enough. Most
- host-echo's (already connected to something) are not.
-
- Additionaly, the program returns an error code of 20 if it does
- not find a modem.
-
- Other:
- CHECKMODEM opens the serial device then closes it. If your modem
- is setup such that closing the serial device drops the carrier, the
- program will probably terminate the telephone connection if there
- is one active.
-
- However, the program has been designed more for placing in your
- boot script or .login (if you are using my SHELL), when the modem
- likely would not have an active connection.
-
- Source:
- NOTE: You need my library to get a working copy of the program from
- the source. If you are on the ARPAnet, simply
-
- ftp ucbvax.Berkeley.EDU
- name = anonymous, password = guest, and CD amiga.
-
- else mail me.
-
-
-
- Shell Examples: (V2.03)
-
- % checkmodem; mymodemprogram
-
- (mymodemprogram is only executed if CHECKMODEM does not return
- an error)
-
- % checkmodem -s atdt 5551234; mymodemprogram
-
- (same as above, but CHECKMODEM will send the string 'atdt 5551234'
- terminated by a CR before returning. Thus, it's busy dialing
- dialing while your amiga is loading your modem program)
-
-
- CLI Examples:
-
- 1> checkmodem mymodemprogram -s atdt 5551234
-
-
- (From a CLI, it's usually better to have CHECKMODEM execute the
- program)
-
- 1> checkmodem run mymodemprogram -s atdt 5551234
-
- (Here, we are RUNing it so the checkmodem program returns immediately)
-
-
- Algorithm Outline:
-
- - Open serial device (return error code 20 if can't open serial device)
- - Clear input queue
- - send <CR>AT<CR>
- - Delay(3) /* 3/50 second */
- - check to see if any data present:
- - send optionaly specified string [-s string], add the CR
- - CLOSE serial device
- - Execute("commandline",0 ,0) if commandline specified.
- - exit(0)
-
- (no data present)
- - CLOSE serial device
- - exit(20)
-
- ---------------------------------------------------------------
-
-
-