Skip to content

Commit 59d001e

Browse files
authored
Message dlc alignment in string representation
Changes the logger output from: ``` Timestamp: 3064.687553 ID: 0000 S F DLC: 8 00 01 02 03 04 05 06 07 Timestamp: 3064.887836 ID: 0001 S F DLC: 64 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f ``` to: ``` Timestamp: 3109.265685 ID: 0000 S F DLC: 8 00 01 02 03 04 05 06 07 Timestamp: 3109.465969 ID: 0001 S F DLC: 64 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f ```
1 parent 029564b commit 59d001e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

can/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __str__(self):
8686

8787
field_strings.append(flag_string)
8888

89-
field_strings.append("DLC: {0:d}".format(self.dlc))
89+
field_strings.append("DLC: {0:2d}".format(self.dlc))
9090
data_strings = []
9191
if self.data is not None:
9292
for index in range(0, min(self.dlc, len(self.data))):

0 commit comments

Comments
 (0)