AUTOSAR CanTp模块的代码记录-2

CanTp接收报文传输过程 一、void CanTp_RxIndication(PduIdType RxPduId, const PduInfoType *P

CanTp接收报文传输过程

一、void CanTp_RxIndication(PduIdType RxPduId, const PduInfoType *PduInfoPtr)
Indication of a received I-PDU from a lower layer communication interface module. I.e. CanIf Module
calls this Api for [SF][FF][CF][FC] type frames.
在这里插入图片描述
1、新建临时变量CanTp_RxContextType Context 存储当前的帧信息
在这里插入图片描述
2、CanTp_Prv_GetRxContext获取当前的报文中的帧信息
Context->FrameType 帧类型
Context->SduId 接收到的Pdu对应的SduId
通过SduId获取当前通道的属性
Context->ChannelId
Context->PduRPduHandleId
Context->AddressSize
Context->IsPaddingOn
Context->IsFdEnabled
Context->IsFunctional
3、CanTp_Prv_RxSduLengthCheck获取当前的CanTp传输的数据的长度以及校验正确性,并得到正确的数据长度。
4、CanTp_Prv_ProcessFrame 处理接收到的数据帧