Skip to content

Commit

Permalink
fix encoding of non byte-aligned reserved parameters
Browse files Browse the repository at this point in the history
`encode_state.emplace_bytes()` only works if the bit position is zero...

Signed-off-by: Andreas Lauser <[email protected]>
Signed-off-by: Katja Köhler <[email protected]>
  • Loading branch information
andlaus committed Jun 20, 2024
1 parent 02f7307 commit 763272e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions odxtools/parameters/reservedparameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 763272e

Please sign in to comment.