diff options
Diffstat (limited to 'src/diagnostic/diagnostic-manager.hpp')
-rw-r--r-- | src/diagnostic/diagnostic-manager.hpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/diagnostic/diagnostic-manager.hpp b/src/diagnostic/diagnostic-manager.hpp index 8602db86..39aae321 100644 --- a/src/diagnostic/diagnostic-manager.hpp +++ b/src/diagnostic/diagnostic-manager.hpp @@ -49,7 +49,7 @@ protected: private: DiagnosticShims shims_; /*!< shims_ - An array of shim functions for each CAN bus that plug the diagnostics * library (uds-c) into the VI's CAN peripheral.*/ - can_bus_dev_t* bus_; /*!< bus_ - A pointer to the CAN bus that should be used for all standard OBD-II requests, if the bus is not + std::shared_ptr<can_bus_dev_t> bus_; /*!< bus_ - A pointer to the CAN bus that should be used for all standard OBD-II requests, if the bus is not * explicitly spcified in the request. If NULL, all requests require an explicit bus.*/ std::vector<active_diagnostic_request_t*> recurring_requests_; /*!< recurringRequests - A queue of active, recurring diagnostic requests. When * a response is received for a recurring request or it times out, it is @@ -64,14 +64,16 @@ private: bool initialized_; /*!< * initialized - True if the DiagnosticsManager has been initialized with shims. It will interface with the uds-c lib*/ + void init_diagnostic_shims(); + void reset(); public: diagnostic_manager_t(); - diagnostic_manager_t(can_bus_dev_t& bus); - void init_diagnostic_shims(); + bool initialize(std::shared_ptr<can_bus_dev_t> cbd); - can_bus_dev_t* get_can_bus_dev(); + std::shared_ptr<can_bus_dev_t> get_can_bus_dev(); active_diagnostic_request_t* get_free_entry(); + DiagnosticShims& get_shims(); 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); @@ -81,7 +83,6 @@ public: bool validate_optional_request_attributes(float frequencyHz); - void reset(); void checkSupportedPids(const active_diagnostic_request_t& request, const DiagnosticResponse& response, float parsedPayload); |