Skip to content

Commit

Permalink
Don't include the checksum byte in the length.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwanders committed Jul 29, 2018
1 parent a9567cb commit 3505bce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/OBD9141.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ uint8_t OBD9141::requestKWP(void* request, uint8_t request_len){

if (calc_checksum == this->buffer[ret_len - 1])
{
return ret_len; // have data; return whether it is valid.
return ret_len - 1; // have data; return whether it is valid.
}
} else {
OBD9141println("Timeout on reading bytes.");
Expand Down Expand Up @@ -461,7 +461,7 @@ bool OBD9141::initKWP(){
// checksum (0x66) is calculated by request method.

// Send this request and read the response
if (this->requestKWP(&message, 4) == 7) {
if (this->requestKWP(&message, 4) == 6) {
// check positive response service ID, should be 0xC1.
if (this->buffer[3] == 0xC1) {
// Not necessary to do anything with this data?
Expand Down

0 comments on commit 3505bce

Please sign in to comment.