XMM6 ; ACC-IHS ; MODEM CONTROL LOGIC FOR COURIER AUTODIAL MODEM ; [ 09/30/93 4:33 PM ]
;;7.1;Mailman;**1003**;OCT 27, 1998
;;7.0;;ACC/IHS ROUTINE FROM;;3.08;3.27;
Q
DMULTI ; "INITIALIZE" AND "DIAL" CODE
U IO W *13 D CLEAR
U IO W "ATQ0V0E0",*13 D CLEAR
U IO W "ATH",*13 R Y:5 S:'$T Y="" I Y'=0 S Y="could not synchronize with modem ["_Y_"]",ER=1 Q
;I 'SILENT U 0 W !,"Synchronized with modem."
S ER=0 S X="ATDT"_XMPHONE D DIAL F %=1:1 D READ Q:NOMORE
I Y'["CONNECT" S Y=$S(Y="":"timed out before receiving 'connect' msg from modem",1:"received '"_Y_"' msg from modem"),ER=1 Q
Q
;
HMULTI ; "HANGUP" CODE
U IO W "+++",*13 H 1 W "ATZ",*13 D CLEAR
W "ATH0V1",*13
F %=0:0 R Y:60 Q:'$T Q:Y["OK"
;I 'SILENT U 0 W !,"Modem disconnected and reset."
Q
;
SMULTI ; "STATUS" CODE
S Y="no status report",ER=0
Q
;
MULTIM ;;OK;;1
1 ;;CONNECT;;1
2 ;;RING;;0
3 ;;NO CARRIER;;1
4 ;;ERROR;;1
5 ;;CONNECT 1200;;1
6 ;;NO DIAL TONE;;1
7 ;;BUSY;;1
8 ;;NO ANSWER;;1
9 ;;reserved;;0
10 ;;CONNECT 2400;;1
11 ;;RINGING;;0
12 ;;NOT USED;;0
13 ;;NOT USED;;0
14 ;;CONNECT /ARQ;;1
15 ;;CONNECT 1200/ARQ;;1
16 ;;CONNECT 2400/ARQ;;1
;
CLEAR U IO F %=1:1 R *Y:2 Q:'$T
Q
DIAL ;I 'SILENT U 0 W !,"Dialing ",X,*13
U IO W X,*13
Q
READ ;S Y="" U IO F %1=1:1 R C#1:60 Q:'$T I C'=$C(10) U 0 W !,?3,%1,?5,C U IO S:C'="" Y=C I C="" S NOMORE=$P($T(MULTIM+Y),";;",3),Y=$P($T(MULTIM+Y),";;",2) Q
S Y="" U IO F %1=1:1 R C:60 Q:'$T I C'=$A(10) S Y=C,NOMORE=$P($T(MULTIM+Y),";;",3),Y=$P($T(MULTIM+Y),";;",2) Q
I '$T S Y="NO RESPONSE FROM MODEM",NOMORE=1
Q
XMM6 ; ACC-IHS ; MODEM CONTROL LOGIC FOR COURIER AUTODIAL MODEM ; [ 09/30/93 4:33 PM ]
+1 ;;7.1;Mailman;**1003**;OCT 27, 1998
+2 ;;7.0;;ACC/IHS ROUTINE FROM;;3.08;3.27;
+3 QUIT
DMULTI ; "INITIALIZE" AND "DIAL" CODE
+1 USE IO
WRITE *13
DO CLEAR
+2 USE IO
WRITE "ATQ0V0E0",*13
DO CLEAR
+3 USE IO
WRITE "ATH",*13
READ Y:5
IF '$TEST
SET Y=""
IF Y'=0
SET Y="could not synchronize with modem ["_Y_"]"
SET ER=1
QUIT
+4 ;I 'SILENT U 0 W !,"Synchronized with modem."
+5 SET ER=0
SET X="ATDT"_XMPHONE
DO DIAL
FOR %=1:1
DO READ
IF NOMORE
QUIT
+6 IF Y'["CONNECT"
SET Y=$SELECT(Y="":"timed out before receiving 'connect' msg from modem",1:"received '"_Y_"' msg from modem")
SET ER=1
QUIT
+7 QUIT
+8 ;
HMULTI ; "HANGUP" CODE
+1 USE IO
WRITE "+++",*13
HANG 1
WRITE "ATZ",*13
DO CLEAR
+2 WRITE "ATH0V1",*13
+3 FOR %=0:0
READ Y:60
IF '$TEST
QUIT
IF Y["OK"
QUIT
+4 ;I 'SILENT U 0 W !,"Modem disconnected and reset."
+5 QUIT
+6 ;
SMULTI ; "STATUS" CODE
+1 SET Y="no status report"
SET ER=0
+2 QUIT
+3 ;
MULTIM ;;OK;;1
1 ;;CONNECT;;1
2 ;;RING;;0
3 ;;NO CARRIER;;1
4 ;;ERROR;;1
5 ;;CONNECT 1200;;1
6 ;;NO DIAL TONE;;1
7 ;;BUSY;;1
8 ;;NO ANSWER;;1
9 ;;reserved;;0
10 ;;CONNECT 2400;;1
11 ;;RINGING;;0
12 ;;NOT USED;;0
13 ;;NOT USED;;0
14 ;;CONNECT /ARQ;;1
15 ;;CONNECT 1200/ARQ;;1
16 ;;CONNECT 2400/ARQ;;1
+1 ;
CLEAR USE IO
FOR %=1:1
READ *Y:2
IF '$TEST
QUIT
+1 QUIT
DIAL ;I 'SILENT U 0 W !,"Dialing ",X,*13
+1 USE IO
WRITE X,*13
+2 QUIT
READ ;S Y="" U IO F %1=1:1 R C#1:60 Q:'$T I C'=$C(10) U 0 W !,?3,%1,?5,C U IO S:C'="" Y=C I C="" S NOMORE=$P($T(MULTIM+Y),";;",3),Y=$P($T(MULTIM+Y),";;",2) Q
+1 SET Y=""
USE IO
FOR %1=1:1
READ C:60
IF '$TEST
QUIT
IF C'=$ASCII(10)
SET Y=C
SET NOMORE=$PIECE($TEXT(MULTIM+Y),";;",3)
SET Y=$PIECE($TEXT(MULTIM+Y),";;",2)
QUIT
+2 IF '$TEST
SET Y="NO RESPONSE FROM MODEM"
SET NOMORE=1
+3 QUIT