Skip to content

Commit

Permalink
add checksum check to can parser for subaru
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh committed Apr 30, 2020
1 parent 7f3b177 commit 7456061
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions can/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ bool MessageState::parse(uint64_t sec, uint16_t ts_, uint8_t * dat) {
if (!update_counter_generic(tmp, sig.b2)) {
return false;
}
} else if (sig.type == SignalType::SUBARU_CHECKSUM) {
if (subaru_checksum(address, dat_be, size) != tmp) {
INFO("0x%X CHECKSUM FAIL\n", address);
return false;
}
} else if (sig.type == SignalType::CHRYSLER_CHECKSUM) {
if (chrysler_checksum(address, dat_le, size) != tmp) {
INFO("0x%X CHECKSUM FAIL\n", address);
Expand Down

0 comments on commit 7456061

Please sign in to comment.