aboutsummaryrefslogtreecommitdiffstats
path: root/src/can-utils.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-02-27 23:03:55 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-02-27 23:03:55 +0100
commit63101e73ec21aeca93ba4ed0e2c7eba77bd52210 (patch)
tree6d042d2a3d86532b1116d7f9335394aa53e9ce5c /src/can-utils.cpp
parent956c083a7f0622438bbbbf47b05355f812fb1de6 (diff)
Added some DEBUG log messages around reading conf
file Change-Id: Iec52801df6ce0c47c24412ac46332c301d5c46d6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can-utils.cpp')
-rw-r--r--src/can-utils.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/can-utils.cpp b/src/can-utils.cpp
index 977d344c..b6fbf894 100644
--- a/src/can-utils.cpp
+++ b/src/can-utils.cpp
@@ -225,6 +225,7 @@ std::vector<std::string> can_bus_t::read_conf()
std::vector<std::string> ret;
json_object *jo, *canbus;
int n, i;
+ const char* taxi;
FILE *fd = fdopen(conf_file_, "r");
if (fd)
@@ -236,6 +237,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());
jo = json_tokener_parse(fd_conf_content.c_str());
if (jo == NULL || !json_object_object_get_ex(jo, "canbus", &canbus))
@@ -244,7 +246,11 @@ std::vector<std::string> can_bus_t::read_conf()
ret.clear();
}
else if (json_object_get_type(canbus) != json_type_array)
- ret.push_back(json_object_get_string(canbus));
+ {
+ taxi = json_object_get_string(canbus);
+ DEBUG(binder_interface, "Can bus found: %s", taxi);
+ ret.push_back(taxi);
+ }
else
{
n = json_object_array_length(canbus);