From 3addbcc4f55657f45be76be9f0f736a68e75ea04 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Sun, 8 Dec 2019 10:55:57 +0100 Subject: [PATCH] message: Default frame layout as little endian. Change the flags to be enable if frame use big endian rather than little Change-Id: I09ae9c54f1d807da4e740457cf04a001723edb0e Signed-off-by: Romain Forlot --- low-can-binding/can/can-decoder.cpp | 2 +- low-can-binding/can/message-definition.cpp | 4 ++-- low-can-binding/can/message-definition.hpp | 2 +- low-can-binding/can/message/message.hpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/low-can-binding/can/can-decoder.cpp b/low-can-binding/can/can-decoder.cpp index 0e64cccd..4a3f87f4 100644 --- a/low-can-binding/can/can-decoder.cpp +++ b/low-can-binding/can/can-decoder.cpp @@ -99,7 +99,7 @@ float decoder_t::parse_signal_bitfield(signal_t& signal, std::shared_ptrframe_layout_is_little()) + if(signal.get_message()->frame_layout_is_bigendian()) { bit_position = converter_t::bit_position_swap(message->get_length(), signal.get_bit_position(), diff --git a/low-can-binding/can/message-definition.cpp b/low-can-binding/can/message-definition.cpp index 5935f726..6989a909 100644 --- a/low-can-binding/can/message-definition.cpp +++ b/low-can-binding/can/message-definition.cpp @@ -111,6 +111,6 @@ uint32_t message_definition_t::get_flags() const return flags_; } -bool message_definition_t::frame_layout_is_little() const{ - return (flags_ & FRAME_LAYOUT_IS_LE); +bool message_definition_t::frame_layout_is_bigendian() const{ + return (flags_ & FRAME_LAYOUT_IS_BIGENDIAN); } diff --git a/low-can-binding/can/message-definition.hpp b/low-can-binding/can/message-definition.hpp index b0866d39..e73560f7 100644 --- a/low-can-binding/can/message-definition.hpp +++ b/low-can-binding/can/message-definition.hpp @@ -87,7 +87,7 @@ public: vect_ptr_signal_t& get_signals(); uint32_t get_length() const; uint32_t get_flags() const; - bool frame_layout_is_little() const; + bool frame_layout_is_bigendian() const; void set_parent(std::shared_ptr parent); void set_last_value(std::shared_ptr m); diff --git a/low-can-binding/can/message/message.hpp b/low-can-binding/can/message/message.hpp index e5e6769b..cc478c33 100644 --- a/low-can-binding/can/message/message.hpp +++ b/low-can-binding/can/message/message.hpp @@ -44,7 +44,7 @@ #define ISOTP_SEND 0x0020 #define ISOTP_RECEIVE 0x0040 #define CAN_PROTOCOL_WITH_FD_FRAME 0x0080 -#define FRAME_LAYOUT_IS_LE 0x0100 // LE stand for Little Endian +#define FRAME_LAYOUT_IS_BIGENDIAN 0x0100 // LE stand for Little Endian /// @class message_t /// -- 2.16.6