summaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/diagnostic
diff options
context:
space:
mode:
Diffstat (limited to 'CAN-binder/low-can-binding/diagnostic')
-rw-r--r--CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp4
-rw-r--r--CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.hpp2
-rw-r--r--CAN-binder/low-can-binding/diagnostic/diagnostic-manager.cpp10
-rw-r--r--CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp3
4 files changed, 10 insertions, 9 deletions
diff --git a/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp b/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp
index 61775b8..f503e0a 100644
--- a/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp
+++ b/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp
@@ -65,14 +65,14 @@ active_diagnostic_request_t::active_diagnostic_request_t()
socket_{}
{}
-active_diagnostic_request_t::active_diagnostic_request_t(const std::string& bus, DiagnosticRequest* request,
+active_diagnostic_request_t::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)
: bus_{bus},
- id_{request->arbitration_id},
+ id_{id},
handle_{nullptr},
name_{name},
decoder_{decoder},
diff --git a/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.hpp b/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.hpp
index a1b8ab5..d263a2d 100644
--- a/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.hpp
+++ b/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.hpp
@@ -91,7 +91,7 @@ public:
active_diagnostic_request_t();
active_diagnostic_request_t(active_diagnostic_request_t&&) = default;
- active_diagnostic_request_t(const std::string& bus, DiagnosticRequest* request,
+ 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);
diff --git a/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.cpp b/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.cpp
index fd4fbd2..ac91ae5 100644
--- a/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.cpp
+++ b/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.cpp
@@ -246,13 +246,13 @@ void diagnostic_manager_t::cleanup_active_requests(bool force)
///
/// @param[in] request - Search key, method will go through recurring list to see if it find that request
/// holded by the DiagnosticHandle member.
-active_diagnostic_request_t* diagnostic_manager_t::find_recurring_request(const DiagnosticRequest* request)
+active_diagnostic_request_t* diagnostic_manager_t::find_recurring_request(DiagnosticRequest& request)
{
for (auto& entry : recurring_requests_)
{
if(entry != nullptr)
{
- if(diagnostic_request_equals(&entry->get_handle()->request, request))
+ if(diagnostic_request_equals(&entry->get_handle()->request, &request))
{return entry;}
}
}
@@ -297,7 +297,7 @@ active_diagnostic_request_t* diagnostic_manager_t::add_request(DiagnosticRequest
{
// TODO: implement Acceptance Filter
// if(updateRequiredAcceptanceFilters(bus, request)) {
- active_diagnostic_request_t* entry = new active_diagnostic_request_t(bus_, request, name,
+ active_diagnostic_request_t* entry = new active_diagnostic_request_t(bus_, request->arbitration_id, name,
wait_for_multiple_responses, decoder, callback, 0);
entry->set_handle(shims_, request);
@@ -393,11 +393,11 @@ active_diagnostic_request_t* diagnostic_manager_t::add_recurring_request(Diagnos
cleanup_active_requests(false);
- if(find_recurring_request(request) == nullptr)
+ if(find_recurring_request(*request) == nullptr)
{
if(recurring_requests_.size() <= MAX_SIMULTANEOUS_DIAG_REQUESTS)
{
- entry = new active_diagnostic_request_t(bus_, request, name,
+ entry = new active_diagnostic_request_t(bus_, request->arbitration_id, name,
wait_for_multiple_responses, decoder, callback, frequencyHz);
recurring_requests_.push_back(entry);
diff --git a/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp b/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp
index d52ffe9..4c023c6 100644
--- a/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp
+++ b/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp
@@ -67,12 +67,13 @@ public:
const std::string get_bus_device_name() const;
active_diagnostic_request_t* get_last_recurring_requests() const;
DiagnosticShims& get_shims();
+ bool is_active_requests_running();
void find_and_erase(active_diagnostic_request_t* entry, std::vector<active_diagnostic_request_t*>& requests_list);
void cancel_request(active_diagnostic_request_t* entry);
void cleanup_request(active_diagnostic_request_t* entry, bool force);
void cleanup_active_requests(bool force);
- active_diagnostic_request_t* find_recurring_request(const DiagnosticRequest* request);
+ active_diagnostic_request_t* find_recurring_request(DiagnosticRequest& request);
// Subscription parts
active_diagnostic_request_t* add_request(DiagnosticRequest* request, const std::string& name,