From 03a4775eefeeba913f69d331e3930700a567c4c5 Mon Sep 17 00:00:00 2001 From: Corentin Le Gall Date: Thu, 14 Nov 2019 19:13:25 +0100 Subject: can: Add big endian CAN frame layout handle - can-decoder.cpp: translate_signal() : Tests "frame_layout_is_little". If false the signal's bit position is changed to fit the layout. - message-definition.cpp: Added the new attribute "frame_layout_is_little" and its getter. - signals.cpp: Added a setter to the bit_position attribute. - converter.cpp: Added a methode to convert a big endian bit_position to a right (little endian) bit_position. Bug-AGL: SPEC-2988 Change-Id: I004c9069eb00f389564927cd12d1b30470c3a59d Signed-off-by: Corentin Le Gall Signed-off-by: Romain Forlot --- low-can-binding/can/message-definition.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'low-can-binding/can/message-definition.hpp') diff --git a/low-can-binding/can/message-definition.hpp b/low-can-binding/can/message-definition.hpp index ca264b7e..9d615ff0 100644 --- a/low-can-binding/can/message-definition.hpp +++ b/low-can-binding/can/message-definition.hpp @@ -49,6 +49,8 @@ private: frequency_clock_t frequency_clock_; ///< clock_ - an optional frequency clock to control the output of this /// message, if sent raw, or simply to mark the max frequency for custom /// handlers to retrieve.*/ + bool frame_layout_is_little_; /// last_value_; ///< last_value_ - The last received value of the message. Defaults to undefined. @@ -64,6 +66,7 @@ public: message_definition_t(const std::string bus, uint32_t id, uint32_t flags, + bool frame_layout_is_little, frequency_clock_t frequency_clock, bool force_send_changed, const vect_ptr_signal_t& signals); @@ -72,6 +75,7 @@ public: std::string name, uint32_t length, uint32_t flags, + bool frame_layout_is_little, frequency_clock_t frequency_clock, bool force_send_changed, const vect_ptr_signal_t& signals); @@ -87,6 +91,7 @@ public: vect_ptr_signal_t& get_signals(); uint32_t get_length() const; uint32_t get_flags() const; + bool frame_layout_is_little() const; void set_parent(std::shared_ptr parent); void set_last_value(std::shared_ptr m); -- cgit 1.2.3-korg