Skip to content

Commit 04c7869

Browse files
committed
Add debug statements (#275)
1 parent 21e168f commit 04c7869

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

src/ELMduino.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,16 +2440,28 @@ uint64_t ELM327::findResponse(const uint8_t& service,
24402440
}
24412441

24422442
if (logColonIndex >= 0)
2443+
{
2444+
if (debugMode)
2445+
Serial.println(F("Log response detected"));
2446+
24432447
logBytes = recBytes - logColonIndex; // Number of logging bytes INCLUDING the colon
2444-
2445-
// Do not process logging bytes
2446-
numPayChars -= logBytes;
2448+
2449+
if (debugMode)
2450+
{
2451+
Serial.print(logBytes);
2452+
Serial.println(F(" log bytes found - ignoring these bytes during processing"));
2453+
}
2454+
2455+
// Do not process logging bytes
2456+
numPayChars -= logBytes;
2457+
}
24472458

24482459
response = 0;
24492460
for (uint8_t i = 0; i < numPayChars; i++)
24502461
{
24512462
uint8_t payloadIndex = firstDatum + i;
2452-
uint8_t bitsOffset = 4 * (numPayChars - i - 1);
2463+
uint8_t bitsOffset = 4 * (numPayChars - i - 1);
2464+
24532465
response = response | ((uint64_t)ctoi(payload[payloadIndex]) << bitsOffset);
24542466
}
24552467

0 commit comments

Comments
 (0)