From 673c8b2cf2778c8a94bb6e89349204e171294952 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 23 May 2024 13:42:32 +0200 Subject: [PATCH 1/4] mode handling fix --- eive_tmtc/pus_tm/pus_handler.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/eive_tmtc/pus_tm/pus_handler.py b/eive_tmtc/pus_tm/pus_handler.py index 805c6ec..e6d9d7a 100644 --- a/eive_tmtc/pus_tm/pus_handler.py +++ b/eive_tmtc/pus_tm/pus_handler.py @@ -15,7 +15,7 @@ from tmtccmd.logging.pus import RawTmtcTimedLogWrapper from tmtccmd.pus import VerificationWrapper from tmtccmd.pus.s20_fsfw_param import Service20FsfwTm, Service20ParamDumpWrapper from tmtccmd.pus.s20_fsfw_param_defs import CustomSubservice as ParamSubservice -from tmtccmd.pus.s200_fsfw_mode import Service200FsfwTm +from tmtccmd.pus.s200_fsfw_mode import Service200FsfwReader, Service200FsfwTm from tmtccmd.pus.s200_fsfw_mode import Subservice as ModeSubservice from tmtccmd.tmtc import GenericApidHandlerBase, SpecificApidHandlerBase from eive_tmtc.config.definitions import TM_DB_PATH, PUS_APID @@ -193,20 +193,19 @@ class PusHandler(SpecificApidHandlerBase): f"unknown subservice {tm_packet.subservice} for parameter service" ) - def _handle_mode_packet(self, raw_data: bytes, _: PusTelemetry) -> bool: - tm_packet = Service200FsfwTm.unpack( - raw_telemetry=raw_data, time_reader=CdsShortTimestamp.empty() - ) - if tm_packet.subservice == ModeSubservice.TM_CANT_REACH_MODE: + def _handle_mode_packet(self, pus_tm: PusTelemetry) -> bool: + tm_packet = Service200FsfwReader(pus_tm) + if tm_packet.tm.subservice == ModeSubservice.TM_CANT_REACH_MODE: obj_id = tm_packet.object_id obj_id_obj = self.obj_id_dict.get(obj_id) retval = tm_packet.return_value + assert retval is not None string_list = generic_retval_printout(retval) self.pw.dlog(f"Received Mode Reply from {obj_id_obj}: Can't reach mode.") for string in string_list: self.pw.dlog(f"Reason: {string}") return True - if tm_packet.subservice == ModeSubservice.TM_WRONG_MODE_REPLY: + if tm_packet.tm.subservice == ModeSubservice.TM_WRONG_MODE_REPLY: self.pw.dlog(f"Received Mode TM wrong mode reply, mode: {tm_packet.mode}") return False From 8419a4edd773eb0eedba912f4678a5e28567e3ed Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 23 May 2024 14:45:10 +0200 Subject: [PATCH 2/4] some more fixes --- eive_tmtc/pus_tm/pus_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eive_tmtc/pus_tm/pus_handler.py b/eive_tmtc/pus_tm/pus_handler.py index e6d9d7a..ccd09f9 100644 --- a/eive_tmtc/pus_tm/pus_handler.py +++ b/eive_tmtc/pus_tm/pus_handler.py @@ -109,7 +109,7 @@ class PusHandler(SpecificApidHandlerBase): elif service == 20: self._handle_param_packet(packet, tm_packet) elif service == 200: - dedicated_handler = self._handle_mode_packet(packet, tm_packet) + dedicated_handler = self._handle_mode_packet(tm_packet) else: _LOGGER.info( f"The service {service} is not implemented in Telemetry Factory" @@ -207,6 +207,7 @@ class PusHandler(SpecificApidHandlerBase): return True if tm_packet.tm.subservice == ModeSubservice.TM_WRONG_MODE_REPLY: self.pw.dlog(f"Received Mode TM wrong mode reply, mode: {tm_packet.mode}") + return True return False From 652f3bf66f5801e2a3def24b2ae88b6068146685 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 23 May 2024 17:40:55 +0200 Subject: [PATCH 3/4] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a586baf..4824b68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ list yields a list of all related PRs for each release. # [unreleased] +## Fixed + +- Use new mode TM API. + # [v7.0.0] 2024-05-06 - Reworked PLOC MPSoC commanding to be inline with OBSW update. From 20489a02d2ab07fb0104f5cff9681c350aca610e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 23 May 2024 19:00:51 +0200 Subject: [PATCH 4/4] fix for future versions of tmtccmd --- eive_tmtc/config/hook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eive_tmtc/config/hook.py b/eive_tmtc/config/hook.py index 864b264..46617f4 100644 --- a/eive_tmtc/config/hook.py +++ b/eive_tmtc/config/hook.py @@ -52,7 +52,7 @@ from eive_tmtc.tmtc.wdt import create_wdt_node class EiveHookObject(HookBase): def __init__(self, json_cfg_path: str): - super().__init__(json_cfg_path=json_cfg_path) + super().__init__(json_cfg_path) def get_command_definitions(self) -> CmdTreeNode: root_node = CmdTreeNode.root_node()