summaryrefslogtreecommitdiffstats
path: root/low-can-binding
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-07-10 19:02:37 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-07-10 19:02:37 +0200
commite75bc1833664ec34852d38a46e133334c19ac58c (patch)
tree44c63e27cd4e6836a1a5fc603412256e8696fdc3 /low-can-binding
parent308f83956a9900eabe9daa8b27502ec307ff6147 (diff)
Different errors between no file and wrong content
Change-Id: Ic705e09811b3479af8dc2287c53fa53fdcdff656 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding')
-rw-r--r--low-can-binding/can/can-bus.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/low-can-binding/can/can-bus.cpp b/low-can-binding/can/can-bus.cpp
index 1b0e186d..71e78495 100644
--- a/low-can-binding/can/can-bus.cpp
+++ b/low-can-binding/can/can-bus.cpp
@@ -295,12 +295,15 @@ void can_bus_t::push_new_vehicle_message(int subscription_id, const openxc_Vehic
/// mapping configuration file read at initialization.
void can_bus_t::set_can_devices()
{
- can_devices_ = conf_file_.get_devices_name();
-
- if(can_devices_.empty())
+ if(conf_file_.check_conf())
{
- AFB_ERROR("No mapping found in config file: '%s'. Check it that it have a CANbus-mapping section.",
- conf_file_.filepath().c_str());
+ can_devices_ = conf_file_.get_devices_name();
+
+ if(can_devices_.empty())
+ {
+ AFB_ERROR("No mapping found in config file: '%s'. Check it that it have a CANbus-mapping section.",
+ conf_file_.filepath().c_str());
+ }
}
}