From 6cc152447e74b1ce7fab6c7aa1f9b4e5e8232444 Mon Sep 17 00:00:00 2001 From: Clément Bénier Date: Fri, 15 Nov 2019 11:20:34 +0100 Subject: sign: handle decode methods sign from can value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add enumeration that represents the way of encoding: enum sign_t { UNSIGNED = 0, SIGN_BIT = 1, ONES_COMPLEMENT = 2, TWOS_COMPLEMENT = 3, SIGN_BIT_EXTERN = 4 }; - the function handle_sign allows to transform value if negative and return the sign of the value in order to be multiplied at the end ot the parcing Bug-AGL: SPEC-3021 Change-Id: I5766a286488170d930422474b4c4f3a8578ca726 Signed-off-by: Clément Bénier Signed-off-by: Romain Forlot --- low-can-binding/can/can-decoder.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'low-can-binding/can/can-decoder.hpp') diff --git a/low-can-binding/can/can-decoder.hpp b/low-can-binding/can/can-decoder.hpp index a5e3acbe..02a2c7e1 100644 --- a/low-can-binding/can/can-decoder.hpp +++ b/low-can-binding/can/can-decoder.hpp @@ -24,6 +24,7 @@ class decoder_t { public: + static int handle_sign(const signal_t& signal, std::vector& data_signal, uint8_t new_end_bit, const std::vector& can_data); static float parse_signal_bitfield(signal_t& signal, std::shared_ptr message); static openxc_DynamicField decode_state(signal_t& signal, std::shared_ptr message, bool* send); -- cgit 1.2.3-korg