Merge pull request #101 from adhintz/master

add support for multiple buses to can_unique and can_bit_transition
This commit is contained in:
George Hotz 2018-04-01 13:56:43 -06:00 committed by GitHub
commit f4efd1f29d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -45,7 +45,7 @@ class Info():
message_id = row[1][2:] # remove leading '0x'
else:
message_id = hex(int(row[1]))[2:] # old message IDs are in decimal
message_id = '%s:%s' % (bus, message_id)
if row[3].startswith('0x'):
data = row[3][2:] # remove leading '0x'
else:
@ -74,7 +74,7 @@ def PrintUnique(log_file, low_range, high_range):
high.load(log_file, start, end)
# print messages that go from low to high
found = False
for message_id in high.messages:
for message_id in sorted(high.messages):
if message_id in low.messages:
high.messages[message_id].printBitDiff(low.messages[message_id])
found = True

View File

@ -51,10 +51,12 @@ class Info():
reader = csv.reader(input)
next(reader, None) # skip the CSV header
for row in reader:
bus = row[0]
if row[1].startswith('0x'):
message_id = row[1][2:] # remove leading '0x'
else:
message_id = hex(int(row[1]))[2:] # old message IDs are in decimal
message_id = '%s:%s' % (bus, message_id)
if row[1].startswith('0x'):
data = row[2][2:] # remove leading '0x'
else:
@ -76,7 +78,7 @@ def PrintUnique(interesting_file, background_files):
background.load(background_file)
interesting = Info()
interesting.load(interesting_file)
for message_id in interesting.messages:
for message_id in sorted(interesting.messages):
if message_id not in background.messages:
print 'New message_id: %s' % message_id
else: