Describe the bug
Reader
https://github.com/hardbyte/python-can/blob/develop/can/io/asc.py#L197: using DLC (data length code) from ASC as dlc (Data length) in python-can message. I think data_length must be used instead
Writer
https://github.com/hardbyte/python-can/blob/develop/can/io/asc.py#L384: inverse is done here. instead len2dlc(msg.dlc)
To Reproduce
asc_bug.py at python-can root
from pathlib import Path
from can import LogReader
if __name__ == "__main__":
path = Path(__file__).parent / "test" / "data" / "test_CanFdMessage64.asc"
reader = LogReader(path)
for msg in reader:
print(msg)
output:
Timestamp: 30.506898 ID: 04ee S Rx F EI DL: 15 a1 02 03 04 00 00 00 00 00 00 00 00 00 00 00 Channel: 3
Timestamp: 31.506898 ID: 1c4d80a7 X Rx F BS DL: 15 b1 02 03 04 00 00 00 00 00 00 00 00 00 00 00 Channel: 3
In the test_CanFdMessage64.asc frames are 64 bytes length
Expected behavior
frames should have 64 bytes length
Additional context
used python-can is develop branch
Describe the bug
Reader
https://github.com/hardbyte/python-can/blob/develop/can/io/asc.py#L197: using DLC (data length code) from ASC as dlc (Data length) in python-can message. I think
data_lengthmust be used insteadWriter
https://github.com/hardbyte/python-can/blob/develop/can/io/asc.py#L384: inverse is done here. instead
len2dlc(msg.dlc)To Reproduce
asc_bug.py at python-can root
output:
In the
test_CanFdMessage64.ascframes are 64 bytes lengthExpected behavior
frames should have 64 bytes length
Additional context
used python-can is develop branch