From 3655eb4501a8c191a01fa03c74a8f562d664a23e Mon Sep 17 00:00:00 2001
From: Stanley Huang <stanleyhuangyc@live.com>
Date: Sun, 26 Jun 2016 21:01:19 +0800
Subject: Added new APIs

---
 libraries/OBD2UART/OBD2UART.h | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

(limited to 'libraries/OBD2UART/OBD2UART.h')

diff --git a/libraries/OBD2UART/OBD2UART.h b/libraries/OBD2UART/OBD2UART.h
index 618b8c6..eaab88d 100644
--- a/libraries/OBD2UART/OBD2UART.h
+++ b/libraries/OBD2UART/OBD2UART.h
@@ -95,10 +95,10 @@ typedef enum {
 uint16_t hex2uint16(const char *p);
 uint8_t hex2uint8(const char *p);
 
-class COBD2UART
+class COBD
 {
 public:
-	COBD2UART():dataMode(1),errors(0),m_state(OBD_DISCONNECTED) {}
+	COBD():dataMode(1),errors(0),m_state(OBD_DISCONNECTED) {}
 	// begin serial UART
 	virtual void begin();
 	// initialize OBD-II connection
@@ -121,10 +121,16 @@ public:
 	virtual byte sendCommand(const char* cmd, char* buf, byte bufsize, int timeout = OBD_TIMEOUT_LONG);
 	// clear diagnostic trouble code
 	virtual void clearDTC();
-	// get battery voltage (in 0.1V, e.g. 125 for 12.5V, works without ECU)
+	// 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
+	virtual float getTemperature();
+	// get accelerometer data
+	virtual bool readAccel(int& x, int& y, int& z);
+	// get gyroscope data
+	virtual bool readGyro(int& x, int& y, int& z);
 	// send query for specified PID
 	virtual void sendQuery(byte pid);
 	// retrive and parse the response of specifie PID
@@ -167,5 +173,6 @@ private:
 	{
 		return (int)hex2uint8(data) - 40;
 	}
+	char* getResultValue(char* buf);
 };
 
-- 
cgit v1.2.3