From 44d7237fde80af222939445055a94a0e50e82935 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 18 Apr 2017 20:23:14 +0200 Subject: Use a system INI configuration file to get devices mapping Instead of specifying a JSON configuration file with CAN devices name, it uses a mapping configuration file that map a high level device names to a real low level names. File path is to be specified into the generated source code which is /etc/dev-mapping.conf for now. Configuration file uses INI file format and is parsed using inih library cpp wrapper. Change-Id: Ibde104e76cd78a6cc86f6eec4f66c274b7567d43 Signed-off-by: Romain Forlot --- CAN-binder/low-can-binding/can/can-bus.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'CAN-binder/low-can-binding/can/can-bus.hpp') diff --git a/CAN-binder/low-can-binding/can/can-bus.hpp b/CAN-binder/low-can-binding/can/can-bus.hpp index eb47476..5715c74 100644 --- a/CAN-binder/low-can-binding/can/can-bus.hpp +++ b/CAN-binder/low-can-binding/can/can-bus.hpp @@ -27,6 +27,7 @@ #include "openxc.pb.h" #include "can-message.hpp" #include "can-bus-dev.hpp" +#include "../utils/config-parser.hpp" #include "../diagnostic/active-diagnostic-request.hpp" #include "../low-can-binding.hpp" @@ -48,7 +49,7 @@ class can_bus_t { private: - int conf_file_; ///< configuration file handle used to initialize can_bus_dev_t objects. + utils::config_parser_t& conf_file_; ///< configuration file handle used to initialize can_bus_dev_t objects. void can_decode_message(); std::thread th_decoding_; ///< thread that'll handle decoding a can frame @@ -69,7 +70,7 @@ private: static std::map> can_devices_; ///< Can device map containing all can_bus_dev_t objects initialized during init_can_dev function public: - can_bus_t(int conf_file); + can_bus_t(utils::config_parser_t conf_file); can_bus_t(can_bus_t&&); int init_can_dev(); -- cgit 1.2.3-korg