Example: Send When Buffer Filled
This example shows coding necessary to add alarm generation/update requests to the IPC message buffer until the buffer is full. When the buffer is full, a message is sent.
... get parameters ... (load msg_fields)
while (not_finished)
{
/* first call */
amaru_add_gen (msg_wbody, MAX_MSG_SIZE, TRUE, ... );
/* repeat */
repeat
{
... get parameters ...
}
until ( amaru_add_gen (msg_wbody, , FALSE, ...) !=
COR_SUCCESS);
if (ret_stat.err_code == MF_INSUF_SPACE)
{
/* send message */
amaru_send_msg (port_id, ... );
/* unload returned message */
...
}
} /* end while */