The ExtDec_api_get_msg function is responsible for retrieving information from all asynchronous messages coming from an RCO. It is used if the application process is acting as an External Decision-making process; that is, this API function should be invoked by those applications that are expected to supply decisions to an RCO.
This function must be invoked when the event flag reserved for the ExtDec_api_init routine is set High. When this event is set High, the application program calls this function to unload the data contained in the message received from RCO process. This routine should be called repeatedly until it returns a status indicating that there are no more messages to retrieve.
The msg_type argument indicates which type of message has been received. The application determines which type of message was received and responds accordingly. If msg_type field indicates that a decision request was received, the application program should return a decision buffer to RCO using the RCOExt_Send_decision routine. If the msg_type indicates that the message is an exception indicator, the application should take the appropriate action. No response is needed to return to RCO. The exception condition is stored in the exception_flag field in the ctrl_loc_msg argument.
Syntax:
COR_14 ExtDec__api_get_msg(DADDR*addr,Cor_14*msg_type,PDC_DEC_REQUEST* dec_req, PDC_CTRL_LOC*ctrl_loc_msg, COR_STATUS*restat)
Input |
|
None |
|
Output |
|
Addr |
Address of RCO process that sent the message. |
msg_type |
Pointer to type of message received (Either PDC_DEC_REQ_MSG or PDC_CTRL_LOC_MSG). |
dec_req |
Pointer to PDC_DEC_CTRL_REQUEST structure. |
ctrl_loc_meg |
Pointer to PDC_CTRL_LOC_MSG structure. |
Restat |
Pointer to status structure. |
Return Value:
Either COR_SUCCESS, COR_WARNING or COR_FAILURE. If the function returns COR_WARNING or COR_FAILURE, additional error information can be found in restat.err_msg and restat.err_code. If COR_FAILURE is returned, the error was severe enough that the application should perform an orderly termination. COR_WARNING will be returned when there are no more messages that need to be retrieved by the application program. PDCI_LAST_MESSAGE will be reported in restat.err_code.
RCO external decision API functions. |