summaryrefslogtreecommitdiff
path: root/libraries/OBD/OBD.h
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2015-04-27 22:52:52 +1000
committerStanley Huang <stanleyhuangyc@gmail.com>2015-04-27 22:52:52 +1000
commit38f00a77bd293fc98771c86b251f45accadbc582 (patch)
treeaecc1a8ac68e4d26619c125af3a91e557246b7e1 /libraries/OBD/OBD.h
parent431cc8f156fe852ffd6fbfcc200a11b44d25bee7 (diff)
download2021-arduino-obd-38f00a77bd293fc98771c86b251f45accadbc582.tar.gz
2021-arduino-obd-38f00a77bd293fc98771c86b251f45accadbc582.tar.bz2
2021-arduino-obd-38f00a77bd293fc98771c86b251f45accadbc582.zip
Minor cleanup
Diffstat (limited to 'libraries/OBD/OBD.h')
-rw-r--r--libraries/OBD/OBD.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/libraries/OBD/OBD.h b/libraries/OBD/OBD.h
index e53d243..acf64e9 100644
--- a/libraries/OBD/OBD.h
+++ b/libraries/OBD/OBD.h
@@ -140,16 +140,16 @@ public:
protected:
virtual char* getResponse(byte& pid, char* buffer);
virtual byte receive(char* buffer = 0, int timeout = OBD_TIMEOUT_SHORT);
+ virtual bool available();
+ virtual char read();
+ virtual void write(const char* s);
+ virtual void write(char c);
virtual void dataIdleLoop() {}
void recover();
void debugOutput(const char* s);
int normalizeData(byte pid, char* data);
OBD_STATES m_state;
private:
- virtual bool available();
- virtual char read();
- virtual void write(const char* s);
- virtual void write(char c);
virtual uint8_t getPercentageValue(char* data)
{
return (uint16_t)hex2uint8(data) * 100 / 255;
@@ -208,7 +208,6 @@ class COBDI2C : public COBD {
public:
void begin();
void end();
- bool init(OBD_PROTOCOLS protocol = PROTO_AUTO);
bool read(byte pid, int& result);
void write(const char* s);
// Asynchronized access API
@@ -216,12 +215,9 @@ public:
void applyPIDs();
void loadData();
uint16_t getData(byte pid, int& result);
- // GPS API
- bool gpsQuery(GPS_DATA* gpsdata);
- void gpsSetup(uint32_t baudrate, const char* cmds = 0);
protected:
bool sendCommand(byte cmd, uint8_t data = 0, byte* payload = 0, byte payloadBytes = 0);
- byte receive(char* buffer, int timeout = OBD_TIMEOUT_SHORT);
+ byte receive(char* buffer, int timeout = OBD_TIMEOUT_LONG);
byte m_addr;
PID_INFO obdInfo[MAX_PIDS];
byte obdPid[MAX_PIDS];