summaryrefslogtreecommitdiffstats
path: root/src/can_decode_message.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-02-22 11:44:27 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-02-22 12:15:13 +0100
commit747d58ad84d230f6cf11ac818bab65019df83611 (patch)
treea7a6f84cac521fd181b8aec490260fda676f08cc /src/can_decode_message.cpp
parentcfd941effb1b2183f6d3f693496aadd45762523f (diff)
No more warning about not defined functions
because of wrong header files inclusion. Some variables are now accessible using functions rather than using global variables that can not be accessed through separated files. Also fix timer returning function type. Change-Id: I36138ff671c2537f595235273abaa34783be18e1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can_decode_message.cpp')
-rw-r--r--src/can_decode_message.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/can_decode_message.cpp b/src/can_decode_message.cpp
index 126c4fac..8b087cfc 100644
--- a/src/can_decode_message.cpp
+++ b/src/can_decode_message.cpp
@@ -20,7 +20,7 @@
void can_decode_message(can_bus_t &can_bus)
{
- can_message_t can_message(interface) ;
+ can_message_t can_message(can_bus.interface_) ;
std::vector <CanSignal> signals;
std::vector <CanSignal>::iterator signals_i;
openxc_VehicleMessage vehicle_message;
@@ -35,15 +35,16 @@ void can_decode_message(can_bus_t &can_bus)
/* First we have to found which CanSignal is */
search_key = build_DynamicField((double)can_message.get_id());
- signals = find_can_signals(interface, search_key);
+ signals = find_can_signals(can_bus.interface_, search_key);
/* Decoding the message ! Don't kill the messenger ! */
for(const auto& sig : signals)
{
- subscribed_signals_i = subscribed_signals.find(sig.genericName);
+ std::map<std::string, struct afb_event> subscribed_signals = get_subscribed_signals();
+ const auto& it_event = subscribed_signals.find(sig.genericName);
- if(subscribed_signals_i != subscribed_signals.end() &&
- afb_event_is_valid(subscribed_signals_i->second))
+ if(it_event != subscribed_signals.end() &&
+ afb_event_is_valid(it_event->second))
{
ret = decoder.decodeSignal(sig, can_message, getSignals(), &send);