Fix wrong filter condition (Thanks Parai Wang)
authorRomain Forlot <romain.forlot@iot.bzh>
Wed, 8 Nov 2017 08:09:46 +0000 (09:09 +0100)
committerRomain Forlot <romain.forlot@iot.bzh>
Wed, 8 Nov 2017 09:00:14 +0000 (10:00 +0100)
Change-Id: I7d3eccc2d4b99d543b669c7b3c8d7a38670d860f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
low-can-binding/can/can-bus.cpp

index 1b0e186..46c2788 100644 (file)
@@ -56,7 +56,7 @@ bool can_bus_t::apply_filter(const openxc_VehicleMessage& vehicle_message, std::
                float min = std::isnan(can_subscription->get_min()) ? -INFINITY : can_subscription->get_min();
                float max = std::isnan(can_subscription->get_max()) ? INFINITY : can_subscription->get_max();
                double value = get_numerical_from_DynamicField(vehicle_message);
-               send = (value < min && value > max) ? false : true;
+               send = (value < min || value > max) ? false : true;
        }
        return send;
 }