XMM5 ; ACC-IHS ; MODEM CONTROL LOGIC FOR TIMPLEX MULTIPLEXOR LINE ; [ 09/30/93 4:33 PM ]
;;7.1;Mailman;**1003**;OCT 27, 1998
;;7.0;;ACC/IHS ROUTINE FROM;;3.08;3.27
;
Q
DTIMPLX ; "INITIALIZE" AND "DIAL" CODE
U IO W *13 D CLEAR
U IO W *13 F %=0:0 R Y:5 D STRIP Q:Y]"" Q:'$T
I Y'=" >>> " S Y="could not synchronize with Timeplex ["_Y_"]",ER=1 Q
;I 'SILENT U 0 W !,"Synchronized with Timeplex."
S ER=0 S X=XMPHONE D DIAL F %=1:1 D READ Q:NOMORE
S XMMSG=Y
I XMMSG["NO CONNECT" U IO W *27
I XMMSG'["COMPLETE" S Y=$S(XMMSG="":"timed out before receiving 'connect' msg from Timeplex",1:"received '"_XMMSG_"' msg from Timeplex"),ER=1
K XMMSG
Q
STRIP F %=0:0 Q:$A(Y)'=0 S Y=$E(Y,2,$L(Y))
S:$A(Y,$L(Y))=10 Y=$E(Y,1,$L(Y)-1)
S %=0
Q
;
HTIMPLX ; "HANGUP" CODE
U IO W $C(2),$C(3) H 1 W "BYE",*13 D CLEAR
;U IO
F %=0:0 R Y:60 Q:'$T Q:Y["Exit"
I Y'[">>>" D CLEAR W $C(2),$C(3) H 1
W "BYE",*13 D CLEAR
S Y="disconnected from Timeplex"
;I 'SILENT U 0 W !,"Timeplex disconnected and reset."
Q
;
STIMPLX ; "STATUS" CODE
S Y="no status report",ER=0
Q
;
TIMPLXM ;;CONNECT COMPLETE;;1
;;INVALID CONNECT REQUEST;;1
;;SORRY, NO CONNECTION;;1
;;>>>;0
;;UNRECOGNIZED RESPONSE!;;1
;
CLEAR F %=1:1 U IO R Y:2 Q:'$T ;u 0 w %,") ",Y,!
Q
DIAL ;I 'SILENT U 0 W !,"Dialing ",X,*13
U IO W X,*13
Q
READ U IO F %=1:1 R Y:5 Q:'$T&(Y="") D STRIP I Y]"" D FINDMSG S NOMORE=$P($T(TIMPLXM+Y),";;",3),Y=$P($T(TIMPLXM+Y),";;",2) Q
I '$T,Y="" S Y="NO RESPONSE FROM TIMEPLEX",NOMORE=1
Q
FINDMSG F XMI=0:1:4 S:Y="" XMI=4 Q:XMI=4 Q:Y[$P($T(TIMPLXM+XMI),";;",2)
S Y=XMI
K XMI
Q
XMM5 ; ACC-IHS ; MODEM CONTROL LOGIC FOR TIMPLEX MULTIPLEXOR LINE ; [ 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 ;
+4 QUIT
DTIMPLX ; "INITIALIZE" AND "DIAL" CODE
+1 USE IO
WRITE *13
DO CLEAR
+2 USE IO
WRITE *13
FOR %=0:0
READ Y:5
DO STRIP
IF Y]""
QUIT
IF '$TEST
QUIT
+3 IF Y'=" >>> "
SET Y="could not synchronize with Timeplex ["_Y_"]"
SET ER=1
QUIT
+4 ;I 'SILENT U 0 W !,"Synchronized with Timeplex."
+5 SET ER=0
SET X=XMPHONE
DO DIAL
FOR %=1:1
DO READ
IF NOMORE
QUIT
+6 SET XMMSG=Y
+7 IF XMMSG["NO CONNECT"
USE IO
WRITE *27
+8 IF XMMSG'["COMPLETE"
SET Y=$SELECT(XMMSG="":"timed out before receiving 'connect' msg from Timeplex",1:"received '"_XMMSG_"' msg from Timeplex")
SET ER=1
+9 KILL XMMSG
+10 QUIT
STRIP FOR %=0:0
IF $ASCII(Y)'=0
QUIT
SET Y=$EXTRACT(Y,2,$LENGTH(Y))
+1 IF $ASCII(Y,$LENGTH(Y))=10
SET Y=$EXTRACT(Y,1,$LENGTH(Y)-1)
+2 SET %=0
+3 QUIT
+4 ;
HTIMPLX ; "HANGUP" CODE
+1 USE IO
WRITE $CHAR(2),$CHAR(3)
HANG 1
WRITE "BYE",*13
DO CLEAR
+2 ;U IO
+3 FOR %=0:0
READ Y:60
IF '$TEST
QUIT
IF Y["Exit"
QUIT
+4 IF Y'[">>>"
DO CLEAR
WRITE $CHAR(2),$CHAR(3)
HANG 1
+5 WRITE "BYE",*13
DO CLEAR
+6 SET Y="disconnected from Timeplex"
+7 ;I 'SILENT U 0 W !,"Timeplex disconnected and reset."
+8 QUIT
+9 ;
STIMPLX ; "STATUS" CODE
+1 SET Y="no status report"
SET ER=0
+2 QUIT
+3 ;
TIMPLXM ;;CONNECT COMPLETE;;1
+1 ;;INVALID CONNECT REQUEST;;1
+2 ;;SORRY, NO CONNECTION;;1
+3 ;;>>>;0
+4 ;;UNRECOGNIZED RESPONSE!;;1
+5 ;
CLEAR ;u 0 w %,") ",Y,!
FOR %=1:1
USE IO
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 USE IO
FOR %=1:1
READ Y:5
IF '$TEST&(Y="")
QUIT
DO STRIP
IF Y]""
DO FINDMSG
SET NOMORE=$PIECE($TEXT(TIMPLXM+Y),";;",3)
SET Y=$PIECE($TEXT(TIMPLXM+Y),";;",2)
QUIT
+1 IF '$TEST
IF Y=""
SET Y="NO RESPONSE FROM TIMEPLEX"
SET NOMORE=1
+2 QUIT
FINDMSG FOR XMI=0:1:4
IF Y=""
SET XMI=4
IF XMI=4
QUIT
IF Y[$PIECE($TEXT(TIMPLXM+XMI),";;",2)
QUIT
+1 SET Y=XMI
+2 KILL XMI
+3 QUIT