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
}
}
3. Callout函数的返回值
当函数返回false时,
此LPDU不进行后续上传,不调用CanIf_RxIndication函数
(以上代码提前交给自定义函数ComCdd_CRS_DataCallback处理);
当函数返回true时,
此LPDU上传至COM层;
3. 完成
扫描二维码关注公众号,回复:
16492518 查看本文章