X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Fdiagnostic%2Fdiagnostic-manager.hpp;h=c0a8255e15b1587de2326284700bd5491ffaa988;hb=db13354c18e888d04b776e584addb668d8614da4;hp=1a6ae7e54bcf8354fae8a8e472d9bb993653dc41;hpb=d42b7240d7cbd8a36b5adfd9a5726302b37a0b0f;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/diagnostic/diagnostic-manager.hpp b/low-can-binding/diagnostic/diagnostic-manager.hpp index 1a6ae7e5..c0a8255e 100644 --- a/low-can-binding/diagnostic/diagnostic-manager.hpp +++ b/low-can-binding/diagnostic/diagnostic-manager.hpp @@ -27,15 +27,13 @@ #include "../can/can-bus.hpp" #include "active-diagnostic-request.hpp" -/// Each CAN bus needs its own set of shim functions, so this should +/// Each CAN bus requires its own set of shim functions, so this should /// match the maximum CAN controller count. /// #define DIAGNOSTIC_RESPONSE_ARBITRATION_ID_OFFSET 0x8 -class active_diagnostic_request_t; - /// -/// @brief The core structure for running the diagnostics module by 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,12 +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, ...); - static void shims_timer(); + 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; @@ -75,17 +73,17 @@ public: active_diagnostic_request_t* find_recurring_request(DiagnosticRequest& request); // Subscription parts - active_diagnostic_request_t* add_request(DiagnosticRequest* request, const std::string& name, + /*active_diagnostic_request_t* add_request(DiagnosticRequest* request, const std::string& name, bool waitForMultipleResponses, const DiagnosticResponseDecoder decoder, - const DiagnosticResponseCallback callback); + const DiagnosticResponseCallback callback);*/ bool validate_optional_request_attributes(float frequencyHz); active_diagnostic_request_t* add_recurring_request(DiagnosticRequest* request, const char* name, bool waitForMultipleResponses, const DiagnosticResponseDecoder decoder, - const DiagnosticResponseCallback callback, float frequencyHz); + const DiagnosticResponseCallback callback, float frequencyHz, bool permanent); // Decoding part - openxc_VehicleMessage relay_diagnostic_response(active_diagnostic_request_t* adr, const DiagnosticResponse& response); - 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_response(active_diagnostic_request_t* adr, const DiagnosticResponse& response, const uint64_t timestamp); + openxc_VehicleMessage relay_diagnostic_handle(active_diagnostic_request_t* entry, std::shared_ptr m); + openxc_VehicleMessage find_and_decode_adr(std::shared_ptr m); + bool is_diagnostic_response(std::shared_ptr m); };