From c314930936138aee4b7ce114196882347d0aceda Mon Sep 17 00:00:00 2001 From: Stanley Huang Date: Mon, 19 Dec 2016 17:28:11 +1100 Subject: Added readDTC() for reading OBD-II Trouble Codes into an array --- libraries/OBD2UART/OBD2UART.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libraries/OBD2UART/OBD2UART.h') 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); -- cgit v1.2.3