summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2014-06-09 22:18:39 +1000
committerStanley Huang <stanleyhuangyc@gmail.com>2014-06-09 22:18:39 +1000
commitfe9fcb70744e7d4669a911bee3ccce30eb91707e (patch)
treee06148d308cb6120769bc3123a7b6b3b3da4e5f2
parent72287714279b08a168b7bbe67c6783857475d73c (diff)
download2021-arduino-obd-fe9fcb70744e7d4669a911bee3ccce30eb91707e.tar.gz
2021-arduino-obd-fe9fcb70744e7d4669a911bee3ccce30eb91707e.tar.bz2
2021-arduino-obd-fe9fcb70744e7d4669a911bee3ccce30eb91707e.zip
Add uninit()
-rw-r--r--libraries/OBD/OBD.cpp5
-rw-r--r--libraries/OBD/OBD.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/libraries/OBD/OBD.cpp b/libraries/OBD/OBD.cpp
index 5b57df9..2c9a2c7 100644
--- a/libraries/OBD/OBD.cpp
+++ b/libraries/OBD/OBD.cpp
@@ -313,6 +313,11 @@ bool COBD::init(byte protocol)
return true;
}
+void COBD::uninit()
+{
+ m_state = OBD_DISCONNECTED;
+}
+
#ifdef DEBUG
void COBD::debugOutput(const char *s)
{
diff --git a/libraries/OBD/OBD.h b/libraries/OBD/OBD.h
index 3086b4f..1d8d7f9 100644
--- a/libraries/OBD/OBD.h
+++ b/libraries/OBD/OBD.h
@@ -67,6 +67,7 @@ public:
*/
virtual void begin(unsigned long baudrate = 0);
virtual bool init(byte protocol = 0);
+ virtual void uninit();
virtual bool read(byte pid, int& result);
virtual void sleep();
virtual void wakeup();