Skip to content

Commit

Permalink
Merge pull request #280 from andlaus/decode_fixes
Browse files Browse the repository at this point in the history
Smallish decode fixes
  • Loading branch information
andlaus committed Mar 13, 2024
2 parents 076bbe3 + d69a7b2 commit 96d2c88
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion odxtools/isotp_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def decode_rx_frame(self, rx_id: int, data: bytes) -> Iterable[Tuple[int, bytes]
return # unknown CAN ID

# decode the isotp segment
frame_type, _ = bitstruct.unpack("u4", data)
frame_type, _ = bitstruct.unpack("u4u4", data)
assert isinstance(frame_type, int)

telegram_len = None
Expand Down
2 changes: 0 additions & 2 deletions odxtools/parameters/reservedparameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ def get_coded_value_as_bytes(self, encode_state: EncodeState) -> bytes:

@override
def _decode_positioned_from_pdu(self, decode_state: DecodeState) -> ParameterValue:
decode_state.cursor_byte_position += ((self.bit_position or 0) + self.bit_length + 7) // 8

return decode_state.extract_atomic_value(
bit_length=self.bit_length,
base_data_type=DataType.A_UINT32,
Expand Down
2 changes: 1 addition & 1 deletion odxtools/uds.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,4 @@ def is_response_pending(telegram_payload: bytes, request_sid: Optional[int] = No
# previous versions of odxtools had a typo here. hit happens!
@deprecated(details="use is_response_pending()") # type: ignore[misc]
def is_reponse_pending(telegram_payload: bytes, request_sid: Optional[int] = None) -> bool:
return is_reponse_pending(telegram_payload, request_sid) # type: ignore[no-any-return]
return is_response_pending(telegram_payload, request_sid)

0 comments on commit 96d2c88

Please sign in to comment.