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

SPI Concepts and Protocol
SPI Programming Manual427506-006
2-37
Continued Responses
Response Continuation Protocol
These steps summarize the protocol for continuing a response. Each step corresponds
to an item in Figure 2-11
on page 2-36:
1. The requester composes a command that is to be applied to multiple objects. In
this example, the requester specifies a value of 1 for ZSPI-TKN-MAXRESP,
telling the server to return as many response records as it can fit in each response
message. Anticipating numerous response records and the possibility that more
than one response message will be needed to return all of the response records,
the requester saves a copy of the command buffer before sending the command.
(The reason for this is explained in step 5.) The requester then sends the
command to the server.
2. When the server finds an object (object
a) that qualifies for processing based on
the criteria in the command, it determines whether there is room in the buffer for
both the largest possible response record and the largest possible context token. If
there is room, the server applies the command to the object and adds the
response record to the buffer. MAXRESP = 1, so the record is enclosed in a data
list.
3. The server searches for another qualifying object, and finds object
b. Again, the
server verifies that both the largest possible response record and largest possible
context token fit in the remaining buffer, and then applies the command and
composes the response record.
4. The server continues to look for qualifying objects, and finds object
c. This time,
however, there is not enough space remaining in the buffer for a response record
and a context token, so the server does not apply the command. Instead, it collects
the information it will need to resume processing with this object, stores this
information in ZSPI-TKN-CONTEXT, and returns this token with the completed
response records.
5. Detecting the context token in the response message, the requester knows that not
all qualifying objects were processed. To have the server continue processing, the
requester copies the context token from the response to a duplicate of the original
command (which it saved in step 1) and sends this command to the server. The
requester does not examine or modify the contents of the context token.
6. When the server receives the command, it uses the information in the context
token along with the information in the original command to resume processing. In
this example, the server processes two more objects,
c and d, before it again runs
out of buffer space. The server prepares a new context token and returns it in the
response message.
7. The requester, seeing that more objects remain to be processed, returns the new
context token in a copy of the original command.
8. The server resumes processing, applying the command to one last object (
e) and
returning the response record for that object. The absence of the context token