home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Electronics Boutique Holiday Catalog 1996
/
EB1996Holiday.iso
/
a3w_data
/
cnnct.scr
< prev
next >
Wrap
Text File
|
1996-06-28
|
2KB
|
84 lines
# Clear the receive buffer
ClearBuffer ;
# Close and open the port
# note: some modems require this sequence be sent twice
ClosePort ;
Wait Seconds(1);
OpenPort baud(%BAUD%) Bits(7);
Wait Seconds(1);
ClosePort ;
Wait Seconds(1);
OpenPort baud(%BAUD%) Bits(7);
#Send the 'reset to factory config' command and check for OK or ERROR
Say String(%RESET%);
:check_1
GetAnswer Timeout(2);
IfAnswer is(Equal) to(ERROR) goto(ok_1);
IfAnswer is(NotEqual) to(OK) goto(check_1) MaxRepeat(2);
# Send the modem initilization string
:ok_1
ClearBuffer ;
Say String(%INIT%) ;
:check_2
# Use line mode to receive data up to the Carriage Return. This way
# we are sure to get the baudrate with the CONNECT message from the modem.
GetAnswer Timeout(2);
IfAnswer is(Equal) to(ERROR) goto(ok_2);
IfAnswer is(NotEqual) to(OK) goto(check_2) MaxRepeat(05);
# Now send the dial command to the modem
:ok_2
ClearBuffer ;
Say String(ATD%PTYPE%%ESC%%PHONE%);
# Wait for the CONNECT from the modem for 60 seconds (30 * 2)
:check_3
GetAnswer Timeout(2) Mode(LINE);
IfAnswer is(Equal) to(BUSY) goto(exit_bad);
IfAnswer is(Equal) to(NO CARRIER) goto(exit_bad);
IfAnswer is(NotEqual) to(CONNECT) goto(check_3) maxrepeat(30);
IfAnswer is(NotEqual) to(CONNECT) goto(exit_bad);
# Send characters necessary for autobps for the Series/1
say cr(y);
Wait Seconds(2);
say cr(y);
# Get the connect baud rate and put it in CNNCTBAUD to be displayed
# using the display script.
# We do this here to make sure we received all characters in the
# baud rate (instead of CONNECT 240)
GetAnswer Timeout(0);
IfAnswer is(Equal) to(NO CARRIER) goto(exit_bad);
GetValue after(CONNECT ) into(CNNCTBAUD);
Go to(exit_ok);
# Error return - no CONNECT message
:exit_bad
Return code(12130);
# Normal return - continue processing
:exit_OK
Return code(0);