OnMostFiAmsPreReceive
Valid for: CANoe DEFunction Syntax
Description
When fault injection is active, this function is called before the simulation node (CAPL program or node layer module) receives the AMS message. This allows incoming messages to be manipulated in order to emulate faulty application behavior. The message can be suppressed (return value 0), forwarded (return value 1), or forwarded as an altered message (use of mostFiAmsReceive). Note- All CAPL functions are available within the callback. When output(mostAmsMessage) and mostFiAmsReceive are used, attention must be paid that recursions are not programmed. This can be ensured through appropriate message filtering (see example below).
- The callback is only called for the AMS messages for which the simulation node has implemented a mostAmsMessage handler (i.e., for the messages whose receipt the node is intended for).
Parameters
- msg: This variable contains the AMS message of the simulation node to be received. The number of transmitted data can be up to 65535 bytes for a mostAmsMessage. For reasons of efficiency, only the first 200 bytes are copied to the
msgvariable. To facilitate access to all the message’s user data, the message can be assigned to an AMS message declared with a sufficient size (see example below).
Return Values
The return value can be used to control whether or not the message is to be received by the simulation node.- 0: Original message is not received.
- 1: Original message is received without alteration