There is no more need having pointer on socket device
[apps/agl-service-can-low-level.git] / CAN-binder / low-can-binding / diagnostic / active-diagnostic-request.cpp
index 7ddf1d5..4018b6b 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "active-diagnostic-request.hpp"
 
-#include "../configuration.hpp"
+#include "../binding/configuration.hpp"
 
 #define ERROR_PID 0xFF
 
@@ -52,17 +52,36 @@ active_diagnostic_request_t& active_diagnostic_request_t::operator=(const active
 }
 
 active_diagnostic_request_t::active_diagnostic_request_t()
-       : bus_{nullptr}, id_{0}, handle_{nullptr}, name_{""},
-         decoder_{nullptr}, callback_{nullptr}, recurring_{false}, wait_for_multiple_responses_{false},
-         in_flight_{false}, frequency_clock_{frequency_clock_t()}, timeout_clock_{frequency_clock_t()}
+       : bus_{nullptr},
+         id_{0},
+         handle_{nullptr},
+         name_{""},
+         decoder_{nullptr},
+         callback_{nullptr},
+         recurring_{false},
+         wait_for_multiple_responses_{false},
+         in_flight_{false},
+         frequency_clock_{frequency_clock_t()},
+         timeout_clock_{frequency_clock_t()}
 {}
 
 active_diagnostic_request_t::active_diagnostic_request_t(const std::string& bus, DiagnosticRequest* request,
-               const std::string& name, bool wait_for_multiple_responses, const DiagnosticResponseDecoder decoder,
-               const DiagnosticResponseCallback callback, float frequencyHz)
-       : bus_{bus}, id_{request->arbitration_id}, handle_{nullptr}, name_{name},
-         decoder_{decoder}, callback_{callback}, recurring_{frequencyHz ? true : false}, wait_for_multiple_responses_{wait_for_multiple_responses},
-         in_flight_{false}, frequency_clock_{frequency_clock_t(frequencyHz)}, timeout_clock_{frequency_clock_t(10)}
+               const std::string& name,
+               bool wait_for_multiple_responses,
+               const DiagnosticResponseDecoder decoder,
+               const DiagnosticResponseCallback callback,
+               float frequencyHz)
+       : bus_{bus},
+         id_{request->arbitration_id},
+         handle_{nullptr},
+         name_{name},
+         decoder_{decoder},
+         callback_{callback},
+         recurring_{frequencyHz ? true : false},
+         wait_for_multiple_responses_{wait_for_multiple_responses},
+         in_flight_{false},
+         frequency_clock_{frequency_clock_t(frequencyHz)},
+         timeout_clock_{frequency_clock_t(10)}
 {}
 
 uint32_t active_diagnostic_request_t::get_id() const
@@ -127,6 +146,11 @@ frequency_clock_t& active_diagnostic_request_t::get_timeout_clock()
        return timeout_clock_;
 }
 
+utils::socketcan_bcm_t& active_diagnostic_request_t::get_socket()
+{
+       return socket_;
+}
+
 void active_diagnostic_request_t::set_handle(DiagnosticShims& shims, DiagnosticRequest* request)
 {
        handle_ = new DiagnosticRequestHandle(generate_diagnostic_request(&shims, request, nullptr));