SPI Programming Manual (G06.24+, H06.03+, J06.03+)

General SPI Programming Guidelines
SPI Programming Manual427506-006
5-16
Guidelines for SPI Servers
Initialize every request with the SSID provided by the subsystem. Do not reuse a
response message without initializing itsome header values set by the server are
not appropriate for the request.
Avoid defining data items with names beginning with
Z
.
Tolerate unrecognized tokens in a response.
Ignore responses that contain the empty response return code.
Use only the absence of a context token as an indicator that a response message
completes a response.
Be aware that the context token can vary in sizecopy it directly from the
response to the new request.
Supply the same read count in a WRITEREAD call as was used for the SSINIT
buffer length.
Always call SSPUT with the special operation code ZSPI-TKN-RESET-BUFFER
after receiving a response message.
Guidelines for SPI Servers
Review these guidelines if you are going to write an SPI interface to a subsystem.
Recommending a Buffer Size
SPI servers should declare a recommended buffer size. The value selected should be
large enough to guarantee that a requester that allocates a buffer of that size can
accommodate all server-supported commands and associated responses. The value
should be large enough to satisfy command and response requirements for at least as
long as you intend to support the current version of the server. Make this value
available to requesters by including a CONSTANT declaration in the server DDL. All
NonStop Kernel subsystems define the recommended buffer size with a name of the
form
subsys-VAL-BUFLEN.
Calculating a Recommended Buffer Size
You can approximate the minimum required buffer size:
approx size = hdr + (4 * tokens)
+ (12 * ssid-qual-tokens)
+ sum-value-size
+ (2 * lists)
+ cushion
Note. TACL has an absolute maximum I/O buffer size of 4096 bytes.