From 763272eb5a2db9bb0e0bbefe367db9e5b8efee09 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Thu, 20 Jun 2024 10:37:02 +0200 Subject: [PATCH] fix encoding of non byte-aligned reserved parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `encode_state.emplace_bytes()` only works if the bit position is zero... Signed-off-by: Andreas Lauser Signed-off-by: Katja Köhler --- odxtools/parameters/reservedparameter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/odxtools/parameters/reservedparameter.py b/odxtools/parameters/reservedparameter.py index 87967d60..8018896e 100644 --- a/odxtools/parameters/reservedparameter.py +++ b/odxtools/parameters/reservedparameter.py @@ -53,6 +53,7 @@ def _encode_positioned_into_pdu(self, physical_value: Optional[ParameterValue], encode_state: EncodeState) -> None: encode_state.cursor_byte_position += (encode_state.cursor_bit_position + self.bit_length + 7) // 8 + encode_state.cursor_bit_position = 0 encode_state.emplace_bytes(b'', self.short_name) @override