famez / J1939-Framework

Framework to work with J1939 Frames used in CAN bus in bus, car and trucks industries
MIT License
158 stars 55 forks source link

Cannot sniff CAN frames using libCan #5

Closed DNNlearning closed 5 years ago

DNNlearning commented 5 years ago

Is there a proper example code for how to receive and send j1939 CAN frames in C++ ? The sample C++ code that exists in CAN folder does not work, giving me errors like these:

undefined reference to `Can::CanEasy::initialize(unsigned int, void ()(Can::CanFrame const&, Utils::TimeStamp const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, void), bool (*)())'

undefined reference to Can::CanEasy::mSniffer' undefined reference toCan::CanEasy::mSniffer' undefined reference to `Can::CanSniffer::sniff(unsigned int) const'

famez commented 5 years ago

For sure,

Check out TRCPlayer or TRCDumper

They make use of libCAN to inject frames from a file or record them into a file.

famez commented 5 years ago

Closed due to inactivity