Skip to content

Commit

Permalink
DiagCodedType: rename _extract_internal_value() to `_extract_atomic…
Browse files Browse the repository at this point in the history
…_value()`

Signed-off-by: Andreas Lauser <[email protected]>
Signed-off-by: Florian Jost <[email protected]>
  • Loading branch information
andlaus committed Feb 15, 2024
1 parent d643820 commit 59324c3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion odxtools/diagcodedtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def is_highlow_byte_order(self) -> bool:
return self.is_highlow_byte_order_raw in [None, True]

@staticmethod
def _extract_internal_value(
def _extract_atomic_value(
coded_message: bytes,
byte_position: int,
bit_position: int,
Expand Down
4 changes: 2 additions & 2 deletions odxtools/leadinglengthinfotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def decode_from_pdu(self, decode_state: DecodeState) -> AtomicOdxType:
coded_message = decode_state.coded_message

# Extract length of the parameter value
byte_length, byte_position = self._extract_internal_value(
byte_length, byte_position = self._extract_atomic_value(
coded_message=coded_message,
byte_position=decode_state.cursor_byte_position,
bit_position=decode_state.cursor_bit_position,
Expand All @@ -85,7 +85,7 @@ def decode_from_pdu(self, decode_state: DecodeState) -> AtomicOdxType:
# Extract actual value
# TODO: The returned value is None if the byte_length is 0. Maybe change it
# to some default value like an empty bytearray() or 0?
value, cursor_byte_position = self._extract_internal_value(
value, cursor_byte_position = self._extract_atomic_value(
coded_message=coded_message,
byte_position=byte_position,
bit_position=0,
Expand Down
4 changes: 2 additions & 2 deletions odxtools/minmaxlengthtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def decode_from_pdu(self, decode_state: DecodeState) -> AtomicOdxType:
terminator_pos += 1

# Extract the value
value, byte_pos = self._extract_internal_value(
value, byte_pos = self._extract_atomic_value(
decode_state.coded_message,
byte_position=cursor_pos,
bit_position=0,
Expand All @@ -167,7 +167,7 @@ def decode_from_pdu(self, decode_state: DecodeState) -> AtomicOdxType:
# or at the end of the PDU.
byte_length = max_terminator_pos - cursor_pos

value, byte_pos = self._extract_internal_value(
value, byte_pos = self._extract_atomic_value(
decode_state.coded_message,
byte_position=cursor_pos,
bit_position=0,
Expand Down
2 changes: 1 addition & 1 deletion odxtools/parameters/matchingrequestparameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def decode_from_pdu(self, decode_state: DecodeState) -> ParameterValue:
if self.byte_position is not None:
decode_state.cursor_byte_position = decode_state.origin_byte_position + self.byte_position

result, decode_state.cursor_byte_position = DiagCodedType._extract_internal_value(
result, decode_state.cursor_byte_position = DiagCodedType._extract_atomic_value(
coded_message=decode_state.coded_message,
byte_position=decode_state.cursor_byte_position,
bit_position=self.bit_position or 0,
Expand Down
2 changes: 1 addition & 1 deletion odxtools/paramlengthinfotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def decode_from_pdu(self, decode_state: DecodeState) -> AtomicOdxType:
bit_length = 0

# Extract the internal value and return.
value, cursor_byte_position = self._extract_internal_value(
value, cursor_byte_position = self._extract_atomic_value(
decode_state.coded_message,
decode_state.cursor_byte_position,
decode_state.cursor_bit_position,
Expand Down
2 changes: 1 addition & 1 deletion odxtools/standardlengthtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def convert_internal_to_bytes(self, internal_value: AtomicOdxType, encode_state:
)

def decode_from_pdu(self, decode_state: DecodeState) -> AtomicOdxType:
internal_value, cursor_byte_position = self._extract_internal_value(
internal_value, cursor_byte_position = self._extract_atomic_value(
decode_state.coded_message,
decode_state.cursor_byte_position,
decode_state.cursor_bit_position,
Expand Down

0 comments on commit 59324c3

Please sign in to comment.