Skip to content

Commit a598e22

Browse files
RitheeshBaradwajhardbyte
authored andcommitted
fix: handle "Start of measurement" line in ASCReader
1 parent 78e4f81 commit a598e22

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CONTRIBUTORS.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,5 @@ Felix Nieuwenhuizen
8181
@fjburgos
8282
@pkess
8383
@felixn
84-
@Tbruno25
84+
@Tbruno25
85+
@RitheeshBaradwaj

can/io/asc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ def __iter__(self) -> Generator[Message, None, None]:
275275
)
276276
continue
277277

278+
# Handle the "Start of measurement" line
279+
if line.startswith("0.000000") and "Start of measurement" in line:
280+
# Skip this line as it's just an indicator
281+
continue
282+
278283
if not ASC_MESSAGE_REGEX.match(line):
279284
# line might be a comment, chip status,
280285
# J1939 message or some other unsupported event

0 commit comments

Comments
 (0)