diff options
Diffstat (limited to 'src/configuration.hpp')
-rw-r--r-- | src/configuration.hpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/configuration.hpp b/src/configuration.hpp index 2fd59e5f..f20ad505 100644 --- a/src/configuration.hpp +++ b/src/configuration.hpp @@ -15,12 +15,17 @@ * limitations under the License. */ +#pragma once + #include <vector> #include "can/can-bus.hpp" #include "can/can-signals.hpp" +#include "can/can-message.hpp" #include "obd2/diagnostic-manager.hpp" +#include "low-can-binding.hpp" + /** * @brief Class representing a configuration attached to the binding. * @@ -32,18 +37,15 @@ * * It will be the reference point to needed objects. */ - -#include "low-can-binding.hpp" - class configuration_t { private: - can_bus_t can_bus_manager_(afb_daemon_rootdir_open_locale(binder_interface->daemon, "can_buses.json", O_RDONLY, NULL)); + can_bus_t can_bus_manager_ = can_bus_t(afb_daemon_rootdir_open_locale(binder_interface->daemon, "can_buses.json", O_RDONLY, NULL)); diagnostic_manager_t diagnostic_manager_; uint8_t active_message_set_ = 0; public: - const std::vector<obd2_signals_t> obd2_signals_; + const std::vector<obd2_signal_t> obd2_signals_; const std::vector<can_message_set_t> can_message_set_; const std::vector<std::vector<can_signal_t>> can_signals_; const std::vector<std::vector<can_message_definition_t>> can_message_definition_; @@ -88,17 +90,17 @@ class configuration_t return can_message_definition_[active_message_set_]; } - std::vector<obd2_signals_t>& get_obd2_signals() + std::vector<obd2_signal_t>& get_obd2_signals() { return obd2_signals_; } - std::vector<obd2_signals_t>& get_obd2_signals() + std::vector<obd2_signal_t>& get_obd2_signals() { return OBD2_PIDS; } - uint32_t get_signal_id(obd2_signals_t& sig) + uint32_t get_signal_id(obd2_signal_t& sig) { return sig.get_pid(); } |