summaryrefslogtreecommitdiff
path: root/libraries/OBD/OBD.cpp
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2013-07-28 11:23:38 +0800
committerStanley Huang <stanleyhuangyc@gmail.com>2013-07-28 11:23:38 +0800
commit81cf413d99aec5eeffa88e32f1f8fd34c724723f (patch)
treec92c84b3575d0ebaeb7a45f8758d3d8567383395 /libraries/OBD/OBD.cpp
parent1e56a244b3e0bdb434ac507a49b359767886be81 (diff)
download2021-arduino-obd-81cf413d99aec5eeffa88e32f1f8fd34c724723f.tar.gz
2021-arduino-obd-81cf413d99aec5eeffa88e32f1f8fd34c724723f.tar.bz2
2021-arduino-obd-81cf413d99aec5eeffa88e32f1f8fd34c724723f.zip
minor updates for OBD library
Diffstat (limited to 'libraries/OBD/OBD.cpp')
-rw-r--r--libraries/OBD/OBD.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libraries/OBD/OBD.cpp b/libraries/OBD/OBD.cpp
index 38fbf01..15aacd7 100644
--- a/libraries/OBD/OBD.cpp
+++ b/libraries/OBD/OBD.cpp
@@ -11,7 +11,7 @@
#define MAX_CMD_LEN 6
-const char PROGMEM s_initcmd[][MAX_CMD_LEN] = {"ATZ\r","ATE0\r","ATL1\r","ATI\r"};
+const char PROGMEM s_initcmd[][MAX_CMD_LEN] = {"\rATZ\r","ATE0\r","ATL1\r","ATI\r"};
const char PROGMEM s_searching[] = "SEARCHING";
const char PROGMEM s_cmd_fmt[] = "%02X%02X 1\r";
const char PROGMEM s_cmd_sleep[] = "atlp\r";
@@ -77,6 +77,7 @@ bool COBD::readSensor(byte pid, int& result, bool passive)
dataIdleLoop();
} while (!(hasData = available()) && millis() - tick < OBD_TIMEOUT_SHORT);
if (!hasData) {
+ write('\r');
errors++;
return false;
}