aboutsummaryrefslogtreecommitdiffstats
path: root/src/diagnostic/active-diagnostic-request.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-16 13:14:02 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 18:17:24 +0100
commitd952c0f8dd36acf9a072603237975b7ff2e915de (patch)
treef283cc016be4a25830607b0fafab74a7cf541d38 /src/diagnostic/active-diagnostic-request.cpp
parente5a97dac176ab84b5903b41113921e42335b1def (diff)
Adding missing doxygen comments.
Made some cleaning about unused things or obsolete. Review existing comments, adding missing comments. Reformat some long long constructor. Change-Id: Ibae247d1295a7a85b49d0ecee473022755d42b8b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/diagnostic/active-diagnostic-request.cpp')
-rw-r--r--src/diagnostic/active-diagnostic-request.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/diagnostic/active-diagnostic-request.cpp b/src/diagnostic/active-diagnostic-request.cpp
index a21f7303..8cb047db 100644
--- a/src/diagnostic/active-diagnostic-request.cpp
+++ b/src/diagnostic/active-diagnostic-request.cpp
@@ -24,6 +24,7 @@
#define ERROR_PID 0xFF
+// @brief
std::string active_diagnostic_request_t::prefix_ = "diagnostic_messages";
bool active_diagnostic_request_t::operator==(const active_diagnostic_request_t& b)
@@ -137,11 +138,14 @@ void active_diagnostic_request_t::set_in_flight(bool val)
in_flight_ = val;
}
-/**
-* @brief Check if requested signal name is an obd2 pid
-*
-* @return true if name began with obd2 else false.
-*/
+///
+/// @brief Check if requested signal name is a diagnostic message. If the name
+/// begin with the diagnostic message prefix then true else false.
+///
+/// @param[in] name - A signal name.
+///
+/// @return true if name began with the diagnostic message prefix else false.
+///
bool active_diagnostic_request_t::is_diagnostic_signal(const std::string& name)
{
const std::string p = active_diagnostic_request_t::prefix_ + "*";
@@ -150,6 +154,11 @@ bool active_diagnostic_request_t::is_diagnostic_signal(const std::string& name)
return false;
}
+/// @brief Check is the request should be sent or not
+///
+/// @return true if the request isn't already running and not
+/// recurring nor completed, or it is recurring its clock elapsed so it's
+/// time to send another one.
bool active_diagnostic_request_t::should_send()
{
return !get_in_flight() && (
@@ -157,6 +166,9 @@ bool active_diagnostic_request_t::should_send()
(get_recurring() && get_frequency_clock().elapsed(true)));
}
+/// @brief check if the timeout clock has elapsed
+///
+/// @return true if elapsed, so it is a timeout, else false.
bool active_diagnostic_request_t::timed_out()
{
// don't use staggered start with the timeout clock