diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-04-26 15:46:49 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-04-27 01:03:34 +0200 |
commit | 55a206228d575484e97a231c95a9944eb27a2601 (patch) | |
tree | 5f8bd6b3d31980f615807312f526cb4473d9c690 /CAN-binder/low-can-binding/low-can-binding.cpp | |
parent | f741d262ecd237121cc8cceb0f0893daa70bdf32 (diff) |
Fix: correctly count (un)subscribed signals.
Can't be 0 subscription so success if greater than 0
Change-Id: Ie4395dbabe4ed85fe939ebdfa9de87e210fa55bc
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/low-can-binding.cpp')
-rw-r--r-- | CAN-binder/low-can-binding/low-can-binding.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/CAN-binder/low-can-binding/low-can-binding.cpp b/CAN-binder/low-can-binding/low-can-binding.cpp index e6af92cc..484bb5c7 100644 --- a/CAN-binder/low-can-binding/low-can-binding.cpp +++ b/CAN-binder/low-can-binding/low-can-binding.cpp @@ -173,12 +173,12 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe, for(const auto& sig: signals.can_signals) { if(conf.get_can_bus_manager().create_rx_filter(*sig) <= 0 && - subscribe_unsubscribe_signal(request, subscribe, sig->get_name()) <= 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()); } + rets++; + DEBUG(binder_interface, "%s: signal: %s subscribed", __FUNCTION__, sig->get_name().c_str()); } return rets; } @@ -236,7 +236,7 @@ extern "C" } NOTICE(binder_interface, "%s: Subscribed/unsubscribe correctly to %d/%d signal(s).", __FUNCTION__, ok, total); - if (ok) + if (ok > 0) afb_req_success(request, NULL, NULL); else afb_req_fail(request, "error", NULL); |