Skip to content

Commit

Permalink
Prevent processing of non-alphanumeric values (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerBroker2 authored Apr 7, 2021
1 parent 4eddfb7 commit 2d72f61
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/ELMduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2386,7 +2386,7 @@ int8_t ELM327::sendCommand(const char *cmd)

if (debugMode)
{
Serial.print(F("Received char: "));
Serial.print(F("\tReceived char: "));

if (recChar == '\f')
Serial.println(F("\\f"));
Expand All @@ -2409,7 +2409,7 @@ int8_t ELM327::sendCommand(const char *cmd)

break;
}
else if (isSpace(recChar))
else if (isSpace(recChar) || isalnum(recChar))
continue;

payload[counter] = recChar;
Expand Down Expand Up @@ -2582,22 +2582,22 @@ uint64_t ELM327::findResponse()

if (debugMode)
{
Serial.print(F("64-bit response: "));
Serial.print(F("responseByte_0: "));
Serial.println(F("64-bit response: "));
Serial.print(F("\tresponseByte_0: "));
Serial.println(responseByte_0);
Serial.print(F("responseByte_1: "));
Serial.print(F("\tresponseByte_1: "));
Serial.println(responseByte_1);
Serial.print(F("responseByte_2: "));
Serial.print(F("\tresponseByte_2: "));
Serial.println(responseByte_2);
Serial.print(F("responseByte_3: "));
Serial.print(F("\tresponseByte_3: "));
Serial.println(responseByte_3);
Serial.print(F("responseByte_4: "));
Serial.print(F("\tresponseByte_4: "));
Serial.println(responseByte_4);
Serial.print(F("responseByte_5: "));
Serial.print(F("\tresponseByte_5: "));
Serial.println(responseByte_5);
Serial.print(F("responseByte_6: "));
Serial.print(F("\tresponseByte_6: "));
Serial.println(responseByte_6);
Serial.print(F("responseByte_7: "));
Serial.print(F("\tresponseByte_7: "));
Serial.println(responseByte_7);
}

Expand Down

0 comments on commit 2d72f61

Please sign in to comment.