6100 ADCCP Programming Manual

ADCCP Programming Example Using Transaction Application Language (TAL)
B–22 069225 Tandem Computers Incorporated
return error;
end; !end of check^awaitio procedure
This procedure issues all requests to the ADCCP protocol module , except those
requests handled by the recflush procedure above.
proc receive(filenumber,list,txtout,txtin,cmd,count,tag^value) variable; !functio
int filenumber,txtout,txtin,count,cmd; !value parameters
int(32) tag^value; !optional value parameter
string .list; !optional reference parameter
begin
int length;
d.msg.cmd := cmd; !MOVE FUNCTION BYTE
d.msg.mod := 0; !MOVE MODIFIER
d.msg.req^id := cmd; !USE FUNCTION CODE AS ID
d.msg.text^out := txtout; !MOVE LENGTH OF TEXT FIELD IN REQUEST
d.msg.text^in := txtin; !MOVE LENGTH OF TEXT FIELD IN !RESPONSE
length := $LEN(D.basic) + txtout;
if NOT $PARAM(tag^value) then tag^value := 0D;
if $PARAM(list) then
d.config.text ':=' list for txtout; !move definelist^array
This is a request to the ADCCP protocol module. The calling procedure furnishes
the WRITEREAD parameters, as well as values to be placed in the request buffer
(D).
CALL WRITEREAD(filenumber,D,length, count,count^trans,tag^value);
end; !end of procedure
This procedure makes the requests needed to start up the line.
?page "SETMODE^LINE"
Int proc setmode^line;
begin
INT P1,P2;
INT(32) WAIT^TIME;
WAIT^TIME := 1000D; !10 SECONDS
FETCH CONFIGURATION request.
call receive(rfnum,,0,40,ltf^fetch^config,$LEN(d.basic)+40);
CALL CHECK^AWAITIO(WAIT^TIME,LTF^FETCH^CONFIG);
IF ERROR THEN
BEGIN
sbuf[9] ':=' "fetch config error: " -> @ptr;
call write^err^msg;
RETURN FALSE;
END;
!MOVE THE DEFAULT PARAMETERS FROM D.MSG.TEXT
B^SET^CONFIG ':=' D.CONFIG.TEXT FOR $LEN(SET^CONFIG);
if startup^pri^sec^parm then !STARTUP msg will override SYSGEN
if startup^says^sabm then
do^sabm := true
else do^sabm := false;
These assignments override various defaults in the configuration block.
!SET ABM MODE AND NO TRANSLATION
SET^CONFIG.MODE^SUPPORT := ABM;
SET^CONFIG.TRANSLATE^ON := FALSE;
! ENSURE FDX ,TWS MODE OF OPERATION
IF SET^CONFIG.MODE^SUPPORT = NRM OR SET^CONFIG.MODE^SUPPORT = ARM
THEN SET^CONFIG.REJOK := TRUE;
SET^CONFIG.TWS := TRUE;
SET^CONFIG.HALF^DUPLEX := FALSE;
SET^CONFIG.MAX^FRAME^SIZE := (FRAMESIZE + FRAMESIZE);