EMS Manual

Example of Retrieving Event Messages
EMS Manual426909-005
A-29
C Source File
send_spi_cmd();
}
#pragma PAGE "spi_cmd_load_filter()"
/* ---------- spi_cmd_load_filter ------------------
* Builds an SPI command that loads a filter into the
* distributor and passes one filter parameter.
*/
void spi_cmd_load_filter(void)
{
/* Initialize the spi_buf for distributor CONTROL
command */
spi_err = SSINIT( (int *)spi_buf, ZEMS_VAL_BUFLEN,
(int *)&zems_val_ssid,
ZSPI_VAL_CMDHDR, ZEMS_CMD_CONTROL );
if (spi_err != ZSPI_ERR_OK)
DEBUG();
/* place the load filter token in the buffer */
spi_err = SSPUTTKN( (int *)spi_buf, ZEMS_TKN_FILTERFILE,
filt_name );
if (spi_err != ZSPI_ERR_OK)
DEBUG();
/* place the filter parameter token in the buffer */
spi_err = SSPUTTKN( (int *)spi_buf, MYAP_TKN_PARAM_CPU,
(char *)&cpu_num, , (int *)&myssid);
if (spi_err != ZSPI_ERR_OK)
DEBUG();
/* Send the command to the distributor */
send_spi_cmd();
}
#pragma PAGE "displ_event()"
/* ---------- displ_event ---------------------------
* This function displays an event message on the home
* terminal. Pass: The event buffer pointer to convert to
* a message.
*/
void displ_event(EMSBUFDEF *event_buf)
{
unsigned long etxt_stat;
# define high(x) (x > 16)
# define low(x) (x & 0xFFFF)
char text[EVT_TEXT_LEN+1]; /* needed for printf()
call */
int i;
/* Generate display text from the event message */
etxt_stat = EMSTEXT( (int *)event_buf,
evt_text_buf,
EVT_TEXT_LEN, /* displayable
line len */
NUM_EVT_LINES, /* no. of display