From 72f7ebbc61f36d6140114b3b9e403635cbe8baba Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 26 Apr 2017 00:21:07 +0200 Subject: Subscribe using BCM RX_SETUP filter capabilities implemented. Change-Id: I7462b5d0144987293376dab719d1cf4fa41406f2 Signed-off-by: Romain Forlot --- CAN-binder/low-can-binding/low-can-binding.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'CAN-binder') diff --git a/CAN-binder/low-can-binding/low-can-binding.cpp b/CAN-binder/low-can-binding/low-can-binding.cpp index 088b76fb..e6af92cc 100644 --- a/CAN-binder/low-can-binding/low-can-binding.cpp +++ b/CAN-binder/low-can-binding/low-can-binding.cpp @@ -172,16 +172,18 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe, for(const auto& sig: signals.can_signals) { - ret = subscribe_unsubscribe_signal(request, subscribe, sig->get_name()); - if(ret <= 0) - return ret; - rets++; - DEBUG(binder_interface, "%s: signal: %s subscribed", __FUNCTION__, sig->get_name().c_str()); + if(conf.get_can_bus_manager().create_rx_filter(*sig) <= 0 && + subscribe_unsubscribe_signal(request, subscribe, sig->get_name()) <= 0) + { + return -1; + rets++; + DEBUG(binder_interface, "%s: signal: %s subscribed", __FUNCTION__, sig->get_name().c_str()); + } } return rets; } -static const std::vector parse_signals_from_request(struct afb_req request, bool subscribe) +static const std::vector parse_args_from_request(struct afb_req request, bool subscribe) { int i, n; std::vector ret; -- cgit 1.2.3-korg