update power commands

This commit is contained in:
2022-08-24 11:24:25 +02:00
parent 85a113986e
commit 71aa79528e
11 changed files with 48 additions and 45 deletions

View File

@ -4,7 +4,7 @@ from config.definitions import CustomServiceList
from tmtccmd.config import TmtcDefinitionWrapper
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd
from tmtccmd.logging import get_console_logger
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
@ -125,7 +125,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.REBOOT_FULL:
q.add_log_cmd(f"Core Command: {Info.REBOOT_FULL}")
q.add_pus_tc(
generate_action_command(
make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.FULL_REBOOT
)
)
@ -156,7 +156,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.DISABLE_REBOOT_FILE_HANDLING:
q.add_log_cmd("Disabling reboot file handling")
app_data = bytearray([0])
generate_action_command(
make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID,
action_id=ActionIds.SWITCH_REBOOT_FILE_HANDLING,
app_data=app_data,
@ -164,34 +164,34 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.ENABLE_REBOOT_FILE_HANDLING:
q.add_log_cmd("Enabling reboot file handling")
app_data = bytearray([1])
generate_action_command(
make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID,
action_id=ActionIds.SWITCH_REBOOT_FILE_HANDLING,
app_data=app_data,
)
if op_code in OpCodes.RESET_ALL_REBOOT_COUNTERS:
q.add_log_cmd("Resetting all reboot counters")
generate_action_command(
make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_ALL_REBOOT_COUNTERS
)
if op_code in OpCodes.RESET_REBOOT_COUNTER_00:
q.add_log_cmd("Resetting reboot counter 0 0")
generate_action_command(
make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_00
)
if op_code in OpCodes.RESET_REBOOT_COUNTER_01:
q.add_log_cmd("Resetting reboot counter 0 1")
generate_action_command(
make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_01
)
if op_code in OpCodes.RESET_REBOOT_COUNTER_10:
q.add_log_cmd("Resetting reboot counter 1 0")
generate_action_command(
make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_10
)
if op_code in OpCodes.RESET_REBOOT_COUNTER_11:
q.add_log_cmd("Resetting reboot counter 1 1")
generate_action_command(
make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_11
)
if op_code in OpCodes.GET_HK:
@ -247,7 +247,7 @@ def perform_reboot_cmd(
tc_data.append(copy)
q.add_log_cmd(f"Packing reboot command for chip {chip} and copy {copy}")
q.add_pus_tc(
generate_action_command(
make_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID,
action_id=ActionIds.XSC_REBOOT,
app_data=tc_data,