summaryrefslogtreecommitdiff
path: root/libraries/OBD2UART/OBD2UART.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/OBD2UART/OBD2UART.cpp')
-rw-r--r--libraries/OBD2UART/OBD2UART.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/libraries/OBD2UART/OBD2UART.cpp b/libraries/OBD2UART/OBD2UART.cpp
index 5f1dbd7..f5a1b58 100644
--- a/libraries/OBD2UART/OBD2UART.cpp
+++ b/libraries/OBD2UART/OBD2UART.cpp
@@ -319,8 +319,6 @@ bool COBD::getVIN(char* buffer, byte bufsize)
bool COBD::isValidPID(byte pid)
{
- if (pid >= 0x7f)
- return true;
pid--;
byte i = pid >> 3;
byte b = 0x80 >> (pid & 0x7);
@@ -442,10 +440,9 @@ bool COBD::init(OBD_PROTOCOLS protocol)
stage = 3;
// load pid map
memset(pidmap, 0xff, sizeof(pidmap));
- for (byte i = 0; i < 4; i++) {
+ for (byte i = 0; i < 8; i++) {
byte pid = i * 0x20;
sprintf(buffer, "%02X%02X\r", dataMode, pid);
- delay(10);
write(buffer);
delay(10);
if (!receive(buffer, sizeof(buffer), OBD_TIMEOUT_LONG) || checkErrorMessage(buffer)) break;