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

General SPI Programming Guidelines
SPI Programming Manual427506-006
5-11
Preparing the Command Buffer
Error 16: File Number Has Not Been Opened
The management process rejected an open attempt because it had not yet completed
its own initialization when it received the open request. Try the open again later.
Error 17: Error on Backup Open
The process rejected a backup open attempt because there was no matching primary
open; because the parameters for the backup open did not match those of the primary
open; or because the primary process was not running.
Open the process by name rather than by
cpu,pin. If opening by name is not feasible,
open the primary process first, use matching parameters for the primary and backup
opens, and check that the primary process is running.
Error 28: Sync Depth or Nowait Depth Limit Exceeded
The process rejected an open attempt because it could not accommodate the sync
depth or nowait depth requested by the opener. Check for program logic errors. If there
are no logic errors, reduce the sync depth or nowait depth.
Error 48: Security Violation
The process rejected an open attempt because the requester did not have the proper
security to communicate with the process. One reason for this error could be that the
application attempted to open an HP data-communications subsystem process for SPI
communication. In this case, open an SCP process instead, as described in the
SPI
Common Extensions Manual
.
Preparing the Command Buffer
Your application must allocate a buffer for communicating with the subsystem. The
application uses the SPI procedures to initialize this buffer, put information into it, and
extract information from it when it is returned as a response, as described in Section 3,
The SPI Procedures.
Each NonStop Kernel subsystem specifies a recommended buffer size that is large
enough to satisfy command and response requirements for all the subsystems
commands. Some subsystems specify different recommended buffer sizes for different
commands. You should declare your buffer to be at least as large as the buffer size
recommended by the subsystem for the command you are sending.
Your application can allocate the buffer dynamically. At any time between calls to the
SPI procedures, your application can make copies of the buffer or move it to a different
data location in either the data area or an extended segment. An application should
keep a copy of each command buffer it sends in case retries are needed; it also must
keep a copy to resend if the subsystem can return its response information in more
than one response message.