6100 ADCCP Programming Manual
Application Tasks
Writing Applications that Use ADCCP
069225 Tandem Computers Incorporated 4–17
Defining the Station List The application must define the station list if the link is a multipoint link or if the line
control mode is Asynchronous Balanced Mode (ABM). To define the station list, the
application makes a WRITEREAD call with the DEFINELIST request.
The following example is a TAL procedure that uses WRITEREAD to make a request.
In this example, the variable D in the WRITEREAD call is used for the DEFINELIST
request and response.
proc receive(filenumber,list,txtout,txtin,cmd,count,tag^value) variable; !function
int filenumber, !value parameters
txtout,
txtin,
count,
cmd;
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
CALL WRITEREAD(filenumber,D,length, count,count^trans,tag^value);
end;
The following example is a C Language function that uses WRITEREAD to make a
request. In this example, dPtr is a pointer to the the WRITEREAD buffer.
WRITEREAD is used to make the DEFINELIST request and response.
void Receive(rfnum,function_code,textout,textin,length,dPtr)
short rfnum; /* IN - file number from OPEN returned from
* Open_line.
*/
short function_code; /* IN - Request number.
*/
short textout; /* IN - text out length for request.
*/
short textin; /* IN - text in length for response.
short length; /* IN - length of the WRITEREAD buffer.
* calculated in the calling function.
*/
struct message *dPtr; /* IN/OUT - Points to the structured variable
* that contains the request/response data
* for the WRITEREAD buffer.
*/
{
short c_code = 0;
short count;
short count_trans;
int error;
/*
* The values for the specific request are assigned to the
* structure for the request and the buffer length is set.
*/
dPtr->function = function_code;
dPtr->modifier = 0;
dPtr->request_id = function_code;