aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-15 00:43:59 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:21:57 +0100
commit473b167761147a4cb36af86fea8e8c54bdf03d14 (patch)
tree619122fe313ccf40b87b61289f2252283b49d38c /src
parent671d774d22050b939439ebc56d25db2569d00554 (diff)
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 <romain.forlot@iot.bzh>
Diffstat (limited to 'src')
-rw-r--r--src/can/can-bus.cpp2
-rw-r--r--src/utils/signals.hpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/can/can-bus.cpp b/src/can/can-bus.cpp
index 09fce46d..69f08c5f 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 00b9e3ed..f68f5664 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<T>& 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());
}
}