Skip to content

Commit 5c4a68d

Browse files
committed
WIP
WIP
1 parent e6152a6 commit 5c4a68d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/canmatrix/formats/dbc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -861,10 +861,10 @@ def add_frame_by_id(new_frame): # type: (canmatrix.Frame) -> None
861861
temp.group(1),
862862
temp.group(3))
863863
elif '"BusType"' in decoded:
864-
regexp = re.compile(r"^BA_ +\"BusType\" +\"(.+?)\" *; *")
865-
temp = regexp.match(decoded)
866-
if temp:
867-
db.add_attribute("BusType", f'"{temp.group(1)}"')
864+
if '"CAN FD"' in decoded:
865+
db.add_attribute("BusType", f'"CAN FD"')
866+
elif '"CAN"' in decoded:
867+
db.add_attribute("BusType", f'"CAN"')
868868
else:
869869
regexp = re.compile(
870870
r"^BA_ +\"([A-Za-z0-9\-_]+)\" +([\"\S\-\.]+) *; *")

0 commit comments

Comments
 (0)