binding: add preinit function to load the config
[apps/agl-service-can-low-level.git] / low-can-binding / diagnostic / diagnostic-manager.hpp
index 26c869e..c0a8255 100644 (file)
 ///
 #define DIAGNOSTIC_RESPONSE_ARBITRATION_ID_OFFSET 0x8
 
-class active_diagnostic_request_t;
-
 ///
-/// @brief The core structure for running the diagnostics module of the binding.
+/// @brief The binding structure for running the diagnostics module of the binding.
 ///
 /// This stores details about the active requests and shims required to connect
 /// the diagnostics library to the CAN device.
@@ -56,11 +54,12 @@ private:
 
        static bool shims_send(const uint32_t arbitration_id, const uint8_t* data, const uint8_t size);
        static void shims_logger(const char* m, ...);
+
 public:
        diagnostic_manager_t();
        ~diagnostic_manager_t();
 
-       bool initialize();
+       bool initialize(std::string diagnostic_bus);
 
        const std::string get_bus_name() const;
        const std::string get_bus_device_name() const;
@@ -84,7 +83,7 @@ public:
 
        // Decoding part
        openxc_VehicleMessage relay_diagnostic_response(active_diagnostic_request_t* adr, const DiagnosticResponse& response, const uint64_t timestamp);
-       openxc_VehicleMessage relay_diagnostic_handle(active_diagnostic_request_t* entry, const can_message_t& cm);
-       openxc_VehicleMessage find_and_decode_adr(const can_message_t& cm);
-       bool is_diagnostic_response(const can_message_t& cm);
+       openxc_VehicleMessage relay_diagnostic_handle(active_diagnostic_request_t* entry, std::shared_ptr<message_t> m);
+       openxc_VehicleMessage find_and_decode_adr(std::shared_ptr<message_t> m);
+       bool is_diagnostic_response(std::shared_ptr<message_t> m);
 };