added event handler for reboot events

This commit is contained in:
Robin Müller 2023-04-17 18:40:27 +02:00
parent 3bb0a08e95
commit 4083a3090f
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 16 additions and 0 deletions

View File

@ -10,6 +10,10 @@ list yields a list of all related PRs for each release.
# [unreleased] # [unreleased]
## Added
- Event handling for reboot counter events.
# [v3.1.0] 2023-04-16 # [v3.1.0] 2023-04-16
## Added ## Added

View File

@ -80,6 +80,18 @@ def handle_event_packet(raw_tm: bytes, printer: FsfwTmTcPrinter):
pw.dlog( pw.dlog(
f"Mode Number {event_def.param1}, Mode Name {mode_name}, Submode: {event_def.param2}" f"Mode Number {event_def.param1}, Mode Name {mode_name}, Submode: {event_def.param2}"
) )
if info.name == "INDIVIDUAL_BOOT_COUNTS":
boot_count_00 = (event_def.param1 >> 16) & 0xFFFF
boot_count_01 = event_def.param1 & 0xFFFF
boot_count_10 = (event_def.param2 >> 16) & 0xFFFF
boot_count_11 = event_def.param2 & 0xFFFF
pw.dlog(f"Boot count 0 0: {boot_count_00}")
pw.dlog(f"Boot count 0 1: {boot_count_01}")
pw.dlog(f"Boot count 1 0: {boot_count_10}")
pw.dlog(f"Boot count 1 1: {boot_count_11}")
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":
specific_handler = True specific_handler = True
ver_major = (event_def.param1 >> 24) & 0xFF ver_major = (event_def.param1 >> 24) & 0xFF