From 473b167761147a4cb36af86fea8e8c54bdf03d14 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 15 Mar 2017 00:43:59 +0100 Subject: Search signals against name not generic_name. It's made to get able to get difference between classic CAN messages and diagnostic messages based on name signals prefix. Change-Id: I696facc58f38150e0457d519dcabffba750a8db3 Signed-off-by: Romain Forlot --- src/can/can-bus.cpp | 2 +- src/utils/signals.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/can/can-bus.cpp b/src/can/can-bus.cpp index 09fce46..69f08c5 100644 --- a/src/can/can-bus.cpp +++ b/src/can/can-bus.cpp @@ -85,7 +85,7 @@ int can_bus_t::process_can_signals(can_message_t& can_message) DEBUG(binder_interface, "Operator[] key string: %s, event valid? %d", sig.generic_name, afb_event_is_valid(s[std::string(sig.generic_name)])); DEBUG(binder_interface, "Nb elt matched char: %d", (int)s.count(sig.generic_name)); DEBUG(binder_interface, "Nb elt matched string: %d", (int)s.count(std::string(sig.generic_name)));*/ - if( s.find(sig->get_generic_name()) != s.end() && afb_event_is_valid(s[sig->get_generic_name()])) + if( s.find(sig->get_name()) != s.end() && afb_event_is_valid(s[sig->get_name()])) { decoded_message = decoder_t::translateSignal(*sig, can_message, configuration_t::instance().get_can_signals()); diff --git a/src/utils/signals.hpp b/src/utils/signals.hpp index 00b9e3e..f68f566 100644 --- a/src/utils/signals.hpp +++ b/src/utils/signals.hpp @@ -57,9 +57,9 @@ void lookup_signals_by_name(const std::string& key, std::vector& signals, std for(T& s : signals) { if(::fnmatch(key.c_str(), s.get_generic_name().c_str(), FNM_CASEFOLD) == 0) - found_signals_name.push_back(s.get_generic_name()); + found_signals_name.push_back(s.get_name()); if(::fnmatch(key.c_str(), s.get_name().c_str(), FNM_CASEFOLD) == 0) - found_signals_name.push_back(s.get_generic_name()); + found_signals_name.push_back(s.get_name()); } } -- cgit 1.2.3-korg