aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/configuration.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-04-21 15:42:48 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-04-21 15:42:48 +0200
commitf0880c9212e3fb1c2abe8dbbcd376da1279901e6 (patch)
tree2b2042042c77e1e753cddb30e8ee22d7416f3f55 /CAN-binder/low-can-binding/configuration.cpp
parent1a67a9c8647c7fa48ee435f033f336e5f83ac270 (diff)
Diagnostic messages subscription simplified.
Remove useless function. Change-Id: I6638c3033cfeea643b29c1280d7f5785371cd342 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/configuration.cpp')
-rw-r--r--CAN-binder/low-can-binding/configuration.cpp40
1 files changed, 18 insertions, 22 deletions
diff --git a/CAN-binder/low-can-binding/configuration.cpp b/CAN-binder/low-can-binding/configuration.cpp
index 8a50cbc..a94809f 100644
--- a/CAN-binder/low-can-binding/configuration.cpp
+++ b/CAN-binder/low-can-binding/configuration.cpp
@@ -87,6 +87,24 @@ void configuration_t::set_active_message_set(uint8_t id)
active_message_set_ = id;
}
+
+diagnostic_message_t* configuration_t::get_diagnostic_message(std::string message_name) const
+{
+ std::vector<diagnostic_message_t*> found;
+ configuration_t::instance().find_diagnostic_messages(build_DynamicField(message_name), found);
+ if(! found.empty())
+ return found.front();
+ return nullptr;
+}
+
+DiagnosticRequest* configuration_t::get_request_from_diagnostic_message(std::string message_name) const
+{
+ diagnostic_message_t* diag_msg = get_diagnostic_message(message_name);
+ if( diag_msg != nullptr && diag_msg->get_supported())
+ return new DiagnosticRequest(diag_msg->build_diagnostic_request());
+ return nullptr;
+}
+
/// @brief return diagnostic messages name found searching through diagnostic messages list.
///
/// @param[in] key - can contain numeric or string value in order to search against
@@ -110,28 +128,6 @@ void configuration_t::find_diagnostic_messages(const openxc_DynamicField &key, s
DEBUG(binder_interface, "find_diagnostic_messages: Found %d signal(s)", (int)found_signals.size());
}
-diagnostic_message_t* configuration_t::get_diagnostic_message(std::string message_name) const
-{
- std::vector<diagnostic_message_t*> found;
- configuration_t::instance().find_diagnostic_messages(build_DynamicField(message_name), found);
- if(! found.empty())
- return found.front();
- return nullptr;
-}
-
-DiagnosticRequest* configuration_t::get_request_from_diagnostic_message(diagnostic_message_t* diag_msg) const
-{
- return new DiagnosticRequest(diag_msg->build_diagnostic_request());
-}
-
-DiagnosticRequest* configuration_t::get_request_from_diagnostic_message(std::string message_name) const
-{
- diagnostic_message_t* diag_msg = get_diagnostic_message(message_name);
- if( diag_msg != nullptr)
- return new DiagnosticRequest(diag_msg->build_diagnostic_request());
- return nullptr;
-}
-
/// @brief return signals name found searching through CAN signals list.
///
/// @param[in] key - can contain numeric or string value in order to search against