Actually bother to declare a frame length
This commit is contained in:
parent
cd9fc787fb
commit
607ef27b0f
1 changed files with 4 additions and 0 deletions
|
@ -88,6 +88,7 @@ int hexagram_main_dash2can(int argc, char **argv) {
|
||||||
/* Engine speed */
|
/* Engine speed */
|
||||||
memset(&frame, '\0', sizeof(frame));
|
memset(&frame, '\0', sizeof(frame));
|
||||||
frame.can_id = 0x280;
|
frame.can_id = 0x280;
|
||||||
|
frame.can_dlc = 8;
|
||||||
frame.data[3] = (engine_rpm & 0xff00) >> 8;
|
frame.data[3] = (engine_rpm & 0xff00) >> 8;
|
||||||
frame.data[2] = engine_rpm & 0x00ff;
|
frame.data[2] = engine_rpm & 0x00ff;
|
||||||
|
|
||||||
|
@ -98,6 +99,7 @@ int hexagram_main_dash2can(int argc, char **argv) {
|
||||||
/* Engine temperature */
|
/* Engine temperature */
|
||||||
memset(frame.data, '\0', sizeof(frame.data));
|
memset(frame.data, '\0', sizeof(frame.data));
|
||||||
frame.can_id = 0x288;
|
frame.can_id = 0x288;
|
||||||
|
frame.can_dlc = 8;
|
||||||
frame.data[1] = (uint8_t)((87.0 / 0.75) + 48);
|
frame.data[1] = (uint8_t)((87.0 / 0.75) + 48);
|
||||||
|
|
||||||
if (hexagram_can_if_write(can_if, &frame) < 0) {
|
if (hexagram_can_if_write(can_if, &frame) < 0) {
|
||||||
|
@ -107,6 +109,7 @@ int hexagram_main_dash2can(int argc, char **argv) {
|
||||||
/* Fuel status */
|
/* Fuel status */
|
||||||
memset(frame.data, '\0', sizeof(frame.data));
|
memset(frame.data, '\0', sizeof(frame.data));
|
||||||
frame.can_id = 0x320;
|
frame.can_id = 0x320;
|
||||||
|
frame.can_dlc = 8;
|
||||||
frame.data[2] = 0x0e;
|
frame.data[2] = 0x0e;
|
||||||
|
|
||||||
if (hexagram_can_if_write(can_if, &frame) < 0) {
|
if (hexagram_can_if_write(can_if, &frame) < 0) {
|
||||||
|
@ -116,6 +119,7 @@ int hexagram_main_dash2can(int argc, char **argv) {
|
||||||
/* Vehicle speed */
|
/* Vehicle speed */
|
||||||
memset(frame.data, '\0', sizeof(frame.data));
|
memset(frame.data, '\0', sizeof(frame.data));
|
||||||
frame.can_id = 0x5a0;
|
frame.can_id = 0x5a0;
|
||||||
|
frame.can_dlc = 8;
|
||||||
frame.data[1] = (speed_rps & 0xff00) >> 8;
|
frame.data[1] = (speed_rps & 0xff00) >> 8;
|
||||||
frame.data[2] = speed_rps & 0x00ff;
|
frame.data[2] = speed_rps & 0x00ff;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue