修正生成代码的错误

This commit is contained in:
2025-07-21 18:32:19 +08:00
parent 12458a4729
commit 6bea895fc1
2 changed files with 46 additions and 5 deletions

View File

@@ -68,8 +68,6 @@ class GenPkt(object):
print('Error, bad pkt_len:', pkt_len)
return
print("pkt_len:%d, data_len:%d"%(pkt_len, pkt_len - 4))
i = 4
if (self.pkt_type == 1):
pkt_len = 4
@@ -88,6 +86,7 @@ class GenPkt(object):
for d in self.pkt_data:
self.pkt_buf.append(d)
i = pkt_len
#print("-----------------------------", filename, self.pkt_type, pkt_len, self.pkt_buf)
else:
#for i in range(pkt_len):
@@ -155,6 +154,7 @@ class GenPkt(object):
self.pkt_buf.append(0)
i = i + 1
print("pkt_len:%d, data_len:%d"%(pkt_len, pkt_len - 4))
f = open(filename, "wt+")
if filetype == 1:
for md in self.sub_pkt: