diff --git a/eive_tmtc/tmtc/payload/ploc_supervisor.py b/eive_tmtc/tmtc/payload/ploc_supervisor.py index b696ecf..98573b2 100644 --- a/eive_tmtc/tmtc/payload/ploc_supervisor.py +++ b/eive_tmtc/tmtc/payload/ploc_supervisor.py @@ -722,10 +722,42 @@ def get_event_buffer_path() -> str: return file +class SocState(enum.IntEnum): + OFF = 0 + BOOTING = 1 + OPERATIONAL = 2 + SHUTDOWN = 3 + + def handle_supv_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper): current_idx = 0 if set_id == SetIds.HK_REPORT: - pass + fmt_str = "!IIIQIIIIIBBBB" + inc_len = struct.calcsize(fmt_str) + ( + temp_ps, + temp_pl, + temp_sup, + uptime, + cpu_load, + avail_heap, + num_tcs, + num_tms, + soc_state, + nvm_0_1_state, + nvm_3_state, + mission_io_state, + fmc_state + ) = struct.unpack(fmt_str, hk_data) + pw.dlog(f"Temp PS {temp_ps} | Temp PL {temp_pl} | Temp SUP {temp_sup}") + pw.dlog(f"Uptime {uptime} | CPU Load {cpu_load} | Avail Heap {avail_heap}") + pw.dlog(f"Number TCs {num_tcs} | Number TMs {num_tms}") + pw.dlog(f"SOC state {SocState(soc_state)}") + pw.dlog(f"NVM 01 State {nvm_0_1_state}") + pw.dlog(f"NVM 3 State {nvm_3_state}") + pw.dlog(f"Mission IO state {mission_io_state}") + pw.dlog(f"FMC state {fmc_state}") + FsfwTmTcPrinter.print_validity_buffer(hk_data[inc_len:], 13) elif set_id == SetIds.BOOT_STATUS_REPORT: fmt_str = "!BBIIBBBBBB" inc_len = struct.calcsize(fmt_str)