Skip to content

Commit c408273

Browse files
committed
fix: update parse_logger to correctly handle offset calculation and data extraction
1 parent a69bcde commit c408273

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

parsley/parsley.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ def parse_logger(buf: bytes, page_number: int) -> Union[Tuple[bytes, bytes], Non
151151
if not 0 <= dlc <= 8:
152152
raise ValueError(f"DLC out of range (0-8), got {dlc}")
153153

154+
offset += HEADER_LEN
155+
154156
data: List[int] = list(buf[offset: offset + dlc])
155157

156-
offset += HEADER_LEN + dlc
158+
offset += dlc
157159

158160
yield format_can_message(sid, data)
159161

0 commit comments

Comments
 (0)