diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-04-26 00:21:07 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-04-27 01:03:34 +0200 |
commit | 72f7ebbc61f36d6140114b3b9e403635cbe8baba (patch) | |
tree | 0a79ed91a93305c198ecd3d253ffad6e23b1c0cc | |
parent | e00c07be2835dd082862730189c87baacbfbdbeb (diff) |
Subscribe using BCM RX_SETUP filter capabilities implemented.
Change-Id: I7462b5d0144987293376dab719d1cf4fa41406f2
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r-- | CAN-binder/low-can-binding/low-can-binding.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
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<std::string> parse_signals_from_request(struct afb_req request, bool subscribe) +static const std::vector<std::string> parse_args_from_request(struct afb_req request, bool subscribe) { int i, n; std::vector<std::string> ret; |