diff --git a/eive_tmtc/tmtc/power/common_power.py b/eive_tmtc/tmtc/power/common_power.py index 021a86c..224b7f9 100644 --- a/eive_tmtc/tmtc/power/common_power.py +++ b/eive_tmtc/tmtc/power/common_power.py @@ -10,6 +10,7 @@ from eive_tmtc.gomspace.gomspace_common import ( pack_request_config_command, pack_gnd_wdt_reset_command, ParamTypes, + pack_reboot_command, ) from eive_tmtc.gomspace.gomspace_pdu_definitions import OUT_ENABLE_LIST from spacepackets.ecss import PusTelecommand @@ -33,6 +34,7 @@ class GomspaceOpCodes: RESET_GND_WATCHDOG = ["reset_gnd_wdt"] SAVE_TABLE_DEFAULT = ["save_table_default"] LOAD_TABLE = ["load_table"] + REBOOT = ["reboot"] REQUEST_CONFIG_TABLE = ["cfg_table"] @@ -44,6 +46,7 @@ class GsInfo: SAVE_TABLE = "Save table non-volatile (file)" SAVE_TABLE_DEFAULT = "Save table non-volatile (default)" LOAD_TABLE = "Load Table" + REBOOT = "Reboot PCDU module" class PowerInfo: @@ -96,6 +99,7 @@ class PowerOpCodes: PL_CAM_ON = ["cam_on"] PL_CAM_OFF = ["cam_off"] + REBOOT = ["reboot"] INFO_CORE = ["info"] ENABLE_INFO_HK = ["info_hk_on"] DISABLE_INFO_HK = ["info_hk_off"] @@ -143,6 +147,9 @@ def pack_common_gomspace_cmds( object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I ) ) + if op_code in PowerOpCodes.REBOOT: + q.add_log_cmd(f"{prefix}: {GsInfo.REBOOT}") + q.add_pus_tc(pack_reboot_command(object_id)) if op_code in PowerOpCodes.PRINT_LATCHUPS: q.add_log_cmd(f"{prefix}: {PowerInfo.PRINT_LATCHUPS}") q.add_pus_tc( @@ -306,6 +313,7 @@ def add_gomspace_cmd_defs(oce: OpCodeEntry): ) oce.add(keys=PowerOpCodes.PRINT_LATCHUPS, info=PowerInfo.PRINT_LATCHUPS) oce.add(keys=GomspaceOpCodes.GET_PARAM, info=GsInfo.GET_PARAMETER) + oce.add(keys=GomspaceOpCodes.REBOOT, info=GsInfo.REBOOT) oce.add(keys=GomspaceOpCodes.SET_INTEGER_PARAM, info=GsInfo.SET_PARAMETER) oce.add(keys=GomspaceOpCodes.REQUEST_CONFIG_TABLE, info=GsInfo.REQUEST_CONFIG_TABLE) oce.add(keys=GomspaceOpCodes.SAVE_TABLE, info=GsInfo.SAVE_TABLE)