From 63101e73ec21aeca93ba4ed0e2c7eba77bd52210 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 27 Feb 2017 23:03:55 +0100 Subject: Added some DEBUG log messages around reading conf file Change-Id: Iec52801df6ce0c47c24412ac46332c301d5c46d6 Signed-off-by: Romain Forlot --- src/can-utils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/can-utils.cpp') diff --git a/src/can-utils.cpp b/src/can-utils.cpp index 977d344..b6fbf89 100644 --- a/src/can-utils.cpp +++ b/src/can-utils.cpp @@ -225,6 +225,7 @@ std::vector can_bus_t::read_conf() std::vector 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 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 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); -- cgit 1.2.3-korg