From d54044d663e64e9de398ac93f6e05c3150ebb0bc Mon Sep 17 00:00:00 2001 From: Pratik Mahamuni Date: Tue, 30 Jul 2024 17:10:34 -0700 Subject: [PATCH 1/4] Modified data slicing in BLFReader for when the object type is CAN_MESSAGE, CAN_MESSAGE2 and CAN_ERROR_TXT. This is derived directly from this repository: https://github.com/Technica-Engineering/vector_blf/tree/master. --- can/io/blf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/can/io/blf.py b/can/io/blf.py index 81146233d..d46b83064 100644 --- a/can/io/blf.py +++ b/can/io/blf.py @@ -275,7 +275,7 @@ def _parse_data(self, data): is_remote_frame=bool(flags & REMOTE_FLAG), is_rx=not bool(flags & DIR), dlc=dlc, - data=can_data[:dlc], + data=can_data, channel=channel - 1, ) elif obj_type == CAN_ERROR_EXT: @@ -290,7 +290,7 @@ def _parse_data(self, data): is_extended_id=bool(can_id & CAN_MSG_EXT), arbitration_id=can_id & 0x1FFFFFFF, dlc=dlc, - data=can_data[:dlc], + data=can_data, channel=channel - 1, ) elif obj_type == CAN_FD_MESSAGE: From bbe40d91af9a1218573f68221c2373a27d8532c3 Mon Sep 17 00:00:00 2001 From: Pratik Mahamuni Date: Thu, 1 Aug 2024 15:12:27 -0700 Subject: [PATCH 2/4] Hardcoded version in pyproject.toml --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 99a54a5df..cfdacdf8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,8 @@ build-backend = "setuptools.build_meta" [project] name = "python-can" -dynamic = ["readme", "version"] +dynamic = ["readme"] +version = "4.3.1" description = "Controller Area Network interface module for Python" authors = [{ name = "python-can contributors" }] dependencies = [ From 8966e38203ac645efee540dad7310a17290700b7 Mon Sep 17 00:00:00 2001 From: Pratik Mahamuni Date: Fri, 16 Aug 2024 09:57:43 -0700 Subject: [PATCH 3/4] Removed the hardcoded version from pyproject.toml file based on the comment from zariii --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cfdacdf8b..99a54a5df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,8 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "python-can" -dynamic = ["readme"] -version = "4.3.1" +dynamic = ["readme", "version"] description = "Controller Area Network interface module for Python" authors = [{ name = "python-can contributors" }] dependencies = [ From c4f2b9200ef4ab80fdf7639cad7a00a345c236f0 Mon Sep 17 00:00:00 2001 From: Pratik Mahamuni Date: Fri, 16 Aug 2024 14:45:48 -0700 Subject: [PATCH 4/4] Based on how the data is being sent to various tests and 'equals' method in the Message class, modified the equal method to make sure that the data being read is equal to the DLC. This is a temporary fix till we agree on what data should be used in the tests, especially pertaining to the BLFReader / BLFWriter constructors --- can/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/can/message.py b/can/message.py index c26733087..4f414c8be 100644 --- a/can/message.py +++ b/can/message.py @@ -321,7 +321,7 @@ def equals( and self.arbitration_id == other.arbitration_id and self.is_extended_id == other.is_extended_id and self.dlc == other.dlc - and self.data == other.data + and self.data[: self.dlc] == other.data[: other.dlc] and self.is_remote_frame == other.is_remote_frame and self.is_error_frame == other.is_error_frame and (self.channel == other.channel or not check_channel)