Fix: wrong location to make the increment because we use
authorRomain Forlot <romain.forlot@iot.bzh>
Sun, 12 Mar 2017 22:26:25 +0000 (23:26 +0100)
committerRomain Forlot <romain.forlot@iot.bzh>
Thu, 16 Mar 2017 16:10:41 +0000 (17:10 +0100)
the device after so... This was total crap !

Change-Id: I9bb43c3f75c613a5927f342b3c574871c0eb65bb
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
src/can/can-bus.cpp

index 8edf5ba..d2b51bf 100644 (file)
@@ -189,13 +189,13 @@ int can_bus_t::init_can_dev()
                        can_devices_.push_back(std::make_shared<can_bus_dev_t>(device, i));
                        if (can_devices_[i]->open() == 0)
                        {
-                               i++;
                                DEBUG(binder_interface, "Start reading thread");
                                NOTICE(binder_interface, "%s device opened and reading", device.c_str());
                                can_devices_[i]->start_reading(*this);
                        }
                        else
                                ERROR(binder_interface, "Can't open device %s", device.c_str());
+                       i++;
                }
 
                NOTICE(binder_interface, "Initialized %d/%d can bus device(s)", i, t);