From 5b91b2101f4fb83f622a360b4ab42bdb2bfb4e3f Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 28 Feb 2017 16:06:15 +0100 Subject: Added debugging messages. Change-Id: I42d2576355f69ac167b170a2994c7360d8449fb7 Signed-off-by: Romain Forlot --- src/can-bus.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/can-bus.cpp b/src/can-bus.cpp index 84cbaaa..f4a6d55 100644 --- a/src/can-bus.cpp +++ b/src/can-bus.cpp @@ -18,6 +18,7 @@ #include "can-bus.hpp" #include +#include #include #include #include @@ -28,6 +29,9 @@ #include #include +#include "can-decoder.hpp" +#include "openxc-utils.hpp" + extern "C" { #include @@ -164,13 +168,14 @@ int can_bus_t::init_can_dev() for(const auto& device : devices_name) { can_bus_dev_t can_bus_device_handler(device); - if (can_bus_device_handler.open()) + if (can_bus_device_handler.open() == 0) { i++; + DEBUG(binder_interface, "Start reading thread"); can_bus_device_handler.start_reading(std::ref(*this)); } else - ERROR(binder_interface, "Can't open device %s", device); + ERROR(binder_interface, "Can't open device %s", device.c_str()); } NOTICE(binder_interface, "Initialized %d/%d can bus device(s)", i, t); @@ -197,7 +202,7 @@ std::vector can_bus_t::read_conf() std::fread(&fd_conf_content[0], 1, fd_conf_content.size(), fd); std::fclose(fd); - DEBUG(binder_interface, "Conf file content : %s", fd_conf_content.c_str()); + DEBUG(binder_interface, "Configuration file content : %s", fd_conf_content.c_str()); jo = json_tokener_parse(fd_conf_content.c_str()); if (jo == NULL || !json_object_object_get_ex(jo, "canbus", &canbus)) -- cgit 1.2.3-korg