Skip to content

Commit

Permalink
Add debug statements (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerBroker2 committed Feb 18, 2025
1 parent 21e168f commit 04c7869
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/ELMduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2440,16 +2440,28 @@ uint64_t ELM327::findResponse(const uint8_t& service,
}

if (logColonIndex >= 0)
{
if (debugMode)
Serial.println(F("Log response detected"));

logBytes = recBytes - logColonIndex; // Number of logging bytes INCLUDING the colon

// Do not process logging bytes
numPayChars -= logBytes;

if (debugMode)
{
Serial.print(logBytes);
Serial.println(F(" log bytes found - ignoring these bytes during processing"));
}

// Do not process logging bytes
numPayChars -= logBytes;
}

response = 0;
for (uint8_t i = 0; i < numPayChars; i++)
{
uint8_t payloadIndex = firstDatum + i;
uint8_t bitsOffset = 4 * (numPayChars - i - 1);
uint8_t bitsOffset = 4 * (numPayChars - i - 1);

response = response | ((uint64_t)ctoi(payload[payloadIndex]) << bitsOffset);
}

Expand Down

0 comments on commit 04c7869

Please sign in to comment.