Hope you are all well.
I would need some advise on data byte joining.
I develop CAN interface software which receiving data frames from CanGateway hardware.
Then 8 bytes data arrives regularly.
Ex. Data 1 = 10 (0x0A)
Data 2 = 20 (0x14)
Data 3 = 30 (0x1E)
Data 4 = 40 (0x28)
Data 5 = 50 (0x32)
Data 6 = 60 (0x3C)
Data 7 = 70 (0X46)
Data 8 = 80 (0x50)
Data 4, 5 must be joined and interpret as engine rpm (for example). I have the PGN and I am able to unpacking each data byte.
How can we write the code to joined such array element (data4, 5) ?
Below some program that I have,
for (i = 0; i < rcvInfos->dataLen; i++)
printf("%lu ", rcvInfos->data[i]);
printf("actual engine torque : %d engine torque\n ",rcvInfos->data, data5]...???);
I appreaciate your advise and valuable insights !