summaryrefslogtreecommitdiff
path: root/obdlogger
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2013-05-11 11:53:09 +0800
committerStanley Huang <stanleyhuangyc@gmail.com>2013-05-11 11:53:09 +0800
commit65a30f4d5e52c5de00428dad549add2410e72f84 (patch)
tree031b27f6e7f1fae6dadda69fe1192a68dc0e2bb0 /obdlogger
parentbf4f5ca574f5d4f5c561895af0e5ab40f3cc8063 (diff)
download2021-arduino-obd-65a30f4d5e52c5de00428dad549add2410e72f84.tar.gz
2021-arduino-obd-65a30f4d5e52c5de00428dad549add2410e72f84.tar.bz2
2021-arduino-obd-65a30f4d5e52c5de00428dad549add2410e72f84.zip
reformatting library source code
Diffstat (limited to 'obdlogger')
-rw-r--r--obdlogger/OBD.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/obdlogger/OBD.cpp b/obdlogger/OBD.cpp
index 609e5dd..55f31e6 100644
--- a/obdlogger/OBD.cpp
+++ b/obdlogger/OBD.cpp
@@ -69,20 +69,20 @@ void COBD::Query(unsigned char pid)
bool COBD::ReadSensor(byte pid, int& result, bool passive)
{
- // send a query command
- Query(pid);
- // wait for reponse
- bool hasData;
- unsigned long tick = millis();
- do {
- DataIdleLoop();
- } while (!(hasData = available()) && millis() - tick < OBD_TIMEOUT_SHORT);
- if (!hasData) {
- errors++;
- return false;
- }
- // receive and parse the response
- return GetResponseParsed(pid, result);
+ // send a query command
+ Query(pid);
+ // wait for reponse
+ bool hasData;
+ unsigned long tick = millis();
+ do {
+ DataIdleLoop();
+ } while (!(hasData = available()) && millis() - tick < OBD_TIMEOUT_SHORT);
+ if (!hasData) {
+ errors++;
+ return false;
+ }
+ // receive and parse the response
+ return GetResponseParsed(pid, result);
}
bool COBD::available()