aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding/binding
diff options
context:
space:
mode:
authorArthur Guyader <arthur.guyader@iot.bzh>2019-12-16 19:19:50 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2020-01-09 16:25:36 +0100
commit744d95cffe1241c97d922b18f6e3723fff7d64fe (patch)
tree8210c375afd511af637956fab5a6f7eafaf5a2ce /low-can-binding/binding
parente28ae5f481c3a0d78bb7d6c21416dc38be541a4d (diff)
can_decoder : Move frame swap to only do it one time
This commit allows to swap only one time a data message. Change-Id: I566c6ad72e266cd59a4397ab1a5ef423d752cf75 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/binding')
-rw-r--r--low-can-binding/binding/low-can-hat.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/low-can-binding/binding/low-can-hat.cpp b/low-can-binding/binding/low-can-hat.cpp
index 7e0d94a4..72580744 100644
--- a/low-can-binding/binding/low-can-hat.cpp
+++ b/low-can-binding/binding/low-can-hat.cpp
@@ -74,7 +74,11 @@ int read_message(sd_event_source *event_source, int fd, uint32_t revents, void *
if (message->get_id() &&
message->get_length() &&
! (message->get_flags() & INVALID_FLAG) )
+ {
+ if(can_subscription->get_signal() != nullptr && can_subscription->get_signal()->get_message()->get_flags() & BYTE_FRAME_IS_BIG_ENDIAN)
+ message->frame_swap();
push_n_notify(message);
+ }
}
}
}