diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-15 23:16:59 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-16 17:21:57 +0100 |
commit | 0a9f3524f442ff055fb1075f92bd85f9b4522910 (patch) | |
tree | a2aef99c4c596d13992173c015cb4d6f0d1a2fe0 /src/configuration.cpp | |
parent | 53cd923a034162273fea2f4fb045b28686f51df5 (diff) |
Rename class and 1:1 map to JSON description file
Added decoder and callback member that will be set by generator and taken
at submission to be used later, storing them into an active diagnostic
request instance, when response CAN message comes in.
Change-Id: I9ded05de3bb28ec55e4e007d72d0e1924141a6a6
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/configuration.cpp')
-rw-r--r-- | src/configuration.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp index ec12d8f..52ddde4 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -67,9 +67,9 @@ std::vector<can_signal_t>& configuration_t::get_can_signals() return can_signals_[active_message_set_]; } -std::vector<obd2_signal_t>& configuration_t::get_obd2_signals() +std::vector<diagnostic_message_t>& configuration_t::get_diagnostic_messages() { - return obd2_signals_[active_message_set_]; + return diagnostic_messages_[active_message_set_]; } const std::vector<std::string>& configuration_t::get_signals_prefix() const @@ -82,7 +82,7 @@ const std::vector<can_message_definition_t>& configuration_t::get_can_message_de return can_message_definition_[active_message_set_]; } -uint32_t configuration_t::get_signal_id(obd2_signal_t& sig) const +uint32_t configuration_t::get_signal_id(diagnostic_message_t& sig) const { return sig.get_pid(); } @@ -106,21 +106,21 @@ void configuration_t::set_active_message_set(uint8_t id) * * @return Vector of signals name found. */ -void configuration_t::find_obd2_signals(const openxc_DynamicField &key, std::vector<obd2_signal_t*>& found_signals) +void configuration_t::find_diagnostic_messages(const openxc_DynamicField &key, std::vector<diagnostic_message_t*>& found_signals) { switch(key.type) { case openxc_DynamicField_Type::openxc_DynamicField_Type_STRING: - lookup_signals_by_name(key.string_value, obd2_signals_[active_message_set_], found_signals); + lookup_signals_by_name(key.string_value, diagnostic_messages_[active_message_set_], found_signals); break; case openxc_DynamicField_Type::openxc_DynamicField_Type_NUM: - lookup_signals_by_id(key.numeric_value, obd2_signals_[active_message_set_], found_signals); + lookup_signals_by_id(key.numeric_value, diagnostic_messages_[active_message_set_], found_signals); break; default: - ERROR(binder_interface, "find_obd2_signals: wrong openxc_DynamicField specified. Use openxc_DynamicField_Type_NUM or openxc_DynamicField_Type_STRING type only."); + ERROR(binder_interface, "find_diagnostic_messages: wrong openxc_DynamicField specified. Use openxc_DynamicField_Type_NUM or openxc_DynamicField_Type_STRING type only."); break; } - DEBUG(binder_interface, "find_obd2_signals: Found %d signal(s)", (int)found_signals.size()); + DEBUG(binder_interface, "find_diagnostic_messages: Found %d signal(s)", (int)found_signals.size()); } /** |