aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-06-02 02:02:20 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-06-02 02:02:20 +0200
commit15dc4de14234c4679e178c0360b20b12b4ff6424 (patch)
treef869c55031036440c54023a7e3ced631ff520501
parentdf18aac9d59e36b13aca54036af58ca953eb103d (diff)
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 <romain.forlot@iot.bzh>
-rw-r--r--CAN-binder/low-can-binding/binding/low-can-cb.cpp2
1 files changed, 1 insertions, 1 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 9a0c501e..edda2097 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()