summaryrefslogtreecommitdiffstats
path: root/src/configuration.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-30 17:19:59 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-04-11 12:41:42 +0200
commit46d396e04947a76756739576a29c8369f8cd0c50 (patch)
tree6f27b769b2880c291d7b2704c414e35c22c1b85d /src/configuration.cpp
parent34d84de6e8b825ced7d476672035c0b94856862e (diff)
Handle cancel active diag requet when there are no more subscribers
When push events if there is no more subscribers to that event then call a function that will cleanup that request from diagnostic manager queue. Change-Id: I8153701074453444a5bba6f1374401bdf230f7e6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/configuration.cpp')
-rw-r--r--src/configuration.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp
index 184d4688..32cb00cd 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -18,6 +18,7 @@
#include "configuration.hpp"
#include "utils/signals.hpp"
+#include "utils/openxc-utils.hpp"
/// @brief Return singleton instance of configuration object.
configuration_t& configuration_t::instance()
@@ -109,6 +110,23 @@ 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);
+ return found.front();
+}
+
+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
+{
+ return new DiagnosticRequest(get_diagnostic_message(message_name)->build_diagnostic_request());
+}
+
/// @brief return signals name found searching through CAN signals list.
///
/// @param[in] key - can contain numeric or string value in order to search against