From f6118700b351f5f202b4b34cef29fada40a363e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Eszes?= Date: Mon, 13 Mar 2023 00:13:58 +0100 Subject: [PATCH] Returning diag. frames and removing deprecated func. call (#115) --- CHANGELOG.md | 7 +++++++ ldfparser/frame.py | 2 +- ldfparser/ldf.py | 6 +++++- setup.cfg | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3e23e9..0bb9ec3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.19.0] - 2023-03-12 + ### Added - ISO17987 version support @@ -14,9 +16,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `LDF_file_revision` - Endianness +### Changed + +- `LDF::get_frame` can now return diagnostic frames + ### Fixes - `LinSlave` protocol version property is now the correct type +- `LinUnconditionalFrame::decode` no longer calls the deprecated `parse_raw` function ## [0.18.0] - 2022-12-13 diff --git a/ldfparser/frame.py b/ldfparser/frame.py index 79d35a3..648b7f3 100644 --- a/ldfparser/frame.py +++ b/ldfparser/frame.py @@ -206,7 +206,7 @@ def decode(self, frame_layout = u6p2u8u1u1p6 """ - parsed = self.parse_raw(data) + parsed = self.decode_raw(data) converted = {} for (signal_name, value) in parsed.items(): signal = self._get_signal(signal_name) diff --git a/ldfparser/ldf.py b/ldfparser/ldf.py index 6857c1a..771e992 100644 --- a/ldfparser/ldf.py +++ b/ldfparser/ldf.py @@ -87,7 +87,7 @@ def get_slaves(self) -> List[LinSlave]: """ return self._slaves.values() - def get_frame(self, frame_id: Union[int, str]) -> Union[LinUnconditionalFrame, LinEventTriggeredFrame, LinSporadicFrame]: + def get_frame(self, frame_id: Union[int, str]) -> Union[LinUnconditionalFrame, LinEventTriggeredFrame, LinSporadicFrame, LinDiagnosticFrame]: try: return self.get_unconditional_frame(frame_id) except LookupError: @@ -98,6 +98,10 @@ def get_frame(self, frame_id: Union[int, str]) -> Union[LinUnconditionalFrame, L pass try: return self.get_sporadic_frame(frame_id) + except LookupError: + pass + try: + return self.get_diagnostic_frame(frame_id) except LookupError as exc: raise exc diff --git a/setup.cfg b/setup.cfg index 0def4c5..e9be28d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ [metadata] -version = 0.18.0 +version = 0.19.0