#include <json-c/json.h>
#include <linux/can/raw.h>
-#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 <afb/afb-binding.h>
}
-#include "can/can-bus.hpp"
-
/********************************************************************************
*
* can_bus_t method implementation
openxc_VehicleMessage vehicle_message;
openxc_DynamicField search_key, decoded_message;
- decoder_t decoder;
-
while(is_decoding_)
{
std::unique_lock<std::mutex> can_message_lock(can_message_mutex_);
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.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<std::mutex> decoded_can_message_lock(decoded_can_message_mutex_);