增加测试用例
This commit is contained in:
@@ -1815,3 +1815,70 @@ def tc26():
|
||||
|
||||
return gen_file_def
|
||||
|
||||
def tc27():
|
||||
genPkt = GenPkt()
|
||||
|
||||
|
||||
gen_file_def = "base_tc27"
|
||||
sm_idx = 0
|
||||
tc_des = "读,单次通讯2048个字节。"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#>>>>>>普通数据包 sm2,广播读
|
||||
genPkt.clean()
|
||||
genPkt.setPktType(0)
|
||||
|
||||
#subPkt参数:索引、索引类型、地址、命令、长度、数据
|
||||
genPkt.addSubPkt(0x01, 0, 0x180, 0x0, 128, None)
|
||||
genPkt.addSubPkt(0x02, 0, 0x180, 0x0, 128, None)
|
||||
genPkt.addSubPkt(0x03, 0, 0x180, 0x0, 128, None)
|
||||
genPkt.addSubPkt(0x04, 0, 0x180, 0x0, 128, None)
|
||||
|
||||
genPkt.addSubPkt(0x01, 0, 0x180, 0x0, 128, None)
|
||||
genPkt.addSubPkt(0x02, 0, 0x180, 0x0, 128, None)
|
||||
genPkt.addSubPkt(0x03, 0, 0x180, 0x0, 128, None)
|
||||
genPkt.addSubPkt(0x04, 0, 0x180, 0x0, 128, None)
|
||||
|
||||
genPkt.addSubPkt(0x01, 0, 0x180, 0x0, 128, None)
|
||||
genPkt.addSubPkt(0x02, 0, 0x180, 0x0, 128, None)
|
||||
genPkt.addSubPkt(0x03, 0, 0x180, 0x0, 128, None)
|
||||
genPkt.addSubPkt(0x04, 0, 0x180, 0x0, 128, None)
|
||||
|
||||
#genPkt.addSubPkt(0x01, 0, 0x180, 0x0, 128, None)
|
||||
#genPkt.addSubPkt(0x02, 0, 0x180, 0x0, 128, None)
|
||||
#genPkt.addSubPkt(0x03, 0, 0x180, 0x0, 128, None)
|
||||
|
||||
sm_idx = 2
|
||||
|
||||
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des))
|
||||
|
||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||
+genReadAckPktCode(gen_file_def, sm_idx)
|
||||
|
||||
+genMessageCode("--读取中断")
|
||||
+genIFRwDataCode(0, 0x74, False, 4)
|
||||
+genIFRwDataCode(1, 0x74, False, 4)
|
||||
+genIFRwDataCode(2, 0x74, False, 4)
|
||||
+genIFRwDataCode(3, 0x74, False, 4)
|
||||
+genIFRwDataCode(4, 0x74, False, 4)
|
||||
|
||||
+genMessageCode("--清除中断")
|
||||
+genIFRwDataCode(0, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
|
||||
+genIFRwDataCode(1, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
|
||||
+genIFRwDataCode(2, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
|
||||
+genIFRwDataCode(3, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
|
||||
+genIFRwDataCode(4, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
|
||||
|
||||
+genMessageCode("--读取中断")
|
||||
+genIFRwDataCode(0, 0x74, False, 4)
|
||||
+genIFRwDataCode(1, 0x74, False, 4)
|
||||
+genIFRwDataCode(2, 0x74, False, 4)
|
||||
+genIFRwDataCode(3, 0x74, False, 4)
|
||||
+genIFRwDataCode(4, 0x74, False, 4)
|
||||
|
||||
+genTcEndFrameCode(gen_file_def))
|
||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||
|
||||
return gen_file_def
|
||||
Reference in New Issue
Block a user