Add message length column

This commit is contained in:
Adam Urban 2017-11-04 18:12:31 -04:00 committed by George Hotz
parent bc7f21f1a4
commit acf2377bb7
1 changed files with 2 additions and 2 deletions

View File

@ -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