添加jwt模块程序升级命令0xec

This commit is contained in:
ranchuan
2023-10-08 18:25:31 +08:00
parent b784c66e23
commit 5ee17b6ce2
6 changed files with 272 additions and 8 deletions

View File

@@ -229,6 +229,7 @@ class handle:
with open(name,"rb") as f:
self.data=f.read()
self.name=f.name.split('/')[-1]
print("file:{d1},crc32={d2}".format(d1=self.name,d2=hex(crc32(self.data))))
self.stat=0
self.packet_all=(len(self.data)+199)//200
self.sent_bytes=0

View File

@@ -268,7 +268,7 @@ class updata_dlg(QObject):
print("com changed")
self.close_port()
def get_cmd(self,file:str):
l=[(".bin",0xee),(".pkt",0xed),(".json",0x32)]
l=[(".bin",0xee),(".pkt",0xed),(".json",0x32),(".jwt",0xec)]
for i in l:
if(file.endswith(i[0])):
return i[1]
@@ -407,7 +407,7 @@ class updata_dlg(QObject):
# 扫描文件
def scan_file(self):
self.file_list.clear()
self.file_list.addItems(self.find_type([".bin",".json",".pkt"]))
self.file_list.addItems(self.find_type([".bin",".json",".pkt",".jwt"]))
# 扫描指定类型的文件
@@ -467,6 +467,8 @@ class updata_dlg(QObject):
pass
def recv_str_slot(self,cmd:int,txt:str,err:str):
print("|-|",txt)
with open("device_log.txt","a+") as f:
f.write(txt+'\n')
def recv_slot(self,cmd:int,data:bytearray,err:str):
# print("recv:",cmd,data)
if(self.cmd!=cmd):