summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-02-28 16:06:15 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-02-28 21:45:49 +0100
commit5b91b2101f4fb83f622a360b4ab42bdb2bfb4e3f (patch)
tree32efb649dbe1dda80c9bd972e345bcb6b77efbab /src
parent2e93fc880e497ac553111ba27f2de4b44ea94027 (diff)
Added debugging messages.
Change-Id: I42d2576355f69ac167b170a2994c7360d8449fb7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src')
-rw-r--r--src/can-bus.cpp11
1 files 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 <map>
+#include <cerrno>
#include <vector>
#include <string>
#include <fcntl.h>
@@ -28,6 +29,9 @@
#include <json-c/json.h>
#include <linux/can/raw.h>
+#include "can-decoder.hpp"
+#include "openxc-utils.hpp"
+
extern "C"
{
#include <afb/afb-binding.h>
@@ -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<std::string> 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))