From abdd2abd39eaa1543fa90125cc6261a8626c2cc9 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 7 Mar 2017 09:30:50 +0100 Subject: Fix: wrong function signature and get out from class temporarly to get compiled project. Change-Id: I7235f503c42a3e31d09094c42882b74e5e809493 Signed-off-by: Romain Forlot --- src/diagnostic/diagnostic-message.cpp | 2 +- src/diagnostic/diagnostic-message.hpp | 3 +-- src/utils/signals.hpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/diagnostic/diagnostic-message.cpp b/src/diagnostic/diagnostic-message.cpp index c358aae4..0b1a9339 100644 --- a/src/diagnostic/diagnostic-message.cpp +++ b/src/diagnostic/diagnostic-message.cpp @@ -95,7 +95,7 @@ void obd2_signals_t::find_obd2_signals(const openxc_DynamicField &key, std::vect DEBUG(binder_interface, "Found %d signal(s)", (int)found_signals.size()); } -uint32_t get_signal_id(const Obd2Pid& sig) +uint32_t get_signal_id(const obd2_signals_t& sig) { return (uint32_t)sig.pid; } diff --git a/src/diagnostic/diagnostic-message.hpp b/src/diagnostic/diagnostic-message.hpp index 5a19393b..062f7b5e 100644 --- a/src/diagnostic/diagnostic-message.hpp +++ b/src/diagnostic/diagnostic-message.hpp @@ -81,10 +81,8 @@ class obd2_signals_t { void add_request(int pid); - uint32_t get_signal_id(const Obd2Pid& sig); void find_obd2_signals(const openxc_DynamicField &key, std::vector& found_signals); - bool is_obd2_response(can_message_t can_message); bool is_obd2_request(DiagnosticRequest *request); bool is_obd2_signal(const char *name); @@ -92,4 +90,5 @@ class obd2_signals_t { float decode_obd2_response(const DiagnosticResponse* response, float parsedPayload); }; +uint32_t get_signal_id(const obd2_signals_t& sig); std::vector& get_obd2_signals(); \ No newline at end of file diff --git a/src/utils/signals.hpp b/src/utils/signals.hpp index bc421e96..8e15bd21 100644 --- a/src/utils/signals.hpp +++ b/src/utils/signals.hpp @@ -60,7 +60,7 @@ void lookup_signals_by_id(const double key, std::vector& signals, std::vector template void lookup_signals_by_id(const double key, std::vector& signals, std::vector& found_signals_name) { - for(T& s : signals) + for(const T& s : signals) { if(get_signal_id(s) == key) { -- cgit 1.2.3-korg