EMS Manual
Procedure Calls for Standard Events
EMS Manual—426909-005
11-50
Program Example
{
/* Build the event buffer by calling EMS_OBJ_UNAVAIL_EVT_BLD_ */
if ( status = EMS_OBJ_UNAVAIL_EVT_BLD_ (
event_buf
,ZEMS_VAL_EVT_BUFLEN
,(short *)&myap_ssid /*subsystem identifier ssid */
,myap_evt_obj_unavail /* event number */
,current_state
,previous_state
,ZEMS_VAL_OPERATOR_INITIATED /* change reason */
,ZCOM_TKN_SUBJ_LINE /* subject token id */
,subject_value /* value of the subject to be added */
,SUBJECT_LEN
, /* subject ssid */
, /* underlying-object-name */
, /* underlying-object-name-length*/
,symptom /* symptom string */
,SYMPTOM_LEN /* symptom string length */
,&buf_len /* return actual buffer lenth */
,ZSPI_VAL_FALSE )) /* critical_indicator */
handle_error_unavail_event(status); /* call handle error function */
/* Add additional tokens if needed */
if ( status = EMSADDTOKENS ( event_buf
, /* ssid */
,MYAP_TKN_PARAM_CPU /* token code */
,token_value /* value of the token
*/
,TOKEN_LENGTH ))
handle_error_add_token(status);
/* Get the size of the event buffer */
if ( status = SSGETTKN ( event_buf
,ZSPI_TKN_USEDLEN /* retrieve used buff length */
,(char *)&buf_len))
handle_error_get_token(status);
/* Send the event to the collector */
if (!WRITEREAD (coll_num /* return value from OPEN */
,event_buf /* event-message buffer */
,buf_len /* the return value from SSGETTKN above */
,0 )) /* read count */
handle_error_write_read();
} /* close else statement */
return 0;
} /* close main */