amaru_add_update_stamp
Call this subroutine to add alarm update information to the current IPC buffer with an external alarm timestamp.
Syntax
int amaru_add_update_stamp (bodyptr, bodylen, first_seg,
alarm_id, fr_id, user_or_serv_id,
ref_id, action, seq_num, resp_type,
key, stamp, ret_stat);
char *bodyptr;
int bodylen;
COR_BOOLEAN first_seg;
char alarm_id[LONG_NAME_LEN+1];
char fr_id[FR_ID_LEN+1];
char user_or_serv_id[COR_MAX(USER_ID_LEN, SERVICE_ID_LEN)+1];
char ref_id[AM_REF_ID_LEN+1];
AM_STATE_TYPE action;
int seq_num;
AM_RESP_TYPE resp_type;
AM_RESP_KEY key;
COR_STAMP stamp;
COR_STATUS *ret_stat;
Input Arguments
bodyptr | Pointer to the beginning of the message body of the IPC buffer. |
bodylen | Maximum length of the message body. |
first_seg | Boolean value specifying whether the current generation request should be the first request in the message. TRUE implies first segment. |
alarm_id | Identifier of the alarm to be generated. |
fr_id | Identifier of the factory resource for which the alarm is being generated. |
user_or_serv_id | Used for labeling logged alarms. Usually this is the service_id of the sending process. The AMAP sends the user_id of the connected terminal. |
ref_id | Used to specify unique alarms when multiple alarm definitions are generated for the same Factory Resources. Alarm uniqueness is defined by the combination of alarm_id , fr_id , and ref_id . |
Note: The
ref_id
is not displayed directly on the Alarm Manager User Interface. The
ref_id
, when used, can be duplicated in a message field for display.
|
|
action | Specifies the update action to take. |
seq_num | Only used by AMAP. Application programs should pass zero (0). |
resp_type | Used to select the type of response desired from the AMRP. The application program has three choices: |
AM_CAPTURED_RESP - AMRP responds once the message has been captured (sent to a slave process or journalled). | |
AM_FULL_RESP - AMRP responds once the message has been fully processed. A status segment is returned for each request in the original message. | |
AM_NO_RESP - No response from AMRP to indicate that an alarm message has been received. | |
Note: Only the
resp_type
in the first generation message of each segment is used. Therefore, it is not possible to intermix the type of responses desired within a single IPC message..
|
|
key | The key is useful when the resp_type is set to AM_FULL_RESP. The key allows the application program to match the status segments returned with the alarm generation/update requests. The key is specified by the application program and is returned "as is" by the AMRP. |
stamp | Specifies the update time for the alarm. If this update causes the alarm to be reset, this timestamp will be used to compute the alarm duration. |
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 . Other than the timestamp parameter, this function should in all ways conform to the behavior of amaru_add_update() .