diff --git a/can/SConscript b/can/SConscript index 40f18ba..bcb342b 100644 --- a/can/SConscript +++ b/can/SConscript @@ -1,4 +1,4 @@ -Import('env', 'envCython', 'cereal') +Import('env', 'envCython', 'cereal', 'common') import os from opendbc.can.process_dbc import process @@ -14,7 +14,7 @@ for x in sorted(os.listdir('../')): env.Depends(dbc, ["dbc.py", "process_dbc.py"]) dbcs.append(dbc) -libdbc = env.SharedLibrary('libdbc', ["dbc.cc", "parser.cc", "packer.cc", "common.cc"]+dbcs, LIBS=["capnp", "kj"]) +libdbc = env.SharedLibrary('libdbc', ["dbc.cc", "parser.cc", "packer.cc", "common.cc"]+dbcs, LIBS=[common, "capnp", "kj", "zmq"]) # Build packer and parser lenv = envCython.Clone() diff --git a/can/parser.cc b/can/parser.cc index c396c7b..3ec8675 100644 --- a/can/parser.cc +++ b/can/parser.cc @@ -8,8 +8,8 @@ #include #include -#include "common.h" - +#include "cereal/logger/logger.h" +#include "opendbc/can/common.h" int64_t get_raw_value(const std::vector &msg, const Signal &sig) { int64_t ret = 0; @@ -68,7 +68,7 @@ bool MessageState::parse(uint64_t sec, const std::vector &dat) { } if (checksum_failed || counter_failed) { - WARN("0x%X message checks failed, checksum failed %d, counter failed %d\n", address, checksum_failed, counter_failed); + LOGE("0x%X message checks failed, checksum failed %d, counter failed %d\n", address, checksum_failed, counter_failed); return false; } @@ -290,9 +290,9 @@ void CANParser::UpdateValid(uint64_t sec) { const auto& state = kv.second; if (state.check_threshold > 0 && (sec - state.seen) > state.check_threshold) { if (state.seen > 0) { - DEBUG("0x%X TIMEOUT\n", state.address); + LOGE("0x%X TIMEOUT\n", state.address); } else { - DEBUG("0x%X MISSING\n", state.address); + LOGE("0x%X MISSING\n", state.address); } can_valid = false; }