From: Romain Forlot Date: Thu, 30 Nov 2017 08:43:46 +0000 (+0100) Subject: Correctly reconstituting entire CAN frame X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=f94d6331c3dc58bef76c13751f2f6c51fe133324;p=apps%2Flow-level-can-service.git Correctly reconstituting entire CAN frame Change-Id: I39d226c6f6268ec880739e6b9230eb42ce475971 Signed-off-by: Romain Forlot --- diff --git a/low-can-binding/can/can-encoder.cpp b/low-can-binding/can/can-encoder.cpp index 5cb1f24..e0015da 100644 --- a/low-can-binding/can/can-encoder.cpp +++ b/low-can-binding/can/can-encoder.cpp @@ -42,11 +42,12 @@ const can_frame encoder_t::build_frame(const std::shared_ptr& sign for(const auto& sig: signal->get_message()->get_can_signals()) { - bitfield_encode_float((float)value, - signal->get_bit_position(), - signal->get_bit_size(), - signal->get_factor(), - signal->get_offset(), + float last_value = sig->get_last_value(); + bitfield_encode_float(last_value, + sig->get_bit_position(), + sig->get_bit_size(), + sig->get_factor(), + sig->get_offset(), cf.data, CAN_MAX_DLEN); }