增加测试用例代码

This commit is contained in:
2025-07-23 18:21:22 +08:00
parent 20f45581e6
commit 5b5e455040
2 changed files with 11 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
#encoding=utf-8
import random
import copy
import time
class GenPkt(object):
def __init__(self):
@@ -313,6 +314,7 @@ def genSlvSMReadData(dev, sm, data_len):
if __name__ == '__main__':
random.seed(int(time.time() * 1000))
genPkt = GenPkt()
#-------------------------------------------------------------------------
@@ -401,7 +403,7 @@ if __name__ == '__main__':
genPkt.clean()
data = list()
for i in range(256):
for i in range(1024):
data.append(random.randint(0, 255))
genPkt.setPkt(2, data)