X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Fdiagnostic%2Factive-diagnostic-request.hpp;h=effe932448456e0eedcdb846936abceb6671ca82;hb=1cf6c83e46ebc8fb5c45359becf3ee7583e9f769;hp=d263a2d2a63ce41088700d0960fa745588b18796;hpb=32e25cbca210a359b09768537b6f443fe90a3070;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/diagnostic/active-diagnostic-request.hpp b/low-can-binding/diagnostic/active-diagnostic-request.hpp index d263a2d2..effe9324 100644 --- a/low-can-binding/diagnostic/active-diagnostic-request.hpp +++ b/low-can-binding/diagnostic/active-diagnostic-request.hpp @@ -67,8 +67,7 @@ private: DiagnosticRequestHandle* handle_; ///< handle_ - A handle for the request to keep track of it between ///< sending the frames of the request and receiving all frames of the response. std::string name_; ///< name_ - Human readable name, to be used when publishing received responses. - ///< TODO: If the name is NULL, the published output will use the raw OBD-II response format. - static std::string prefix_; ///< prefix_ - It has to reflect the JSON object which it comes from. It makes easier sorting + static std::string prefix_; ///< prefix_ - It has to reflect the JSON object which it comes from. It makes easier sorting ///< incoming CAN messages. DiagnosticResponseDecoder decoder_; ///< decoder_ - An optional DiagnosticResponseDecoder to parse the payload of responses ///< to this request. If the decoder is NULL, the output will include the raw payload @@ -76,7 +75,8 @@ private: DiagnosticResponseCallback callback_; ///< callback_ - An optional DiagnosticResponseCallback to be notified whenever a ///< response is received for this request. bool recurring_; ///< bool recurring_ - If true, this is a recurring request and it will remain as active until explicitly cancelled. - ///< The frequencyClock attribute controls how often a recurrin request is made. + ///< The frequencyClock attribute controls how often a recurring request is made. + bool permanent_; ///< bool permanent_ - If true, this a permanent recurring request and will remain as active indefinitely (can't be cancelled). bool wait_for_multiple_responses_; ///< wait_for_multiple_responses_ - False by default, when any response is received for a request ///< it will be removed from the active list. If true, the request will remain active until the timeout ///< clock expires, to allow it to receive multiple response (e.g. to a functional broadcast request). @@ -86,15 +86,11 @@ private: ///< this request was sent. utils::socketcan_bcm_t socket_; ///< socket_ - A BCM socket setup to send cyclic message to CAN ID 7DF. public: - bool operator==(const active_diagnostic_request_t& b); - active_diagnostic_request_t& operator=(const active_diagnostic_request_t& adr); - - active_diagnostic_request_t(); active_diagnostic_request_t(active_diagnostic_request_t&&) = default; active_diagnostic_request_t(const std::string& bus, uint32_t id, const std::string& name, bool wait_for_multiple_responses, const DiagnosticResponseDecoder decoder, - const DiagnosticResponseCallback callback, float frequencyHz); + const DiagnosticResponseCallback callback, float frequencyHz, bool permanent); ~active_diagnostic_request_t(); uint32_t get_id() const; @@ -105,13 +101,12 @@ public: DiagnosticResponseDecoder& get_decoder(); DiagnosticResponseCallback& get_callback(); bool get_recurring() const; + bool get_permanent() const; frequency_clock_t& get_frequency_clock(); frequency_clock_t& get_timeout_clock(); utils::socketcan_bcm_t& get_socket(); void set_handle(DiagnosticShims& shims, DiagnosticRequest* request); - static bool is_diagnostic_signal(const std::string& name); - bool response_received() const; };