summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-07 09:30:50 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:09:03 +0100
commitabdd2abd39eaa1543fa90125cc6261a8626c2cc9 (patch)
treeb9f23c204299b8ee22eaa04772ee4121c7774d72
parent89e072c41f3417e0a80cf95be3cf88326df32777 (diff)
Fix: wrong function signature and get out from class
temporarly to get compiled project. Change-Id: I7235f503c42a3e31d09094c42882b74e5e809493 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--src/diagnostic/diagnostic-message.cpp2
-rw-r--r--src/diagnostic/diagnostic-message.hpp3
-rw-r--r--src/utils/signals.hpp2
3 files changed, 3 insertions, 4 deletions
diff --git a/src/diagnostic/diagnostic-message.cpp b/src/diagnostic/diagnostic-message.cpp
index c358aae..0b1a933 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 5a19393..062f7b5 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<obd2_signals_t*>& 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<obd2_signals_t>& get_obd2_signals(); \ No newline at end of file
diff --git a/src/utils/signals.hpp b/src/utils/signals.hpp
index bc421e9..8e15bd2 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<T>& signals, std::vector
template <typename T>
void lookup_signals_by_id(const double key, std::vector<T>& signals, std::vector<std::string>& found_signals_name)
{
- for(T& s : signals)
+ for(const T& s : signals)
{
if(get_signal_id(s) == key)
{