每日更新;

This commit is contained in:
何泽隆
2024-04-26 04:28:39 +08:00
parent 64c7a5d364
commit 3ccfca4b32
3 changed files with 50 additions and 22 deletions

View File

@@ -223,8 +223,16 @@ def check_frame_modbus(frame, block=None):
else:
check_hope = None
return check_result, update_index, check_hope
elif code_subfunc == 0x03 and frame[3] == 0x00:
return frame[4] * 256 + frame[5]
elif code_subfunc == 0x03:
if frame[3] == 0xFF:
raise("Update verification failed.")
elif frame[3] == 0x01:
print("Update done.")
elif frame[3] == 0x00:
print("Update not done.")
else:
print("Update unknown return value.")
return frame[3]
else:
raise("Func code or Return code error.")
elif code_func == 0x03 or code_func == 0x04: