diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-04-09 09:25:47 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-04-17 11:42:37 +0200 |
commit | e4e00c65f8b686dd93e68a3226020692a62e1d26 (patch) | |
tree | 6e1e1f14cc147f3eb29cac8aceaf91503cca27bf /low-can-binding/diagnostic/active-diagnostic-request.cpp | |
parent | 29de76e9beac2a8e7ffcd1ccba07a927df1f2bcc (diff) |
Add possibility to subscribe to a recurring request permanently
Add possibility to subscribe to a recurring request that won't be deleted
when no subscriber is detected.
For now, this functionnality is implemented for internal use only.
Bug-AGL: SPEC-1347
Change-Id: I48f6f647677596ba7920c4348d5406ea7bf1081b
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'low-can-binding/diagnostic/active-diagnostic-request.cpp')
-rw-r--r-- | low-can-binding/diagnostic/active-diagnostic-request.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/low-can-binding/diagnostic/active-diagnostic-request.cpp b/low-can-binding/diagnostic/active-diagnostic-request.cpp index 71f5980d..a242147a 100644 --- a/low-can-binding/diagnostic/active-diagnostic-request.cpp +++ b/low-can-binding/diagnostic/active-diagnostic-request.cpp @@ -42,6 +42,7 @@ active_diagnostic_request_t& active_diagnostic_request_t::operator=(const active decoder_ = adr.decoder_; callback_ = adr.callback_; recurring_ = adr.recurring_; + permanent_ = adr.permanent_; wait_for_multiple_responses_ = adr.wait_for_multiple_responses_; frequency_clock_ = adr.frequency_clock_; timeout_clock_ = adr.timeout_clock_; @@ -59,6 +60,7 @@ active_diagnostic_request_t::active_diagnostic_request_t() decoder_{nullptr}, callback_{nullptr}, recurring_{false}, + permanent_{false}, wait_for_multiple_responses_{false}, frequency_clock_{frequency_clock_t()}, timeout_clock_{frequency_clock_t()}, @@ -70,7 +72,8 @@ active_diagnostic_request_t::active_diagnostic_request_t(const std::string& bus, bool wait_for_multiple_responses, const DiagnosticResponseDecoder decoder, const DiagnosticResponseCallback callback, - float frequencyHz) + float frequencyHz, + bool permanent) : bus_{bus}, id_{id}, handle_{nullptr}, @@ -78,6 +81,7 @@ active_diagnostic_request_t::active_diagnostic_request_t(const std::string& bus, decoder_{decoder}, callback_{callback}, recurring_{frequencyHz ? true : false}, + permanent_{permanent}, wait_for_multiple_responses_{wait_for_multiple_responses}, frequency_clock_{frequency_clock_t(frequencyHz)}, timeout_clock_{frequency_clock_t(10)}, @@ -133,6 +137,11 @@ bool active_diagnostic_request_t::get_recurring() const return recurring_; } +bool active_diagnostic_request_t::get_permanent() const +{ + return permanent_; +} + frequency_clock_t& active_diagnostic_request_t::get_frequency_clock() { return frequency_clock_; |