aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-11-21 13:44:24 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2020-01-09 15:55:03 +0100
commit52b04b1c1022b50f9d23692bef6c61b3fdcc1ae0 (patch)
tree99d012e19e72e13b7ac4f5463fe1a7c2bb926291 /low-can-binding
parentfae627b646e9ab709adbd0c60d7582176375e0c3 (diff)
low-can-hat: improve format
Weird way test to make test are now fixed to be more readable. Bug-AGL: SPEC-2988 Change-Id: I81d716ac3799c4217e720a13d8ba78a46996a2c3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding')
-rw-r--r--low-can-binding/binding/low-can-hat.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/low-can-binding/binding/low-can-hat.cpp b/low-can-binding/binding/low-can-hat.cpp
index 26795f40..5a268745 100644
--- a/low-can-binding/binding/low-can-hat.cpp
+++ b/low-can-binding/binding/low-can-hat.cpp
@@ -66,12 +66,12 @@ int read_message(sd_event_source *event_source, int fd, uint32_t revents, void *
if(can_subscription->get_index() != -1)
{
std::shared_ptr<utils::socketcan_t> s = can_subscription->get_socket();
- if(s->socket() && s->socket() != -1)
+ if(s->socket() > 0)
{
std::shared_ptr<message_t> message = s->read_message();
// Sure we got a valid CAN message ?
- if (! message->get_id() == 0 && ! message->get_length() == 0 && message->get_flags() & INVALID_FLAG)
+ if (message->get_id() && message->get_length() && !(message->get_flags() & INVALID_FLAG))
push_n_notify(message);
}
}