From 7498b785ae98c4dbb196025de6b40d6bc4bd5f3e Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 9 Mar 2023 15:37:32 +0100 Subject: [PATCH] m1n1/fw/dcp/parse_log: Parse firmware version from log Incomplete, needs to reload fw.dcp.ipc. Signed-off-by: Janne Grunau --- proxyclient/m1n1/fw/dcp/parse_log.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proxyclient/m1n1/fw/dcp/parse_log.py b/proxyclient/m1n1/fw/dcp/parse_log.py index e57f6371..edb72607 100644 --- a/proxyclient/m1n1/fw/dcp/parse_log.py +++ b/proxyclient/m1n1/fw/dcp/parse_log.py @@ -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}")