diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-03-02 11:51:42 +0100 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-03-15 17:40:45 +0100 |
commit | 2debfc561d3ad517ad0c82ebd18cba8ec78ab6ce (patch) | |
tree | 7d0235e2aa8e9d43f45516326045b22d3a0df54e /low-can-binding/can/can-bus.cpp | |
parent | 4becc6d7986cf656f10f02ecdd5202b5b0fdddf1 (diff) |
Change subscribed signals search to check filters as well
When a new subscription is made, search in existing subscription for a
combination of a signal and a filter instead of searching for just a signal.
In this way, each subscription will receive signals according to
their requesting filter.
Bug-AGL: SPEC-1339
Change-Id: I22cb96a2dbaaf48dbd77025ff1610bde151b19b4
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'low-can-binding/can/can-bus.cpp')
-rw-r--r-- | low-can-binding/can/can-bus.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/low-can-binding/can/can-bus.cpp b/low-can-binding/can/can-bus.cpp index 9a98547b..377728a4 100644 --- a/low-can-binding/can/can-bus.cpp +++ b/low-can-binding/can/can-bus.cpp @@ -53,8 +53,8 @@ bool can_bus_t::apply_filter(const openxc_VehicleMessage& vehicle_message, std:: bool send = false; if(is_valid(vehicle_message)) { - 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(); + float min = can_subscription->get_min(); + float max = can_subscription->get_max(); double value = get_numerical_from_DynamicField(vehicle_message); send = (value < min || value > max) ? false : true; } |