diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-08 09:44:53 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-16 17:10:39 +0100 |
commit | c01da10d067038794eb845735e2a7959744ca2b3 (patch) | |
tree | cbaa9ff7fa7338c96ebd5d2f0766872df5963283 /src/configuration.hpp | |
parent | 9519e9d5b875b45fbf6f32267b728b1d11377276 (diff) |
Added a warning that it is an example code
Change-Id: Ib66e49960a348896020fba56f7d98910623af83f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
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(); } |