Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zariiii9003 authored and mergify[bot] committed Apr 29, 2022
1 parent 638d81a commit 9160f45
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions can/io/asc.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ def _process_classic_can_frame(
_, dlc_str = rest_of_message.split(None, 1)
data = ""

dlc = int(dlc_str, self._converted_base)
dlc = dlc2len(int(dlc_str, self._converted_base))
msg_kwargs["dlc"] = dlc
self._process_data_string(data, dlc, msg_kwargs)
self._process_data_string(data, min(8, dlc), msg_kwargs)

return Message(**msg_kwargs)

Expand Down
11 changes: 11 additions & 0 deletions test/data/issue_1299.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
date Thu Apr 28 10:44:52.480 am 2022
base hex timestamps absolute
internal events logged
// version 12.0.0
Begin TriggerBlock Thu Apr 28 10:44:52.480 am 2022
0.000000 Start of measurement
13.258199 1 180 Tx d 8 6A 00 00 00 00 00 00 00 Length = 244016 BitCount = 125 ID = 384
13.258433 1 221 Tx d 8 C2 4A 05 81 00 00 15 10 Length = 228016 BitCount = 117 ID = 545
13.258671 1 3FF Tx d D 55 AA 01 02 03 04 05 06 Length = 232016 BitCount = 119 ID = 1023
13.258907 1 F4 Tx d 8 8A 1A 0D F2 13 00 00 07 Length = 230016 BitCount = 118 ID = 244
End TriggerBlock
3 changes: 3 additions & 0 deletions test/logformats_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ def test_ignore_comments(self):
def test_no_triggerblock(self):
_msg_list = self._read_log_file("issue_1256.asc")

def test_can_dlc_greater_than_8(self):
_msg_list = self._read_log_file("issue_1299.asc")


class TestBlfFileFormat(ReaderWriterTest):
"""Tests can.BLFWriter and can.BLFReader.
Expand Down

0 comments on commit 9160f45

Please sign in to comment.