diff --git a/examples/can_bit_transition.py b/examples/can_bit_transition.py index 50d13f0a45a175..5c15e4bbc26eed 100755 --- a/examples/can_bit_transition.py +++ b/examples/can_bit_transition.py @@ -45,7 +45,7 @@ def load(self, filename, start, end): 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 diff --git a/examples/can_unique.py b/examples/can_unique.py index 42488c64bb24fd..ad6de296ee4174 100755 --- a/examples/can_unique.py +++ b/examples/can_unique.py @@ -51,10 +51,12 @@ def load(self, filename): 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: