6100 ADCCP Programming Manual
ADCCP Programming Example Using Transaction Application Language (TAL)
B–26 069225 Tandem Computers Incorporated
CHANGELIST request.
call check^awaitio(wait^time,ltf^changelist);
if error then
begin
sbuf[9] ':=' "changelist error : " -> @ptr;
call write^err^msg;
return false;
end;
d.msg.text.byte[1] := 1;
d.msg.text.byte[2] := M^SABM; !set ABM mode
MODE SET request.
call receive(rfnum,,2,2,ltf^mode^set,$LEN(d.basic)); !SABM
wait^time := 1000D; !wait 10 seconds
call check^awaitio(wait^time,ltf^mode^set);
if error then
begin
sbuf[9] ':=' "modeset error: " -> @ptr;
call write^err^msg;
return false;
end;
first^time := true; !session started -- post 3 reads flag
RETURN TRUE; !SESSION STARTED FOR BOTH SIDES
end;
This procedure builds the Text field for a SENDTEXT request.
subproc build^buf(wbuf);
int .wbuf;
begin
int length^left,
.iptr;
length^left := framesize - 1;
These are the contents of the first word of the text field.
write^mcw.<0:7> := 1; !station id
Write^mcw.<8:15> := 0; !DO NOT SET P/F BIT FOR Station status
@iptr := @write^data;
The second word of the text field is out^key, which serves as a sequence number
for the frame. Out^key is specific to this application; ADCCP regards it simply as
data. The field "The quick brown fox..." occurs as often as the frame size allows,
with an instance of out^key preceding each instance of "The quick brown fox...."
Out^key increases by 1 for each frame and wraps around after 32767.
while length^left do
begin
iptr := out^key;
if (length^left := length^left - 1) then
if length^left >= fox^msg^size then
begin
iptr[1] ':=' brown^fox^msg for fox^msg^size -> @iptr;
length^left := length^left - fox^msg^size;
end
else
begin
iptr[1] ':=' iptr for length^left;
length^left := 0;
end;
end;