From 093d7a35c23c65ffef888ded40aea9e77f0e4975 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 10 Mar 2017 15:53:27 +0100 Subject: Manage prefix on CAN and OBD2 prefix. Searching signals is made on generic_name (without prefix) and returned vector of string is filled with name with prefix. Then you can process on them based upon their name differently. OBD2 signals will generated recurring request on diagnostic manager and decoding will not be handled the same way too. Change-Id: I2c5239ef49661941a0a748debe0bd536b2954b3a Signed-off-by: Romain Forlot --- src/diagnostic/diagnostic-message.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/diagnostic/diagnostic-message.cpp') diff --git a/src/diagnostic/diagnostic-message.cpp b/src/diagnostic/diagnostic-message.cpp index 8f42653..bd76de0 100644 --- a/src/diagnostic/diagnostic-message.cpp +++ b/src/diagnostic/diagnostic-message.cpp @@ -48,6 +48,16 @@ std::string& obd2_signal_t::get_generic_name() return generic_name_; } +std::string obd2_signal_t::get_name() +{ + return prefix_ + "." + generic_name_; +} + +void obd2_signal_t::set_prefix(std::string val) +{ + prefix_ = val; +} + bool obd2_signal_t::is_obd2_response(can_message_t can_message) { /* -- cgit 1.2.3-korg