Skip to content

Commit bc0f612

Browse files
committed
add misfire channels
1 parent 3645b9b commit bc0f612

File tree

2 files changed

+65
-10
lines changed

2 files changed

+65
-10
lines changed

LiveDataReading.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,28 @@ public static List<LiveDataReading> ParseCanResponse(byte[] data)
163163
{
164164
switch (data[idx + 1])
165165
{
166+
case 0x34: // misfire cylinder 1
167+
case 0x35: // misfire cylinder 3
168+
case 0x36: // misfire cylinder 4
169+
case 0x37: // misfire cylinder 2
170+
case 0x57: // misfire cylinder 5
171+
case 0x58: // misfire cylinder 6
172+
if (data.Length > idx + 3)
173+
{
174+
int misfire = (data[idx + 2] << 8) | data[idx + 3];
175+
LiveDataReading reading = new()
176+
{
177+
name = $"Misfire {data[idx + 1]:X2}",
178+
value_f = misfire,
179+
break;
180+
166181
case 0x18: // octane rating 1
167182
case 0x19: // octane rating 2
168183
case 0x1A: // octane rating 3
169184
case 0x1B: // octane rating 4
170185
case 0x4D: // octane rating 5
171186
case 0x4E: // octane rating 6
172-
if (data.Length > idx + 2)
187+
if (data.Length > idx + 3)
173188
{
174189
int octaneRating = ((data[idx + 2] << 8) | data[idx+3]);
175190
LiveDataReading reading = new()

config/lotus-default.json

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"name": "Essential Engine Data2",
1515
"pids": [ 5, 14, 11 ],
1616
"description": "coolant temp, timing, MAP"
17-
},
17+
},
1818
{
1919
"type": "Mode22",
2020
"name": "Accelerator Pedal Position",
@@ -23,14 +23,6 @@
2323
"category": "Engine Management",
2424
"unit": "%"
2525
},
26-
{
27-
"type": "Mode22",
28-
"name": "Manifold Temperature",
29-
"pidHigh": 2,
30-
"pidLow": 114,
31-
"category": "Environmental",
32-
"unit": "degC"
33-
},
3426
{
3527
"type": "Mode22",
3628
"name": "Octane Scaler Cylinder 1",
@@ -78,6 +70,54 @@
7870
"pidLow": 78,
7971
"category": "Performance",
8072
"unit": "%"
73+
},
74+
{
75+
"type": "Mode22",
76+
"name": "Misfire Cylinder 1",
77+
"pidHigh": 2,
78+
"pidLow": 52,
79+
"category": "Diagnostics",
80+
"unit": "count"
81+
},
82+
{
83+
"type": "Mode22",
84+
"name": "Misfire Cylinder 3",
85+
"pidHigh": 2,
86+
"pidLow": 53,
87+
"category": "Diagnostics",
88+
"unit": "count"
89+
},
90+
{
91+
"type": "Mode22",
92+
"name": "Misfire Cylinder 4",
93+
"pidHigh": 2,
94+
"pidLow": 54,
95+
"category": "Diagnostics",
96+
"unit": "count"
97+
},
98+
{
99+
"type": "Mode22",
100+
"name": "Misfire Cylinder 2",
101+
"pidHigh": 2,
102+
"pidLow": 55,
103+
"category": "Diagnostics",
104+
"unit": "count"
105+
},
106+
{
107+
"type": "Mode22",
108+
"name": "Misfire Cylinder 5",
109+
"pidHigh": 2,
110+
"pidLow": 87,
111+
"category": "Diagnostics",
112+
"unit": "count"
113+
},
114+
{
115+
"type": "Mode22",
116+
"name": "Misfire Cylinder 6",
117+
"pidHigh": 2,
118+
"pidLow": 88,
119+
"category": "Diagnostics",
120+
"unit": "count"
81121
}
82122
]
83123
}

0 commit comments

Comments
 (0)