summaryrefslogtreecommitdiffstats
path: root/src/diagnostic/active-diagnostic-request.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-13 15:03:00 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:15:55 +0100
commit542518e3f4390fcb0d8fb17bcbb14c7eb4335a61 (patch)
tree340eda25b52c5f6e4b47dae3aace322c57359e55 /src/diagnostic/active-diagnostic-request.hpp
parentf0d7a6523955ee94a32ec4b62e2a207b23f62316 (diff)
Move member from obd2_signals_t class to
active_diagnostic_request_t (adr)class. It's more logical to have them here as call about incoming diagnostic CAN messages are made against adr class not obd2_signal_t that it's a subset of diagnostic messages. It's made to handle obd2 requests as well as normal UDS diagnostic request for constructor proprietary diagnostic signals. Change-Id: I96c714640d6ecfa25dfc9942974057c1797eb0e1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/diagnostic/active-diagnostic-request.hpp')
-rw-r--r--src/diagnostic/active-diagnostic-request.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/diagnostic/active-diagnostic-request.hpp b/src/diagnostic/active-diagnostic-request.hpp
index fb87c83..74a969b 100644
--- a/src/diagnostic/active-diagnostic-request.hpp
+++ b/src/diagnostic/active-diagnostic-request.hpp
@@ -62,6 +62,8 @@ private:
* sending the frames of the request and receiving all frames of the response.*/
std::string name_; /*!< name_ - An optional human readable name this response, to be used when publishing received
* responses. If the name is NULL, the published output will use the raw OBD-II response format.*/
+ static std::string prefix_; /*!< prefix_ - generic_name_ will be prefixed with it. It has to reflect the used protocol.
+ * which make easier to sort message when the come in.*/
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
* instead of a parsed value.*/
@@ -82,7 +84,6 @@ public:
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 active_diagnostic_request_t&) = default;
active_diagnostic_request_t(std::shared_ptr<can_bus_dev_t> bus, DiagnosticRequest* request,
const std::string& name, bool wait_for_multiple_responses,
const DiagnosticResponseDecoder decoder,
@@ -91,6 +92,10 @@ public:
uint32_t get_id() const;
std::shared_ptr<can_bus_dev_t> get_can_bus_dev();
DiagnosticRequestHandle* get_handle();
+ std::string& get_name();
+ static std::string& get_prefix();
+ DiagnosticResponseDecoder& get_decoder();
+ DiagnosticResponseCallback& get_callback();
bool get_recurring() const;
bool get_in_flight() const;
frequency_clock_t& get_frequency_clock();
@@ -99,6 +104,8 @@ public:
void set_handle(DiagnosticShims& shims, DiagnosticRequest* request);
void set_in_flight(bool val);
+ static bool is_diagnostic_signal(const std::string& name);
+
bool should_send();
bool timed_out();