GDSX Manual

User Exit Descriptions
Extended General Device Support (GDSX) Manual134303
9-16
USER^COMMANDS
==
== The following routines are handy for communicating with an SPI subsystem
==
?SECTION spi^open MACRO
== (p1) = Name of subsystem to open (E.G. $GDS.#ZSPI)
#PUSH err io_err
#PUSH reply request == Send and reply buffers
#SET err [#REQUESTER/WAIT [zgds^val^buflen]/READ %1%.#ZSPI io_err reply
request]
[#IF [err]
|THEN| leave^routine error [err] opening SPI subsystem
]
#POP err
?SECTION spi^send MACRO
== Send a SPI buffer and wait for the response
#APPENDV request %1% == Send the request
#EXTRACTV reply %1% == Get the response
[#IF NOT [#EMPTYV io_err]
|THEN| leave^routine I/O error [io_err] sending SPI request to spi
]
?SECTION spi^close MACRO
== Terminate communication with an SPI subsystem
#PUSH err
#SET err [#REQUESTER CLOSE request]
[#IF [err]
|THEN| leave^routine Error [err] closing SPI subsystem
]
#POP err io_err request reply
?SECTION spicmd MACRO
#PUSH err
#SET err [%*%]
[#IF [err]
|THEN| leave^routine [spi^error [err]]: %*%
]
#POP err
?SECTION attach^definitions MACRO
== Include the SPI & GDSX definitions if not currently defined
[#IF NOT [#VARIABLEINFO/EXISTENCE/:GDSX]
|THEN| attachseg SHARED taclseg :GDSX
]
?SECTION verify^process MACRO
== The following is necessary due to a bug in #ARGUMENT that
== does not enforce that a process name actually exists.
== Due to be fixed in TACL-C20.
[#IF NOT [#PROCESSEXISTS %1%]
|THEN| leave^routine Process does not exists: %1%
]
Example 9-1. Listing of TELLGDS File (page 3 of 4)