diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-02-27 23:17:43 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-02-28 21:45:49 +0100 |
commit | d4c6484ca4f8d9eb8f97d7e0555e461f2831baa3 (patch) | |
tree | c36a1d8c575306ebfc3aa86b5c7dc3df808fe623 /src/can-utils.cpp | |
parent | 63101e73ec21aeca93ba4ed0e2c7eba77bd52210 (diff) |
Fix: start reading the can bus if it was correctly
opened.
Change-Id: If285791aee51d4a57e17270e8ac458cb6869f970
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can-utils.cpp')
-rw-r--r-- | src/can-utils.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<std::string> 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 { |