import struct HEAD_STANDARD = 0x05 HEAD_FOTA = 0x15 CMD_GET_BUILD = 0x1E08 CMD_READ_FLASH = 0x0403 CMD_GET_BD_ADDR = 0x0C05 def build_race_packet(cmd: int, payload: bytes = b'', head: int = HEAD_STANDARD) -> bytes: pkt_type = 0x00 length = 2 + len(payload) header = struct.pack(' dict: if len(data) < 6: return {"error": "Packet too short"} head, pkt_type, length = struct.unpack_from('