Commit beb25bf4 authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Ignore error frames in CanBus

parent 8f7c285f
......@@ -67,22 +67,24 @@ void CanBus::onRecv (CanMessage * msg) {
if (msg != Q_NULLPTR) {
bench.restart ();
if (Manager::instance ().get_running ()) {
const int canId = (msg->getCanId ().isEFF ()
? int (msg->getCanId ().canIdEFF ())
: int (msg->getCanId ().canIdSFF ()));
const QList<RoutineOnCanFrame *> list = m_routinesForCanId.values (canId);
if (!list.isEmpty ()) {
for (RoutineOnCanFrame * routine : arrayRange (list)) {
routine->getFrameRx ()->setCanData (msg->getCanData ());
routine->execute ();
}
if (Manager::instance ().get_currentNetwork () &&
Manager::instance ().get_currentNetwork ()->get_benchmarkCanFramesTiming ()) {
INFO << "RECV" << qPrintable (QLatin1String (QByteArray::number (qreal (bench.nsecsElapsed ()) / 1000000.0, 'f', 6))) << "ms"
<< "(" << "frame" << canId << "with timestamp" << qPrintable (msg->getTimeStamp ().toString ("hh:mm:ss.zzz")) << ")";
if (!msg->getCanId ().isERR ()) {
const int canId = (msg->getCanId ().isEFF ()
? int (msg->getCanId ().canIdEFF ())
: int (msg->getCanId ().canIdSFF ()));
const QList<RoutineOnCanFrame *> list = m_routinesForCanId.values (canId);
if (!list.isEmpty ()) {
for (RoutineOnCanFrame * routine : arrayRange (list)) {
routine->getFrameRx ()->setCanData (msg->getCanData ());
routine->execute ();
}
if (Manager::instance ().get_currentNetwork () &&
Manager::instance ().get_currentNetwork ()->get_benchmarkCanFramesTiming ()) {
INFO << "RECV" << qPrintable (QLatin1String (QByteArray::number (qreal (bench.nsecsElapsed ()) / 1000000.0, 'f', 6))) << "ms"
<< "(" << "frame" << canId << "with timestamp" << qPrintable (msg->getTimeStamp ().toString ("hh:mm:ss.zzz")) << ")";
}
}
emit m_driverProxy->recv (msg);
}
emit m_driverProxy->recv (msg);
}
delete msg;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment