From: Romain Forlot Date: Fri, 2 Jun 2017 00:02:20 +0000 (+0200) Subject: Change way to validate a subscription object X-Git-Tag: Renesas_delivery_Q2~40 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=15dc4de14234c4679e178c0360b20b12b4ff6424;p=apps%2Flow-level-can-service.git Change way to validate a subscription object Better to check validity of 2 differents type of signals used and checks that its event is valid. Change-Id: I1435bbe81a43fd80eae049d43b5e37fc8f893074 Signed-off-by: Romain Forlot --- 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 9a0c501..edda209 100644 --- a/CAN-binder/low-can-binding/binding/low-can-cb.cpp +++ b/CAN-binder/low-can-binding/binding/low-can-cb.cpp @@ -79,7 +79,7 @@ low_can_subscription_t::low_can_subscription_t( low_can_subscription_t&& s) low_can_subscription_t::operator bool() const { - return socket_.socket() != INVALID_SOCKET; + return ((can_signal_ != nullptr || diagnostic_message_ != nullptr) && afb_event_is_valid(event_)); } struct afb_event& low_can_subscription_t::get_event()