From 20708cd497b2f77f8b97fd215b6b5c1e2886869d Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 8 Mar 2017 23:56:49 +0100 Subject: Use the new created class and their respectives methods to get their attributes. Change-Id: Ib96031388356541615cd2c428d3ad1a73c79e215 Signed-off-by: Romain Forlot --- src/can/can-bus.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/can') diff --git a/src/can/can-bus.cpp b/src/can/can-bus.cpp index 06d3d89c..ff899e61 100644 --- a/src/can/can-bus.cpp +++ b/src/can/can-bus.cpp @@ -27,16 +27,18 @@ #include #include -#include "can/can-decoder.hpp" -#include "utils/openxc-utils.hpp" +#include "can-bus.hpp" + +#include "can-decoder.hpp" +#include "../configuration.hpp" +#include "../utils/signals.hpp" +#include "../utils/openxc-utils.hpp" extern "C" { #include } -#include "can/can-bus.hpp" - /******************************************************************************** * * can_bus_t method implementation @@ -92,11 +94,11 @@ void can_bus_t::can_decode_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->generic_name) != s.end() && afb_event_is_valid(s[sig->generic_name])) + if( s.find(sig->get_generic_name()) != s.end() && afb_event_is_valid(s[sig->get_generic_name()])) { - decoded_message = decoder_t::translateSignal(*sig, can_message, get_can_signals()); + decoded_message = decoder_t::translateSignal(*sig, can_message, config->get_can_signals()); - openxc_SimpleMessage s_message = build_SimpleMessage(sig->generic_name, decoded_message); + openxc_SimpleMessage s_message = build_SimpleMessage(sig->get_generic_name(), decoded_message); vehicle_message = build_VehicleMessage_with_SimpleMessage(openxc_DynamicField_Type::openxc_DynamicField_Type_NUM, s_message); std::lock_guard decoded_can_message_lock(decoded_can_message_mutex_); -- cgit 1.2.3-korg