m1n1/fw/dcp/parse_log: Parse firmware version from log

Incomplete, needs to reload fw.dcp.ipc.

Signed-off-by: Janne Grunau <j@jannau.net>
This commit is contained in:
Janne Grunau 2023-03-09 15:37:32 +01:00
parent 40d1d302d0
commit 7498b785ae

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: MIT
from m1n1.utils import *
from m1n1.constructutils import Ver
from m1n1.fw.dcp.ipc import *
def parse_log(fd):
@ -17,6 +18,12 @@ def parse_log(fd):
op = op_stack[chan].pop()
assert int(off, 0) == op.off
op.ack(bytes.fromhex(out_data))
elif optype == "VERSION":
for arg in args.strip().split(" "):
version = arg.split(":")
if len(version) == 2:
Ver.set_version_key(version[0], version[1])
continue
else:
raise Exception(f"Unknown log cmd {optype}")