home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
TE2HOST.ZIP
/
WAIT4CAL.SCR
< prev
Wrap
Text File
|
1990-12-27
|
2KB
|
79 lines
;; --------------------------------------------------------------------------
;;
;; Wait4Cal.scr -- Host mode script suite for TE/2
;; Copyright 1990, Oberon Software, All rights reserved
;;
;; --------------------------------------------------------------------------
global integer MaximumBaud
global integer smMenuExit
string answerCall = "ATA^M"
string Reliable9600 = "9600/ARQ"
integer WaitCallD1 = 20 ;; Time (seconds) spent in waitfor
integer WaitCallD2 = 1 ;; Time (seconds) spent between waitfors
integer callerBaud ;; Current user baud rate
string mdmResponse ;; Standard Modem Response
;; ------------------------------------------------------------------------
;; WaitForCall uses a polling method of waiting, waiting for a "RING"
;; string from the modem rather than activating AutoAnswer. Currently
;; there is no reason to do this as opposed to using the modem's
;; built in AutoAnswer and waiting for "CARRIER" with an infinite
;; timeout. However, WATCHFORs (which really aren't applicable here)
;; and SCHEDULEd events (which are, when they are implimented, that is)
;; only get to execute in between statments in the currently running
;; script file.
subroutine WaitForCall
do while !connected
message("Waiting ..... %s^M", strtime)
if waitfor("RING", WaitCallD1)
transmit("%s", answerCall)
if waitfor("CONNECT", 30)
mdmResponse = rgets(255, 15, FALSE)
if strstr(mdmResponse, Reliable9600) == 0
callerBaud = atoi(mdmResponse)
if callerBaud == 0
callerBaud = 300
endif
if callerBaud != maximumBaud
setParms(-1, callerBaud, -1, -1, -1)
endif
else
callerBaud = maximumBaud
endif
message("^M^JCarrier Detected at %d^M^J", callerBaud)
break
else
hangup(FALSE)
sleep(WaitCallD2 * 1000)
endif
elseif timedout
sleep(WaitCallD2 * 1000)
else
run("menu_loc")
if smMenuExit
break
else
cls()
message("TE/2 Host Script^M^J")
message("Waiting for call...^M^J")
endif
endif
loop
endsub
program
gosub WaitForCall
end