Hello, I am using S32K144 with SW32K1_S32M24x_RTD_R21-11_3.0.0 and have configured CanIf to use a custom callback function.
My Configuration:
CanIfRxPduUserRxIndicationName is set to "Service_CanIf_RxIndication"
This callback is invoked from CanIf_RxIndication() when a CAN message is received.
Problem:
I noticed that in CanIf_RxIndication(), the CAN ID is available through the Mailbox->CanId parameter. However, in my Service_CanIf_RxIndication() callback, I can only receive the PduId - there is no way to retrieve the actual CAN ID. Also, I noticed that CanIf.h header states: "Stub Version - This file contains sample code only."
My Questions:
1. Can I modify or replace the CanIf.c stub code?
Since CanIf.h explicitly states it is a "Stub Version" and "sample code only", is it acceptable to modify CanIf.c to pass the CAN ID to the user callback?
2. Would modifying the stub code violate AUTOSAR architecture?
If I customize the CanIf stub implementation, does this break AUTOSAR compliance or cause any compatibility issues?
3. Are there any alternative solutions?
Is there a recommended way to pass the CAN ID to the upper layer callback without modifying the CanIf source code?
Environment:
MCU: S32K144
RTD Version: SW32K1_S32M24x_RTD_R21-11_3.0.0
IDE: S32 Design Studio 3.6
Thank you for your help!