X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fdiagnostic%2Factive-diagnostic-request.cpp;h=7ddf1d5184348e5e7cbb7b49efc4c9de5de5cd04;hb=3aa89d6f3d38ce0513d8698f2ae7b23f8c6edfb9;hp=9e64bd5541acc20d7c6954cab62364989983c837;hpb=20336cf43a6b312cd03f76dbe68333db18122bd6;p=apps%2Flow-level-can-service.git diff --git a/src/diagnostic/active-diagnostic-request.cpp b/src/diagnostic/active-diagnostic-request.cpp index 9e64bd5..7ddf1d5 100644 --- a/src/diagnostic/active-diagnostic-request.cpp +++ b/src/diagnostic/active-diagnostic-request.cpp @@ -24,12 +24,11 @@ #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) { - return (bus_ == b.bus_ && id_ == b.id_ && handle_ == b.handle_) ? true : false; + return (bus_ == b.bus_ && id_ == b.id_ && handle_ == b.handle_); } active_diagnostic_request_t& active_diagnostic_request_t::operator=(const active_diagnostic_request_t& adr) @@ -156,14 +155,13 @@ bool active_diagnostic_request_t::is_diagnostic_signal(const std::string& name) /// @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. +/// @return true if the request is not running or recurring nor completed, +/// or it's recurring, its clock elapsed +/// so it's time to send another one. bool active_diagnostic_request_t::should_send() { - return !get_in_flight() && ( - (!get_recurring() && !request_completed()) || - (get_recurring() && get_frequency_clock().elapsed(true))); + return !in_flight_ && ( (!recurring_ && !request_completed()) || + (recurring_ && frequency_clock_.elapsed(true)) ); } /// @brief check if the timeout clock has elapsed