diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-07 15:42:21 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-07 15:42:21 +0200 |
commit | 995fc3b8b8e51f0adfa2dac06286ede84f05a43a (patch) | |
tree | 953cfd6052abf58196f67baf72e73d944f1300fe | |
parent | 290b13d6182a9e682292819fb13e2ed3d0b607da (diff) |
Fix: read 2 times for 1 incoming CAN frame.
Change-Id: I7be7b5e704b3cb081e1dbd73a6ba7f88a2bbc62f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r-- | CAN-binder/low-can-binding/binding/low-can-cb.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/CAN-binder/low-can-binding/binding/low-can-cb.cpp b/CAN-binder/low-can-binding/binding/low-can-cb.cpp index fbe6e19..bc94eed 100644 --- a/CAN-binder/low-can-binding/binding/low-can-cb.cpp +++ b/CAN-binder/low-can-binding/binding/low-can-cb.cpp @@ -242,13 +242,13 @@ static int subscribe_unsubscribe_can_signals(struct afb_req request, bool subscr can_subscription = std::make_shared<low_can_subscription_t>(low_can_subscription_t(event_filter)); if(can_subscription->create_rx_filter(sig) < 0) {return -1;} + if(add_to_event_loop(can_subscription) < 0) + {return -1;} } if(subscribe_unsubscribe_signal(request, subscribe, can_subscription, s) < 0) {return -1;} - if(add_to_event_loop(can_subscription) < 0) - {return -1;} rets++; DEBUG(binder_interface, "%s: signal: %s subscribed", __FUNCTION__, sig->get_name().c_str()); } |