函数介绍
下面是这个回调函数canoe的帮助文档。
E2E
E2E一般包括rollingcounter和checksum两个信号,一般checksum会用到一些算法像crc8什么的,简单的就是几个数据的和。rollingcounter这个信号是简单的计数,有的是从0到3,占两位;从0到15的占4位,当然4位的不一定从0到15,也可以只到14.本篇文章的rollingcounter需要根据DBC里的layout进行位运算。
代码示例
dword applILTxPending (long aId, dword aDlc, byte data[])
{
dword i;
byte xor;
if(aId == 0x17D)
{
// get the old value
i = data[6] & 0x0F;//通过位运算计算获取counter,需要根据dbc中的layout cntr信号的位置调整
// increment
i++;
i = i % 16;
//set the new message counter
data[6] = ((data[6]