diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-11-10 21:03:19 +1100 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-11-10 21:03:19 +1100 |
commit | e239aebb7bc0fe7be85baaaa9b5e1b342a2a5979 (patch) | |
tree | 0f7c92eba6e7696b390c1cf53ef44b7e70c44e34 /libraries/OBD/OBD.h | |
parent | 7d247ca5c378dd1097e34abaf08c711d3c1bc9f0 (diff) | |
download | 2021-arduino-obd-e239aebb7bc0fe7be85baaaa9b5e1b342a2a5979.tar.gz 2021-arduino-obd-e239aebb7bc0fe7be85baaaa9b5e1b342a2a5979.tar.bz2 2021-arduino-obd-e239aebb7bc0fe7be85baaaa9b5e1b342a2a5979.zip |
Update OBD library
Diffstat (limited to 'libraries/OBD/OBD.h')
-rw-r--r-- | libraries/OBD/OBD.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libraries/OBD/OBD.h b/libraries/OBD/OBD.h index 0a15e97..02d735d 100644 --- a/libraries/OBD/OBD.h +++ b/libraries/OBD/OBD.h @@ -104,13 +104,15 @@ public: Serial baudrate is only adjustable for Arduino OBD-II Adapters V2
Check out http://freematics.com/pages/products/arduino-obd-adapter
*/
- virtual void begin(unsigned long baudrate = 0);
+ virtual void begin();
// initialize OBD-II connection
virtual bool init(byte protocol = 0);
// un-initialize OBD-II connection
- virtual void uninit();
+ virtual void end();
+ // set serial baud rate
+ virtual void setBaudRate(long baudrate);
// get connection state
- OBD_STATES getState() { return m_state; }
+ virtual OBD_STATES getState() { return m_state; }
// read specified OBD-II PID value
virtual bool read(byte pid, int& result);
// set device into
@@ -128,15 +130,13 @@ public: // retrive and parse the response of specifie PID
virtual bool getResult(byte& pid, int& result);
// determine if the PID is supported
- bool isValidPID(byte pid);
+ virtual bool isValidPID(byte pid);
// set current PID mode
byte dataMode;
// occurrence of errors
byte errors;
// bit map of supported PIDs
byte pidmap[4 * 4];
- // current VIN
- byte vin[17];
protected:
virtual char* getResponse(byte& pid, char* buffer);
virtual byte receive(char* buffer = 0, int timeout = OBD_TIMEOUT_SHORT);
@@ -206,7 +206,8 @@ typedef struct { class COBDI2C : public COBD {
public:
- void begin(byte addr = I2C_ADDR);
+ void begin();
+ void end();
bool init(byte protocol = 0);
bool read(byte pid, int& result);
void write(const char* s);
|