From acf2377bb7b4db262eeb65b5640780bc3b532506 Mon Sep 17 00:00:00 2001 From: Adam Urban Date: Sat, 4 Nov 2017 18:12:31 -0400 Subject: [PATCH] Add message length column --- examples/can_logger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/can_logger.py b/examples/can_logger.py index d5d91d27f..d0d90d1b1 100755 --- a/examples/can_logger.py +++ b/examples/can_logger.py @@ -24,7 +24,7 @@ def can_logger(): outputfile = open('output.csv', 'wb') csvwriter = csv.writer(outputfile) #Write Header - csvwriter.writerow(['Bus', 'MessageID', 'Message']) + csvwriter.writerow(['Bus', 'MessageID', 'Message', 'MessageLength']) print("Writing csv file output.csv. Press Ctrl-C to exit...\n") bus0_msg_cnt = 0 @@ -35,7 +35,7 @@ def can_logger(): can_recv = p.can_recv() for address, _, dat, src in can_recv: - csvwriter.writerow([str(src), str(hex(address)), binascii.hexlify(dat)]) + csvwriter.writerow([str(src), str(hex(address)), binascii.hexlify(dat), len(dat)]) if src == 0: bus0_msg_cnt += 1