You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/DS2.h
+7-10Lines changed: 7 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ enum ReceiveType : uint8_t {
78
78
classDS2 {
79
79
public:
80
80
// Constructor, you can pass any Serial, SoftwareSerial or BluetoothSerial - anything that extends 'stream'
81
-
DS2(Stream &stream);
81
+
DS2(Stream &stream):serial(stream) {}
82
82
83
83
// You san use library in blocking mode (default is false) and it waits ISO 112ms time for response.
84
84
voidsetBlocking(bool mode);
@@ -95,7 +95,8 @@ class DS2 {
95
95
uint8_twriteData(uint8_t data[], uint8_t length = 0); // sets device to first byte value; sets echo to second byte value
96
96
boolreadCommand(uint8_t data[]); // sets echo to 0 so you can use readData and it will read data without echo after calling this command
97
97
boolreadData(uint8_t data[]); // reads command and checks data
98
-
boolcheckData(uint8_t data[]); // just use setEcho to 0 if want to check only response or command otherwise it will check whole data (echo + response) for checksum
98
+
// just use setEcho to 0 if want to check only response or command otherwise it will check whole data (echo + response) for checksum
99
+
boolcheckData(uint8_t data[], bool fix = false); // fix = true allows you to fix checksum of the data you want to send
99
100
uint8_tavailable();
100
101
voidflush();
101
102
@@ -129,11 +130,8 @@ class DS2 {
129
130
boolgetKwp() { return kwp; };
130
131
131
132
// Some ECUs like DDE4 need delay between bytes sent
0 commit comments