Skip to content

Commit 84e20b3

Browse files
committed
Correct TF003 bug. Add bad header debug
1 parent e9eecd3 commit 84e20b3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Parse_SPARTN.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ bool sempSpartnReadTF002TF006(SEMP_PARSE_STATE *parse, uint8_t data)
194194
if (scratchPad->spartn.frameCount == 0)
195195
{
196196
scratchPad->spartn.messageType = data >> 1;
197-
scratchPad->spartn.payloadLength = data & 0x0;
197+
scratchPad->spartn.payloadLength = data & 0x01;
198198
}
199199
if (scratchPad->spartn.frameCount == 1)
200200
{
@@ -234,6 +234,13 @@ bool sempSpartnReadTF002TF006(SEMP_PARSE_STATE *parse, uint8_t data)
234234
// Invalid header CRC
235235
parse->buffer[3] = data; // Restore the byte now we know the data is invalid
236236
parse->state = sempFirstByte;
237+
238+
sempPrintf(parse->printDebug,
239+
"SEMP: %s SPARTN %d, 0x%04x (%d) bytes, bad header CRC",
240+
parse->parserName,
241+
scratchPad->spartn.messageType,
242+
parse->length, parse->length);
243+
237244
return false;
238245
}
239246
}

0 commit comments

Comments
 (0)