amaru_send_msg
Call this subroutine to send the IPC-datagram message containing alarm generation/updated requests filled in by the amaru_add_gen or the amaru _add_update routine.
amaru_send_msg returns the status of the operation in the status message. Therefore, to determine if an amaru_add_gen or amaru_add_update call is successful, the status message must be checked.
Syntax
int amaru_send_msg (port_id, wrt_buf, read_buf,
read_buf_len, alarm_mgr_id, ret_stat);
int port_id;
char *wrt_buf;
char *read_buf;
int read_buf_len;
char *alarm_mgr_id;
COR_STATUS *ret_stat;
Input Arguments
port_id | Datagram Port over which message should be sent. |
wrt_buf | Pointer to message buffer to be written. |
read_buf | Pointer to message buffer where returned status should be sent. |
read_buf_len | Maximum length of read buffer. |
alarm_mgr_id | ID of the AMRP to receive the message. The application can determine the alarm_mgr_id from the configuration record of the factory resource the alarm is associated with (in fr.dat ). Each factory resource has an associated AMRP. |
Output Arguments
ret_stat | Pointer to status structure. |
Return Value
Either COR_SUCCESS, or COR_FAILURE. If the function returns anything other than COR_SUCCESS, additional error information can be found in ret_stat.err_msg and ret_stat.err_code .
All error codes returned by internally used procedures are passed unchanged to the calling program. If the AMRP with the specified alarm _mgr_id cannot be found, a status of COR_FAILURE is set and the amaru_UNKNOWN_ALARM_MGR error code is returned. This error status is defined in amaru_err.h which is shown in Chapter 8.