X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Fcan%2Fcan-decoder.cpp;h=7221d716da8635fbffe5a51dfb8cedcae6da6703;hb=2dcfd4d0faa9699a4a32af1c39be674dc2856f41;hp=3f05fd5394926c6d3af77682fce96cfd75831d65;hpb=05e0dcd47f5cbe62de594c801f1c460622847716;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/can/can-decoder.cpp b/low-can-binding/can/can-decoder.cpp index 3f05fd53..7221d716 100644 --- a/low-can-binding/can/can-decoder.cpp +++ b/low-can-binding/can/can-decoder.cpp @@ -104,17 +104,6 @@ float decoder_t::parse_signal_bitfield(signal_t& signal, std::shared_ptrget_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); @@ -409,6 +398,17 @@ openxc_DynamicField decoder_t::translate_signal(signal_t& signal, std::shared_pt /// openxc_DynamicField decoder_t::decode_signal( signal_t& signal, std::shared_ptr message, bool* send) { + + + if(signal.get_message()->get_flags() & CONTINENTAL_BIT_POSITION) + signal.set_bit_position(converter_t::continental_bit_position_mess(message->get_length(), + signal.get_bit_position(), + signal.get_bit_size())); + if(signal.get_message()->get_flags() & BIT_POSITION_REVERSED) + signal.set_bit_position(converter_t::bit_position_swap(message->get_length(), + signal.get_bit_position(), + signal.get_bit_size())); + signal_decoder decoder = signal.get_decoder() == nullptr ? decode_noop : signal.get_decoder();