{
struct rpp_can_pdu pdu;
-
- if (rpp_can_read(%<RppRxInfo.HwObj>, &pdu) != SUCCESS) {
- // TODO: Implement some intelligent way how to detect that message receiving has failed
- // Now there is no way how to recognize failure and the case thet no message has been received.
- //rpp_sci_printf("Receiving CAN message failed (%s).\n", RppRxInfo.Name);
- } else {
+ int ret;
+
+ ret = rpp_can_read(%<RppRxInfo.HwObj>, &pdu);
+ switch (ret) {
+ case -RPP_EINVAL:
+ rpp_sci_printf("Receiving CAN message failed (%s).\n", "%<RppRxInfo.Name>");
+ break;
+ case -RPP_ENODATA:
+ break;
+ case SUCCESS: {
%if %<data_type_par>==4
// CAN_MESSAGE
%<message>.Length = pdu.dlc;
%% call the downstream system
%<LibBlockExecuteFcnCall(block, callIdx)>\
%endforeach
+ break;
+ }
}
}
%endif