From d4c6484ca4f8d9eb8f97d7e0555e461f2831baa3 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 27 Feb 2017 23:17:43 +0100 Subject: Fix: start reading the can bus if it was correctly opened. Change-Id: If285791aee51d4a57e17270e8ac458cb6869f970 Signed-off-by: Romain Forlot --- src/can-utils.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/can-utils.cpp') diff --git a/src/can-utils.cpp b/src/can-utils.cpp index b6fbf894..47375443 100644 --- a/src/can-utils.cpp +++ b/src/can-utils.cpp @@ -207,10 +207,12 @@ int can_bus_t::init_can_dev() { can_bus_dev_t can_bus_device_handler(device); if (can_bus_device_handler.open()) + { i++; + can_bus_device_handler.start_reading(std::ref(*this)); + } else ERROR(binder_interface, "Can't open device %s", device); - can_bus_device_handler.start_reading(std::ref(*this)); } NOTICE(binder_interface, "Initialized %d/%d can bus device(s)", i, t); @@ -249,7 +251,7 @@ std::vector can_bus_t::read_conf() { taxi = json_object_get_string(canbus); DEBUG(binder_interface, "Can bus found: %s", taxi); - ret.push_back(taxi); + ret.push_back(std::string(taxi)); } else { -- cgit 1.2.3-korg