decode: fix tab/space confusion in analyze.py

This commit is contained in:
Dan Williams
2012-01-19 11:55:12 -06:00
parent 285cd37f11
commit 4e7fb72d2d

View File

@@ -40,11 +40,11 @@ class Packet:
if data[len(data) - 2:] == "0d": if data[len(data) - 2:] == "0d":
data = data[:len(data) - 2] data = data[:len(data) - 2]
self.type = TO_MODEM self.type = TO_MODEM
# elif data[len(data) - 6:] == "30307e": # elif data[len(data) - 6:] == "30307e":
# # device->host: remove HDLC terminator and fake CRC # # device->host: remove HDLC terminator and fake CRC
# data = data[:len(data) - 6] # data = data[:len(data) - 6]
# self.type = TO_HOST # self.type = TO_HOST
elif data[len(data) - 2:] == "7e": elif data[len(data) - 2:] == "7e":
# device->host: remove HDLC terminator and CRC # device->host: remove HDLC terminator and CRC
data = data[:len(data) - 6] data = data[:len(data) - 6]
self.type = TO_HOST self.type = TO_HOST
@@ -82,7 +82,7 @@ class Packet:
elif self.type == TO_HOST: elif self.type == TO_HOST:
line = "<" line = "<"
offset = 0 offset = 0
items = [] items = []
printed = False printed = False
for i in self.data: for i in self.data:
@@ -140,8 +140,8 @@ class FindPackets(handler.ContentHandler):
self.inPayload = False self.inPayload = False
elif name == "payload": elif name == "payload":
if self.packet: if self.packet:
p = Packet(self.packet, self.idx) p = Packet(self.packet, self.idx)
self.idx = self.idx + 1 self.idx = self.idx + 1
packets.append(p) packets.append(p)
self.packet = None self.packet = None