Skip to content

Commit

Permalink
can parser: reduce spammy debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Comma Device committed Sep 2, 2022
1 parent 83d4cb9 commit d588872
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions can/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,12 @@ void CANParser::UpdateValid(uint64_t sec) {
const bool missing = state.last_seen_nanos == 0;
const bool timed_out = (sec - state.last_seen_nanos) > state.check_threshold;
if (state.check_threshold > 0 && (missing || timed_out)) {
if (missing) {
LOGE("0x%X MISSING", state.address);
} else if (show_missing) {
LOGE("0x%X TIMEOUT", state.address);
if (show_missing && !bus_timeout) {
if (missing) {
LOGE("0x%X NOT SEEN", state.address);
} else if (timed_out) {
LOGE("0x%X TIMED OUT", state.address);
}
}
_valid = false;
}
Expand Down

0 comments on commit d588872

Please sign in to comment.