From 0282f200a3e0236f5baca9d3fd9db2fb2b66c5e6 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 13 Jun 2021 13:01:31 +0200 Subject: MyOBD: Trace every read and write to OBD adapter, lpo.ino: adapt for tracing Extra for future : cap readDTC() call frequency to not struggle the CAN bus --- lpo/MyOBD.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lpo/MyOBD.h') diff --git a/lpo/MyOBD.h b/lpo/MyOBD.h index ea143be..f2124c3 100644 --- a/lpo/MyOBD.h +++ b/lpo/MyOBD.h @@ -1,8 +1,20 @@ #ifndef __MYOBD_H #define __MYOBD_H #include + +#include +extern MyLCD lcd; + class MyOBD : public COBDI2C { public: + void write(const char* s) { + lcd.print("<<<"); lcd.println(s); + COBDI2C::write(s); + } + byte receive(char* buffer, byte bufsize, int timeout) { + byte res = COBDI2C::receive(buffer,bufsize, timeout); + lcd.print(">>>"); lcd.println(buffer); + } /* Fake OBD for testing int i; MyOBD() { -- cgit v1.2.3