diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2016-12-19 17:28:11 +1100 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2016-12-19 17:28:11 +1100 |
commit | c314930936138aee4b7ce114196882347d0aceda (patch) | |
tree | 14def0207b3a59b33943aad6235658e78628ed7e /libraries/OBD2UART/OBD2UART.h | |
parent | c83f19feb55fb3c405431bd12af4132d402cf436 (diff) | |
download | 2021-arduino-obd-c314930936138aee4b7ce114196882347d0aceda.tar.gz 2021-arduino-obd-c314930936138aee4b7ce114196882347d0aceda.tar.bz2 2021-arduino-obd-c314930936138aee4b7ce114196882347d0aceda.zip |
Added readDTC() for reading OBD-II Trouble Codes into an array
Diffstat (limited to 'libraries/OBD2UART/OBD2UART.h')
-rw-r--r-- | libraries/OBD2UART/OBD2UART.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libraries/OBD2UART/OBD2UART.h b/libraries/OBD2UART/OBD2UART.h index eaab88d..a6c186e 100644 --- a/libraries/OBD2UART/OBD2UART.h +++ b/libraries/OBD2UART/OBD2UART.h @@ -117,15 +117,17 @@ public: virtual void sleep(); // set working protocol (default auto) virtual bool setProtocol(OBD_PROTOCOLS h = PROTO_AUTO); - // send AT command and receive response + // send AT command and receive response (return bytes received) virtual byte sendCommand(const char* cmd, char* buf, byte bufsize, int timeout = OBD_TIMEOUT_LONG); + // read diagnostic trouble codes (return number of DTCs read) + virtual byte readDTC(uint16_t codes[], byte count = 1); // clear diagnostic trouble code virtual void clearDTC(); // get battery voltage (works without ECU) virtual float getVoltage(); // get VIN as a string, buffer length should be >= OBD_RECV_BUF_SIZE virtual bool getVIN(char* buffer, byte bufsize); - // get device temperature + // get device temperature (in celsius degree) virtual float getTemperature(); // get accelerometer data virtual bool readAccel(int& x, int& y, int& z); |