summaryrefslogtreecommitdiffstats
path: root/low-can-binding/can/can-decoder.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-12-10 16:53:22 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2020-01-09 16:25:36 +0100
commit542e3d732ec17e4c49d1059a9262f6535a7f3e62 (patch)
tree7e1ba564433a4021eec9e88456868325eb43d130 /low-can-binding/can/can-decoder.cpp
parent0e786385e547a247f96fce164d38712d0f59298e (diff)
message: Rework message flags
Adding bit_position and frame manipulation flags Change-Id: Ibd727a54a33a78b49f2c319b4b70dcda21ea87cb Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/can/can-decoder.cpp')
-rw-r--r--low-can-binding/can/can-decoder.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/low-can-binding/can/can-decoder.cpp b/low-can-binding/can/can-decoder.cpp
index ae10cd98..488fdfb8 100644
--- a/low-can-binding/can/can-decoder.cpp
+++ b/low-can-binding/can/can-decoder.cpp
@@ -106,13 +106,16 @@ float decoder_t::parse_signal_bitfield(signal_t& signal, std::shared_ptr<message
uint8_t new_start_bit = 0;
uint8_t new_end_bit = 0;
- if(signal.get_message()->frame_layout_is_bigendian())
- {
+ if(signal.get_message()->get_flags() & CONTINENTAL_BIT_POSITION)
+ bit_position = converter_t::continental_bit_position_mess(message->get_length(),
+ signal.get_bit_position(),
+ bit_size);
+ if(signal.get_message()->get_flags() & BIT_POSITION_REVERSED)
bit_position = converter_t::bit_position_swap(message->get_length(),
signal.get_bit_position(),
bit_size);
+ if(signal.get_message()->get_flags() & FRAME_LAYOUT_IS_BIGENDIAN)
message->frame_swap();
- }
data = message->get_data_vector();
converter_t::signal_to_bits_bytes(bit_position, bit_size, new_start_byte, new_end_byte, new_start_bit, new_end_bit);