From 811786fd78d5953956a8abba1c10c18c6e494422 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 5 Mar 2024 11:43:18 +0100 Subject: [PATCH 1/3] update leap seconds act cmd --- eive_tmtc/tmtc/core.py | 98 ++++++------------------------------------ 1 file changed, 14 insertions(+), 84 deletions(-) diff --git a/eive_tmtc/tmtc/core.py b/eive_tmtc/tmtc/core.py index a1db863..70f53f4 100644 --- a/eive_tmtc/tmtc/core.py +++ b/eive_tmtc/tmtc/core.py @@ -71,6 +71,7 @@ class ActionId(enum.IntEnum): RM_HELPER = 54 MKDIR_HELPER = 55 ENABLE_SCHEDULER = 56 + UPDATE_LEAP_SECONRS = 60 class ParamId(enum.IntEnum): @@ -122,6 +123,7 @@ class OpCode: AUTO_SWITCH_DISABLE = "auto_switch_disable" ENABLE_SCHEDULER = "enable_scheduler" DISABLE_SCHEDULER = "disable_scheduler" + UPDATE_LEAP_SECONDS = "leap_seconds_update" class Info: @@ -165,6 +167,7 @@ class Info: AUTO_SWITCH_DISABLE = "Disable Auto-Switch Feature" ENABLE_SCHEDULER = "Enable scheduler" DISABLE_SCHEDULER = "Disable scheduler" + UPDATE_LEAP_SECONDS = "Updates the Leap Seconds" class Chip(enum.IntEnum): @@ -197,90 +200,6 @@ def create_core_node() -> CmdTreeNode: return node -@tmtc_definitions_provider -def add_core_controller_definitions(defs: TmtcDefinitionWrapper): - oce = OpCodeEntry() - oce.add(keys=OpCode.ANNOUNCE_VERSION, info=Info.ANNOUNCE_VERSION) - oce.add(keys=OpCode.ANNOUNCE_CURRENT_IMAGE, info=Info.ANNOUNCE_CURRENT_IMAGE) - oce.add(keys=OpCode.ANNOUNCE_BOOT_COUNTS, info=Info.ANNOUNCE_BOOT_COUNTS) - oce.add(keys=OpCode.REBOOT_XSC, info=Info.REBOOT_XSC) - oce.add(keys=OpCode.REBOOT_XSC, info=Info.REBOOT_XSC) - oce.add(keys=OpCode.REBOOT_FULL, info=Info.REBOOT_FULL) - oce.add(keys=OpCode.XSC_REBOOT_SELF, info="Reboot Self") - oce.add(keys=OpCode.XSC_REBOOT_0_0, info="Reboot 0 0") - oce.add(keys=OpCode.XSC_REBOOT_0_1, info="Reboot 0 1") - oce.add(keys=OpCode.XSC_REBOOT_1_0, info="Reboot 1 0") - oce.add(keys=OpCode.XSC_REBOOT_1_1, info="Reboot 1 1") - oce.add(keys=OpCode.SET_PREF_SD, info=Info.SET_PREF_SD) - oce.add( - keys=OpCode.READ_REBOOT_MECHANISM_INFO, info=Info.READ_REBOOT_MECHANISM_INFO - ) - oce.add(keys=OpCode.OBSW_UPDATE_FROM_TMP, info=Info.OBSW_UPDATE_FROM_TMP) - oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_0, info=Info.OBSW_UPDATE_FROM_SD_0) - oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_1, info=Info.OBSW_UPDATE_FROM_SD_1) - oce.add(keys=OpCode.AUTO_SWITCH_ENABLE, info=Info.AUTO_SWITCH_ENABLE) - oce.add(keys=OpCode.AUTO_SWITCH_DISABLE, info=Info.AUTO_SWITCH_DISABLE) - oce.add(keys=OpCode.SYSTEMCTL_CMD_EXECUTOR, info=Info.SYSTEMCTL_CMD_EXECUTOR) - oce.add( - keys=OpCode.EXECUTE_SHELL_CMD_BLOCKING, info=Info.EXECUTE_SHELL_CMD_BLOCKING - ) - oce.add( - keys=OpCode.EXECUTE_SHELL_CMD_NON_BLOCKING, - info=Info.EXECUTE_SHELL_CMD_NON_BLOCKING, - ) - oce.add( - keys=OpCode.GET_HK, - info="Request housekeeping set", - ) - oce.add( - keys=OpCode.ENABLE_REBOOT_FILE_HANDLING, - info="Enable reboot file handling", - ) - oce.add( - keys=OpCode.DISABLE_REBOOT_FILE_HANDLING, - info="Disable reboot file handling", - ) - oce.add( - keys=OpCode.RESET_ALL_REBOOT_COUNTERS, - info="Reset all reboot counters", - ) - oce.add( - keys=OpCode.RWD_RESET_REBOOT_COUNTER_00, - info="Reset reboot counter 0 0", - ) - oce.add( - keys=OpCode.RWD_RESET_REBOOT_COUNTER_01, - info="Reset reboot counter 0 1", - ) - oce.add( - keys=OpCode.RWD_RESET_REBOOT_COUNTER_10, - info="Reset reboot counter 1 0", - ) - oce.add( - keys=OpCode.RWD_RESET_REBOOT_COUNTER_11, - info="Reset reboot counter 1 1", - ) - oce.add( - keys=OpCode.RWD_SET_MAX_REBOOT_CNT, - info="Reset max reboot count for reboot watchdog", - ) - oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_0, info=Info.OBSW_UPDATE_FROM_SD_0) - oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_1, info=Info.OBSW_UPDATE_FROM_SD_1) - oce.add(keys=OpCode.OBSW_UPDATE_FROM_TMP, info=Info.OBSW_UPDATE_FROM_TMP) - oce.add(keys=OpCode.SWITCH_TO_SD_0, info=Info.SWITCH_TO_SD_0) - oce.add(keys=OpCode.SWITCH_TO_SD_1, info=Info.SWITCH_TO_SD_1) - oce.add(keys=OpCode.SWITCH_TO_BOTH_SD_CARDS, info=Info.SWITCH_TO_BOTH_SD_CARDS) - oce.add(keys=OpCode.LIST_DIR_INTO_FILE, info=Info.LIST_DIR_INTO_FILE) - oce.add(keys=OpCode.LIST_DIR_DUMP_DIRECTLY, info=Info.LIST_DIR_DUMP_DIRECTLY) - oce.add(keys=OpCode.MV_HELPER, info=Info.MV_HELPER) - oce.add(keys=OpCode.CP_HELPER, info=Info.CP_HELPER) - oce.add(keys=OpCode.RM_HELPER, info=Info.RM_HELPER) - oce.add(keys=OpCode.MKDIR_HELPER, info=Info.MKDIR_HELPER) - oce.add(keys=OpCode.ENABLE_SCHEDULER, info=Info.ENABLE_SCHEDULER) - oce.add(keys=OpCode.DISABLE_SCHEDULER, info=Info.DISABLE_SCHEDULER) - defs.add_service(CustomServiceList.CORE.value, "Core Controller", oce) - - def pack_core_commands( # noqa C901 q: DefaultPusQueueHelper, cmd_str: str ): # noqa: C901 , complexity okay here @@ -557,6 +476,17 @@ def pack_core_commands( # noqa C901 elif cmd_str == OpCode.DISABLE_SCHEDULER: q.add_log_cmd(Info.DISABLE_SCHEDULER) q.add_pus_tc(create_disable_tc_sched_cmd()) + elif cmd_str == OpCode.UPDATE_LEAP_SECONDS: + q.add_log_cmd(Info.UPDATE_LEAP_SECONDS) + leap_seconds = int(input("Specify new Leap Seconds Value: ")).to_bytes( + length=2, signed=False, byteorder="big" + ) + print(leap_seconds) + q.add_pus_tc( + create_action_cmd( + CORE_CONTROLLER_ID, ActionId.UPDATE_LEAP_SECONRS, leap_seconds + ) + ) else: _LOGGER.warning( f"Unknown operation code {cmd_str} for core controller commands" -- 2.43.0 From 40c2a4b1f31e63bb17c1420fe930c505d61cdedb Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 5 Mar 2024 11:53:00 +0100 Subject: [PATCH 2/3] remove printout --- eive_tmtc/tmtc/core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/eive_tmtc/tmtc/core.py b/eive_tmtc/tmtc/core.py index 70f53f4..369e30e 100644 --- a/eive_tmtc/tmtc/core.py +++ b/eive_tmtc/tmtc/core.py @@ -481,7 +481,6 @@ def pack_core_commands( # noqa C901 leap_seconds = int(input("Specify new Leap Seconds Value: ")).to_bytes( length=2, signed=False, byteorder="big" ) - print(leap_seconds) q.add_pus_tc( create_action_cmd( CORE_CONTROLLER_ID, ActionId.UPDATE_LEAP_SECONRS, leap_seconds -- 2.43.0 From 89202f2cfe70c09168540892f25489a3fca08cb1 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 6 Mar 2024 09:51:03 +0100 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91a34f2..38e6908 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ list yields a list of all related PRs for each release. # [unreleased] +## Added + +- Added Core Ctrl cmd to update leap seconds. + # [v6.1.0] 2024-02-29 ## Added -- 2.43.0