CanLPduReceiveCalloutFunction
1. 找到“CanLPduReceiveCalloutFunction”模块
依次找到“Can”–“General”–“CanLPduReceiveCalloutFunction”
2. Callout函数的编写
形如:(过滤CanId == 0x123,不上传至COM层)
boolean ComCdd_CanIfRxIndicationHook(uint8 Hrh, uint32 CanId, uint8 CanDataLegth, uint8* CanSduPtr)
{
if (CanId == 0x123) // CanId
{
ComCdd_CRS_DataCallback(CanId, CanSduPtr, CanDataLegth);
return false; // stop further processing in CanIfRxIndication
}
else
{
return true; // further processing in CanIfRxIndication
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
3. Callout函数的返回值
当函数返回false时,
此LPDU不进行后续上传,不调用CanIf_RxIndication函数
(以上代码提前交给自定义函数ComCdd_CRS_DataCallback处理);
当函数返回true时,
此LPDU上传至COM层;
评论记录:
回复评论: