From 1c1afe6ed371c512a9a4e47018b51dde9f1a1b02 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald@gmail.com" Date: Sat, 15 Nov 2014 23:41:54 +0000 Subject: [PATCH] fix text log handling --- tools/create_packet_log.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/create_packet_log.py b/tools/create_packet_log.py index 9b7840b36..8a4d04834 100755 --- a/tools/create_packet_log.py +++ b/tools/create_packet_log.py @@ -61,7 +61,7 @@ def dumpPacket(fout, timestamp, type, data): fout.write(data) def handleHexPacket(fout, timestamp, type, text): - data = bytearray(map(str2hex, text.strip(" ").split(" "))) + data = bytearray(map(str2hex, text.strip().split(" "))) dumpPacket(fout, timestamp, type, data) if len(sys.argv) == 1: @@ -82,12 +82,11 @@ with open (outfile, 'wb') as fout: with open (infile, 'rb') as fin: packet_counter = 0 for line in fin: + # print line timestamp = None parts = parts = re.match('\[(.*)\] (.*)', line) if parts and len(parts.groups()) == 2: (timestamp, line) = parts.groups() - else: - timestamp = packet_counter rest = chop(line,'CMD => ') if rest: handleHexPacket(fout, timestamp, 0, rest)