WAN Manager SPI Programming Guide

Communicating With the WAN Manager Process
WAN Manager SPI Programming Guide540013-001
2-4
Sending a Command Message
b. Define the SPI token structure (spi_token) and a temporary command buffer
(spi_cmd):
typedef struct
{
unsigned long tkn_name;
unsigned char tkn_value[200];
short tkn_length;
short tkn_type;
} spi_token;
spi_token spi_cmd[50];
c. Add all the tokens required for the SPI procedure SSINIT and initialize the SPI
buffer:
spi_cmd[0].tkn_name = ZCOM_CMD_START;
spi_cmd[1].tkn_name = ZCOM_OBJ_ADAPT;
if (SSINIT (spi_buffer, max_bufsize, (short *) &spi_ssid,
ZSPI_VAL_CMDHDR, (short) spi_cmd[0].tkn_name,
(short) spi_cmd[1].tkn_name, -1))
{
return FAILURE;
}
4. After the SPI command buffer is initialized with the required tokens, add the
required body tokens. Call the SPI procedure SSPUTTKN once to add one body
token. To add more tokens, call this procedure as many times as the number of
tokens you need to add.
spi_cmd[2].tkn_name = ZCOM_TKN_OBJNAME;
strcpy(spi_cmd[2].tkn_value, "$ZZWAN.#S11");
spi_cmd[2].tkn_type = SPI_STRING;
if (SSPUTTKN(spi_buffer, spi_cmd[2].tkn_name,
(char *) spi_cmd[2].tkn_value))
{
return FAILURE;
}