handle FW info event
EIVE/-/pipeline/head There was a failure building this commit Details

This commit is contained in:
Robin Müller 2023-06-23 02:05:04 +02:00
parent c9f4a8070d
commit ec0ebc3653
Signed by: muellerr
GPG Key ID: A649FB78196E3849
1 changed files with 6 additions and 3 deletions

View File

@ -95,7 +95,7 @@ def handle_event_packet( # noqa C901: Complexity okay here
if info.name == "REBOOT_COUNTER":
boot_count = (event_def.param1 << 32) | event_def.param2
pw.dlog(f"Total boot count: {boot_count}")
if info.name == "VERSION_INFO":
if info.name == "VERSION_INFO" or info.name == "FIRMWARE_INFO":
specific_handler = True
ver_major = (event_def.param1 >> 24) & 0xFF
ver_minor = (event_def.param1 >> 16) & 0xFF
@ -105,8 +105,11 @@ def handle_event_packet( # noqa C901: Complexity okay here
if has_git_sha:
p2_as_bytes = event_def.param2.to_bytes(4, sys.byteorder)
git_sha = p2_as_bytes.decode("ascii")
version_string = f"v{ver_major}.{ver_minor}.{ver_rev}"
pw.dlog(f"Version {version_string}")
if info.name == "VERSION_INFO":
name = "OBSW version: "
else:
name = "Firmware version: "
pw.dlog(f"{name} v{ver_major}.{ver_minor}.{ver_rev}")
if has_git_sha:
pw.dlog(f"Git SHA first four letters: {git_sha}")
if info.name == "CLOCK_SET":