WAN Manager SPI Programming Guide

Communicating With the WAN Manager Process
WAN Manager SPI Programming Guide540013-001
2-3
Sending a Command Message
Example
Consider the example of a management application trying to start an adapter.
At the SCF prompt, enter the command, START ADAPTER $ZZWAN.#S11, where
$ZZWAN.#S11, is the object name of the adapter. The internal SPI module of the WAN
manager (#ZSPI) receives the SPI command.
1. Open the #ZSPI internal module of the WAN manager by calling the FILE_OPEN_
procedure:
char *filename = "$ZZWAN.#ZSPI";
short filename_len = strlen(filename);
short filenum;
short err;
if (FILE_OPEN_(filename, filename_len, &filenum))
{
return FAILURE;
}
2. Define the SPI buffer:
#define max_bufsize 3900
short spi_buffer[max_bufsize];
3. Call the SPI procedure SSINIT to initialize the SPI buffer:
a. Define the subsystem ID (spi_ssid):
typedef struct __zwan_val_ssid
{
union
{
char z_filler[8];
zspi_ddl_char8_def z_owner;
} u_z_filler;
zspi_ddl_int_def z_number;
zspi_ddl_uint_def z_version;
} zwan_val_ssid_def;
zwan_val_ssid_def spi_ssid = {{ZSPI_VAL_TANDEM},
ZSPI_SSN_ZWAN, ZWAN_VAL_VERSION};