OSI/MHS Management Programming Manual
Examples
OSI/MHS Management Programming Manual—424824-001
C-15
SPI Example in TAL
Character^Count BYTES;
Got^It := zSpi^Val^True;
END;
END;
END; -- while
END; -- PROC Get^MHSMGR^Name
? PAGE "GetResponse^Loop"
-------------------------------------------------------------
--
-- GetResponse^Loop - Get responses from OSI/MHS iteratively
-- by sending the command with the context token, until
-- there is no context token in the response buffer.
--
-- GLOBALS. Spi^Buffer . SPI buffer containing the
-- command to be sent
-- Spi^Buffer^Copy . Copy of original SPI command
-- SSErr . Set to SPI error value
-- RetCode . Set to the retcode value
-- in the SPI response
-- Term^Fn . File number of home terminal
-- Term^Buf . Buffer used for terminal I/O
-- INPUT. None
-- OUTPUT. None
--
-------------------------------------------------------------
INT PROC GetResponse^Loop;
BEGIN
INT Object^Type; -- value of zCom^Tkn^Objtype
INT .ObjName [0:132]; -- value of zCom^Tkn^ObjName
INT ObjName^Count; -- count of zCom^Tkn^ObjName
INT ObjName^Index; -- index to get zCom^Tkn^ObjName
INT DataList^Count; -- count of zSpi^Tkn^DataList
INT DataList^Index; -- index of zSpi^Tkn^DataList
INT Complete; -- flag for continuation
INT(32) Token^Id; -- token code for zSpi^Tkn^Count
INT .Objectnm1 [0:4] := [3, "MON"];
INT .Objectnm2 [0:4] := [6, "SUBSYS"];
INT .Objectnm3 [0:4] := [5, "CLASS"];
INT .Objectnm4 [0:4] := [5, "GROUP"];
INT .Objectnm5 [0:4] := [7, "PROCESS"];
INT .Objectnm6 [0:4] := [3, "MTA"];
INT .Objectnm7 [0:4] := [5, "ROUTE"];
INT .Objectnm8 [0:4] := [4, "APPL"];
INT .Objectnm9 [0:4] := [7, "GATEWAY"];
INT .Objectnm10[0:4] := [5, "DLIST"];
INT .Objectnm11[0:6] := [11, "DLISTMEMBER"];
INT .Objectnm12[0:4] := [3, "CUG"];
INT .Objectnm13[0:5] := [9, "CUGMEMBER"];
INT .Objectnm14[0:3] := [5, "ENTRY"];
INT .Objectnm15[0:10] := [19, "UNKNOWN OBJECT TYPE "];
-- Save the original command.
Spi^Buffer^Copy ':=' Spi^Buffer FOR
zMHS^Val^BufLen BYTES;
Complete := zSpi^Val^False;
WHILE ( Complete = zSpi^Val^False ) DO
BEGIN
-- Send the command to the OSI/MHS subsystem.
CALL Send^SpiCmd;