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

SPI Concepts and Protocol
SPI Programming Manual427506-006
2-35
Continued Responses
indicate, for instance, that there are no more objects to process because the remaining
objects were deleted since the server returned the last response.)
The absence of a context token is the only valid indicator of the last response
message. Your application should always check for the context token (it can do so with
a simple call to SSGET). It should never rely on a particular return-token value or on a
particular number of response messages or response records to determine that there
are no more replies.
Be aware that the context token can vary in size. It is not safe to store it in a work
areaalways copy it directly from response to command using the SSMOVE
procedure.
Figure 2-11
on page 2-36 illustrates the exchange of messages when the subsystems
response is continued over several response messages.
Multiple Response Records per Message in a Continued
Response
Even with multiple response records per response message, it still might not be
possible to fit the response records for all the objects into a single response message.
In such cases, the subsystem forms a continuation response by including the context
token, just as it would in the case of a single response record per response.
Figure 2-11
on page 2-36 shows that in the case of multiple response records per
response, as in the case of a single response record, the presence of a context token
indicates that the response can be continued. In a response message containing
multiple response records (or a single response record enclosed in a data list), the
context token is the only token that is not enclosed within a data list. The context token
is not in a list because it represents an attribute of the entire response message rather
than an attribute of a particular response record. As in the single-response-record
case, the only valid way to detect that there are no more response messages is by the
absence of a context token.
If the requester asks for
n response records per response, but its buffer is not large
enough to hold that many, the server does not consider the situation an error, but
returns fewer than
n response records per responseonly the number that fit. The
requester can determine the number of response records actually returned by counting
the top-level data lists in the response message.
Note. Although this and other figures illustrating the buffer show the context token last, your
application must not depend on its being in any particular position in the buffer. In SSMOVE
calls that refer to the context token, specify an index of 1 to ensure position transparency.