changes for updated tmtccmd

This commit is contained in:
Robin Müller 2023-01-18 11:12:07 +01:00
parent b032defa7c
commit 4a02e284b3
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
13 changed files with 70 additions and 70 deletions

View File

@ -3,7 +3,7 @@ import os
from eive_tmtc import EIVE_TMTC_ROOT from eive_tmtc import EIVE_TMTC_ROOT
from tmtccmd import get_console_logger from tmtccmd import get_console_logger
from tmtccmd.fsfw import parse_fsfw_events_csv from tmtccmd.fsfw import parse_fsfw_events_csv
from tmtccmd.pus.pus_5_event import EventDictT from tmtccmd.pus.s5_event import EventDictT
LOGGER = get_console_logger() LOGGER = get_console_logger()
DEFAULT_EVENTS_CSV_PATH = EIVE_TMTC_ROOT / "config/events.csv" DEFAULT_EVENTS_CSV_PATH = EIVE_TMTC_ROOT / "config/events.csv"

View File

@ -12,7 +12,7 @@ from typing import Union
from spacepackets.ecss import PusTelecommand from spacepackets.ecss import PusTelecommand
from tmtccmd.tc import DefaultPusQueueHelper from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd from tmtccmd.tc.pus_8_fsfw_funccmd import create_fsfw_action_cmd
from tmtccmd.util import ObjectIdU32, ObjectIdBase from tmtccmd.util import ObjectIdU32, ObjectIdBase
@ -63,7 +63,7 @@ class Channel:
def pack_request_config_command(object_id: bytes) -> PusTelecommand: def pack_request_config_command(object_id: bytes) -> PusTelecommand:
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id, action_id=GomspaceDeviceActionIds.REQUEST_CONFIG_TABLE object_id=object_id, action_id=GomspaceDeviceActionIds.REQUEST_CONFIG_TABLE
) )
@ -88,7 +88,7 @@ def pack_get_param_command(
else: else:
app_data += memory_address app_data += memory_address
app_data += struct.pack("!B", parameter_size) app_data += struct.pack("!B", parameter_size)
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id, object_id=object_id,
action_id=GomspaceDeviceActionIds.PARAM_GET, action_id=GomspaceDeviceActionIds.PARAM_GET,
user_data=app_data, user_data=app_data,
@ -103,7 +103,7 @@ def pack_set_float_param_command(
app_data += memory_address app_data += memory_address
app_data.append(4) app_data.append(4)
app_data += struct.pack("!f", parameter) app_data += struct.pack("!f", parameter)
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id, action_id=action_id, user_data=app_data object_id=object_id, action_id=action_id, user_data=app_data
) )
@ -116,7 +116,7 @@ def pack_set_u8_param_command(
app_data += memory_address app_data += memory_address
app_data.append(1) app_data.append(1)
app_data.append(parameter) app_data.append(parameter)
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id, action_id=action_id, user_data=app_data object_id=object_id, action_id=action_id, user_data=app_data
) )
@ -129,7 +129,7 @@ def pack_set_i8_param_command(
app_data += memory_address app_data += memory_address
app_data.append(1) app_data.append(1)
app_data += struct.pack("!b", parameter) app_data += struct.pack("!b", parameter)
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id, action_id=action_id, user_data=app_data object_id=object_id, action_id=action_id, user_data=app_data
) )
@ -142,7 +142,7 @@ def pack_set_u16_param_command(
app_data += memory_address app_data += memory_address
app_data.append(2) app_data.append(2)
app_data += struct.pack("!H", parameter) app_data += struct.pack("!H", parameter)
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id, action_id=action_id, user_data=app_data object_id=object_id, action_id=action_id, user_data=app_data
) )
@ -155,7 +155,7 @@ def pack_set_i16_param_command(
app_data += memory_address app_data += memory_address
app_data.append(2) app_data.append(2)
app_data += struct.pack("!h", parameter) app_data += struct.pack("!h", parameter)
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id, action_id=action_id, user_data=app_data object_id=object_id, action_id=action_id, user_data=app_data
) )
@ -166,7 +166,7 @@ def pack_set_u32_param_command(object_id: bytes, memory_address: bytes, paramete
app_data += memory_address app_data += memory_address
app_data.append(4) app_data.append(4)
app_data += struct.pack("!I", parameter) app_data += struct.pack("!I", parameter)
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id, action_id=action_id, user_data=app_data object_id=object_id, action_id=action_id, user_data=app_data
) )
@ -177,7 +177,7 @@ def pack_set_i32_param_command(object_id: bytes, memory_address: bytes, paramete
app_data += memory_address app_data += memory_address
app_data.append(4) app_data.append(4)
app_data += struct.pack("!i", parameter) app_data += struct.pack("!i", parameter)
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id, action_id=action_id, user_data=app_data object_id=object_id, action_id=action_id, user_data=app_data
) )
@ -224,7 +224,7 @@ def pack_ping_command(object_id: ObjectIdU32, data: bytearray) -> PusTelecommand
@note The ping request sends the specified data to a gompsace device. These @note The ping request sends the specified data to a gompsace device. These
data are simply copied by the device and then sent back. data are simply copied by the device and then sent back.
""" """
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id.as_bytes, object_id=object_id.as_bytes,
action_id=GomspaceDeviceActionIds.PING, action_id=GomspaceDeviceActionIds.PING,
user_data=data, user_data=data,
@ -235,7 +235,7 @@ def pack_gnd_wdt_reset_command(object_id: ObjectIdBase) -> PusTelecommand:
""" " Function to generate the command to reset the watchdog of a gomspace device. """ " Function to generate the command to reset the watchdog of a gomspace device.
@param object_id Object Id of the gomspace device handler. @param object_id Object Id of the gomspace device handler.
""" """
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.WDT_RESET object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.WDT_RESET
) )
@ -244,7 +244,7 @@ def pack_reboot_command(object_id: ObjectIdU32) -> PusTelecommand:
"""Function to generate the command which triggers a reboot of a gomspace device """Function to generate the command which triggers a reboot of a gomspace device
@param object_id The object id of the gomspace device handler. @param object_id The object id of the gomspace device handler.
""" """
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.REBOOT object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.REBOOT
) )
@ -254,6 +254,6 @@ def pack_request_full_hk_table_command(object_id: ObjectIdU32) -> PusTelecommand
device. device.
@param object_id The object id of the gomspace device handler. @param object_id The object id of the gomspace device handler.
""" """
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.REQUEST_HK_TABLE object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.REQUEST_HK_TABLE
) )

View File

@ -9,7 +9,7 @@ from tmtccmd.config.tmtc import (
) )
from tmtccmd.tc import service_provider from tmtccmd.tc import service_provider
from tmtccmd.tc.decorator import ServiceProviderParams from tmtccmd.tc.decorator import ServiceProviderParams
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd from tmtccmd.tc.pus_8_fsfw_funccmd import create_fsfw_action_cmd
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
from tmtccmd.tc.pus_200_fsfw_modes import Subservices as ModeSubservices from tmtccmd.tc.pus_200_fsfw_modes import Subservices as ModeSubservices
@ -87,14 +87,14 @@ def pack_bpx_commands(p: ServiceProviderParams):
if op_code in BpxOpCodes.RST_BOOT_CNT: if op_code in BpxOpCodes.RST_BOOT_CNT:
q.add_log_cmd("Resetting reboot counters") q.add_log_cmd("Resetting reboot counters")
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=BPX_HANDLER_ID, action_id=BpxActionIds.RESET_COUNTERS object_id=BPX_HANDLER_ID, action_id=BpxActionIds.RESET_COUNTERS
) )
) )
if op_code in BpxOpCodes.REQUEST_CFG: if op_code in BpxOpCodes.REQUEST_CFG:
q.add_log_cmd("Requesting configuration struct") q.add_log_cmd("Requesting configuration struct")
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=BPX_HANDLER_ID, action_id=BpxActionIds.GET_CFG object_id=BPX_HANDLER_ID, action_id=BpxActionIds.GET_CFG
) )
) )
@ -105,7 +105,7 @@ def pack_bpx_commands(p: ServiceProviderParams):
if op_code in BpxOpCodes.REBOOT: if op_code in BpxOpCodes.REBOOT:
q.add_log_cmd("Rebooting BPX battery") q.add_log_cmd("Rebooting BPX battery")
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=BPX_HANDLER_ID, action_id=BpxActionIds.REBOOT object_id=BPX_HANDLER_ID, action_id=BpxActionIds.REBOOT
) )
) )

View File

@ -16,7 +16,7 @@ from tmtccmd.tc.pus_201_fsfw_health import (
FsfwHealth, FsfwHealth,
Subservices, Subservices,
) )
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd from tmtccmd.tc.pus_8_fsfw_funccmd import create_fsfw_action_cmd
from spacepackets.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
@ -200,6 +200,6 @@ def pack_switch_heater_command(
command.append(switch_nr) command.append(switch_nr)
command.append(switch_action) command.append(switch_action)
command.append(COMMAND_SOURCE_PARAM_EXTERNAL) command.append(COMMAND_SOURCE_PARAM_EXTERNAL)
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=object_id, action_id=ActionIds.SWITCH_HEATER, user_data=command object_id=object_id, action_id=ActionIds.SWITCH_HEATER, user_data=command
) )

View File

@ -15,8 +15,8 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
disable_periodic_hk_command, disable_periodic_hk_command,
) )
from tmtccmd.tc.pus_11_tc_sched import ( from tmtccmd.tc.pus_11_tc_sched import (
generate_enable_tc_sched_cmd, create_enable_tc_sched_cmd,
generate_time_tagged_cmd, create_time_tagged_cmd,
) )
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes, Subservices from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes, Subservices
from tmtccmd.tc.pus_20_params import ( from tmtccmd.tc.pus_20_params import (
@ -312,50 +312,50 @@ def hpa_on_procedure(q: DefaultPusQueueHelper):
) )
current_time = time.time() current_time = time.time()
enb_sched = generate_enable_tc_sched_cmd() enb_sched = create_enable_tc_sched_cmd()
sched_time = int(round(current_time + 10)) sched_time = int(round(current_time + 10))
q.add_pus_tc(enb_sched) q.add_pus_tc(enb_sched)
tagged_on_cmd = generate_time_tagged_cmd( tagged_on_cmd = create_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), release_time=struct.pack("!I", sched_time),
tc_to_insert=pl_pcdu_on, tc_to_insert=pl_pcdu_on,
) )
q.add_pus_tc(tagged_on_cmd) q.add_pus_tc(tagged_on_cmd)
sched_time += 5 sched_time += 5
tagged_ssr_cmd = generate_time_tagged_cmd( tagged_ssr_cmd = create_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), release_time=struct.pack("!I", sched_time),
tc_to_insert=ssr_on, tc_to_insert=ssr_on,
) )
q.add_pus_tc(tagged_ssr_cmd) q.add_pus_tc(tagged_ssr_cmd)
sched_time += 5 sched_time += 5
tagged_dro_cmd = generate_time_tagged_cmd( tagged_dro_cmd = create_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), tc_to_insert=dro_on release_time=struct.pack("!I", sched_time), tc_to_insert=dro_on
) )
q.add_pus_tc(tagged_dro_cmd) q.add_pus_tc(tagged_dro_cmd)
sched_time += delay_dro_to_x8 sched_time += delay_dro_to_x8
sched_time = int(round(sched_time)) sched_time = int(round(sched_time))
tagged_x8_cmd = generate_time_tagged_cmd( tagged_x8_cmd = create_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), tc_to_insert=x8_on release_time=struct.pack("!I", sched_time), tc_to_insert=x8_on
) )
q.add_pus_tc(tagged_x8_cmd) q.add_pus_tc(tagged_x8_cmd)
sched_time += 5 sched_time += 5
tagged_tx_cmd = generate_time_tagged_cmd( tagged_tx_cmd = create_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), tc_to_insert=tx_on release_time=struct.pack("!I", sched_time), tc_to_insert=tx_on
) )
q.add_pus_tc(tagged_tx_cmd) q.add_pus_tc(tagged_tx_cmd)
sched_time += 5 sched_time += 5
tagged_mpa_cmd = generate_time_tagged_cmd( tagged_mpa_cmd = create_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), tc_to_insert=mpa_on release_time=struct.pack("!I", sched_time), tc_to_insert=mpa_on
) )
q.add_pus_tc(tagged_mpa_cmd) q.add_pus_tc(tagged_mpa_cmd)
sched_time += 5 sched_time += 5
tagged_hpa_cmd = generate_time_tagged_cmd( tagged_hpa_cmd = create_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), tc_to_insert=hpa_on release_time=struct.pack("!I", sched_time), tc_to_insert=hpa_on
) )
q.add_pus_tc(tagged_hpa_cmd) q.add_pus_tc(tagged_hpa_cmd)

View File

@ -8,7 +8,7 @@ from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc.pus_200_fsfw_modes import Modes, pack_mode_data, Subservices from tmtccmd.tc.pus_200_fsfw_modes import Modes, pack_mode_data, Subservices
from tmtccmd.tc import service_provider from tmtccmd.tc import service_provider
from tmtccmd.tc.decorator import ServiceProviderParams from tmtccmd.tc.decorator import ServiceProviderParams
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd from tmtccmd.tc.pus_8_fsfw_funccmd import create_fsfw_action_cmd
from tmtccmd.config import OpCodeEntry, TmtcDefinitionWrapper from tmtccmd.config import OpCodeEntry, TmtcDefinitionWrapper
from eive_tmtc.config.object_ids import SCEX_HANDLER_ID from eive_tmtc.config.object_ids import SCEX_HANDLER_ID
@ -99,23 +99,23 @@ def pack_scex_cmds(p: ServiceProviderParams):
if op_code in OpCodes.PING: if op_code in OpCodes.PING:
q.add_log_cmd(Info.PING) q.add_log_cmd(Info.PING)
app_data = bytes([0]) app_data = bytes([0])
q.add_pus_tc(make_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.PING, app_data)) q.add_pus_tc(create_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.PING, app_data))
if op_code in OpCodes.ION_CMD: if op_code in OpCodes.ION_CMD:
q.add_log_cmd(Info.ION_CMD) q.add_log_cmd(Info.ION_CMD)
app_data = bytes([0]) app_data = bytes([0])
q.add_pus_tc(make_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.ION_CMD, app_data)) q.add_pus_tc(create_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.ION_CMD, app_data))
if op_code in OpCodes.TEMP_CMD: if op_code in OpCodes.TEMP_CMD:
q.add_log_cmd(Info.TEMP_CMD) q.add_log_cmd(Info.TEMP_CMD)
app_data = bytes([0]) app_data = bytes([0])
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.TEMP_CMD, app_data) create_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.TEMP_CMD, app_data)
) )
if op_code in OpCodes.EXP_STATUS_CMD: if op_code in OpCodes.EXP_STATUS_CMD:
q.add_log_cmd(Info.EXP_STATUS_CMD) q.add_log_cmd(Info.EXP_STATUS_CMD)
app_data = bytes([0]) app_data = bytes([0])
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.EXP_STATUS_CMD, app_data) create_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.EXP_STATUS_CMD, app_data)
) )
# one cell # one cell
@ -164,7 +164,7 @@ def pack_scex_cmds(p: ServiceProviderParams):
app_data.append(dac_weight3[cn]) app_data.append(dac_weight3[cn])
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.ONE_CELLS_CMD, app_data) create_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.ONE_CELLS_CMD, app_data)
) )
if op_code in OpCodes.ALL_CELLS_CMD: if op_code in OpCodes.ALL_CELLS_CMD:
@ -196,13 +196,13 @@ def pack_scex_cmds(p: ServiceProviderParams):
app_data.append(dac_weight3[cn]) app_data.append(dac_weight3[cn])
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.ALL_CELLS_CMD, app_data) create_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.ALL_CELLS_CMD, app_data)
) )
if op_code in OpCodes.FRAM: if op_code in OpCodes.FRAM:
q.add_log_cmd(Info.FRAM) q.add_log_cmd(Info.FRAM)
app_data = bytes([0]) app_data = bytes([0])
q.add_pus_tc(make_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.FRAM, app_data)) q.add_pus_tc(create_fsfw_action_cmd(SCEX_HANDLER_ID, ActionIds.FRAM, app_data))
def append_16_bit_val(packet: bytearray, val: int): def append_16_bit_val(packet: bytearray, val: int):

View File

@ -20,7 +20,7 @@ from tmtccmd.tc.decorator import (
from tmtccmd.tc.pus_5_event import ( from tmtccmd.tc.pus_5_event import (
pack_generic_service_5_test_into, pack_generic_service_5_test_into,
) )
from tmtccmd.pus.pus_17_test import pack_service_17_ping_command from tmtccmd.pus.s17_test import pack_service_17_ping_command
from eive_tmtc.pus_tc.service_200_mode import pack_service_200_test_into from eive_tmtc.pus_tc.service_200_mode import pack_service_200_test_into
from eive_tmtc.tmtc.power.p60dock import pack_p60dock_cmds from eive_tmtc.tmtc.power.p60dock import pack_p60dock_cmds

View File

@ -5,7 +5,7 @@ from spacepackets.ecss import PusTelecommand
from tmtccmd.config import TmtcDefinitionWrapper from tmtccmd.config import TmtcDefinitionWrapper
from tmtccmd.tc import DefaultPusQueueHelper from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd from tmtccmd.tc.pus_8_fsfw_funccmd import create_fsfw_action_cmd
from tmtccmd.logging import get_console_logger from tmtccmd.logging import get_console_logger
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
@ -150,7 +150,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.REBOOT_FULL: if op_code in OpCodes.REBOOT_FULL:
q.add_log_cmd(f"Core Command: {Info.REBOOT_FULL}") q.add_log_cmd(f"Core Command: {Info.REBOOT_FULL}")
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.FULL_REBOOT object_id=CORE_CONTROLLER_ID, action_id=ActionIds.FULL_REBOOT
) )
) )
@ -182,7 +182,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
q.add_log_cmd("Disabling reboot file handling") q.add_log_cmd("Disabling reboot file handling")
user_data = bytearray([0]) user_data = bytearray([0])
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, object_id=CORE_CONTROLLER_ID,
action_id=ActionIds.SWITCH_REBOOT_FILE_HANDLING, action_id=ActionIds.SWITCH_REBOOT_FILE_HANDLING,
user_data=user_data, user_data=user_data,
@ -192,7 +192,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
q.add_log_cmd("Enabling reboot file handling") q.add_log_cmd("Enabling reboot file handling")
user_data = bytearray([1]) user_data = bytearray([1])
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, object_id=CORE_CONTROLLER_ID,
action_id=ActionIds.SWITCH_REBOOT_FILE_HANDLING, action_id=ActionIds.SWITCH_REBOOT_FILE_HANDLING,
user_data=user_data, user_data=user_data,
@ -201,7 +201,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.RESET_ALL_REBOOT_COUNTERS: if op_code in OpCodes.RESET_ALL_REBOOT_COUNTERS:
q.add_log_cmd("Resetting all reboot counters") q.add_log_cmd("Resetting all reboot counters")
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, object_id=CORE_CONTROLLER_ID,
action_id=ActionIds.RESET_REBOOT_COUNTER, action_id=ActionIds.RESET_REBOOT_COUNTER,
) )
@ -226,14 +226,14 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.SWITCH_TO_SD_0: if op_code in OpCodes.SWITCH_TO_SD_0:
q.add_log_cmd(Info.SWITCH_TO_SD_0) q.add_log_cmd(Info.SWITCH_TO_SD_0)
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.SWITCH_TO_SD_0 object_id=CORE_CONTROLLER_ID, action_id=ActionIds.SWITCH_TO_SD_0
) )
) )
if op_code in OpCodes.SWITCH_TO_SD_1: if op_code in OpCodes.SWITCH_TO_SD_1:
q.add_log_cmd(Info.SWITCH_TO_SD_1) q.add_log_cmd(Info.SWITCH_TO_SD_1)
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.SWITCH_TO_SD_1 object_id=CORE_CONTROLLER_ID, action_id=ActionIds.SWITCH_TO_SD_1
) )
) )
@ -245,7 +245,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
break break
q.add_log_cmd(Info.SWITCH_TO_BOTH_SD_CARDS) q.add_log_cmd(Info.SWITCH_TO_BOTH_SD_CARDS)
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, object_id=CORE_CONTROLLER_ID,
action_id=ActionIds.SWITCH_TO_BOTH_SD_CARDS, action_id=ActionIds.SWITCH_TO_BOTH_SD_CARDS,
user_data=bytes([active_sd_card]), user_data=bytes([active_sd_card]),
@ -260,7 +260,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
def reset_specific_boot_counter(q: DefaultPusQueueHelper, chip: int, copy: int): def reset_specific_boot_counter(q: DefaultPusQueueHelper, chip: int, copy: int):
q.add_log_cmd(f"Resetting boot counter {chip} {copy}") q.add_log_cmd(f"Resetting boot counter {chip} {copy}")
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, object_id=CORE_CONTROLLER_ID,
action_id=ActionIds.RESET_REBOOT_COUNTER, action_id=ActionIds.RESET_REBOOT_COUNTER,
user_data=bytes([chip, copy]), user_data=bytes([chip, copy]),
@ -306,7 +306,7 @@ def determine_chip_and_copy() -> (int, int):
def pack_obsw_update_cmd(action_id: int) -> PusTelecommand: def pack_obsw_update_cmd(action_id: int) -> PusTelecommand:
chip, copy = determine_chip_and_copy() chip, copy = determine_chip_and_copy()
user_data = bytes([chip, copy]) user_data = bytes([chip, copy])
return make_fsfw_action_cmd( return create_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=action_id, user_data=user_data object_id=CORE_CONTROLLER_ID, action_id=action_id, user_data=user_data
) )
@ -327,7 +327,7 @@ def perform_reboot_cmd(
tc_data.append(copy) tc_data.append(copy)
q.add_log_cmd(f"Packing reboot command for chip {chip} and copy {copy}") q.add_log_cmd(f"Packing reboot command for chip {chip} and copy {copy}")
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=CORE_CONTROLLER_ID, object_id=CORE_CONTROLLER_ID,
action_id=ActionIds.XSC_REBOOT, action_id=ActionIds.XSC_REBOOT,
user_data=tc_data, user_data=tc_data,

View File

@ -12,9 +12,9 @@ from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.decorator import ServiceProviderParams from tmtccmd.tc.decorator import ServiceProviderParams
from tmtccmd.tc.pus_11_tc_sched import ( from tmtccmd.tc.pus_11_tc_sched import (
generate_time_tagged_cmd, create_time_tagged_cmd,
generate_enable_tc_sched_cmd, create_enable_tc_sched_cmd,
generate_reset_tc_sched_cmd, create_reset_tc_sched_cmd,
) )
from tmtccmd.tc.pus_3_fsfw_hk import * from tmtccmd.tc.pus_3_fsfw_hk import *
@ -209,7 +209,7 @@ def pack_generic_hk_listening_cmds(
else: else:
for cmd in disable_cmd_list: for cmd in disable_cmd_list:
q.add_pus_tc( q.add_pus_tc(
generate_time_tagged_cmd( create_time_tagged_cmd(
release_time=struct.pack("!I", int(current_time)), tc_to_insert=cmd release_time=struct.pack("!I", int(current_time)), tc_to_insert=cmd
) )
) )
@ -225,7 +225,7 @@ def pack_proc_commands(q: DefaultPusQueueHelper, op_code: str):
obj_id_dict = get_object_ids() obj_id_dict = get_object_ids()
if op_code in OpCodes.RESET_SCHED: if op_code in OpCodes.RESET_SCHED:
q.add_log_cmd("Resetting/Clearing TC schedule") q.add_log_cmd("Resetting/Clearing TC schedule")
q.add_pus_tc(generate_reset_tc_sched_cmd()) q.add_pus_tc(create_reset_tc_sched_cmd())
if op_code in OpCodes.BAT_FT: if op_code in OpCodes.BAT_FT:
key = KAI.BAT_FT[0] key = KAI.BAT_FT[0]
sid_list.append(make_sid(oids.BPX_HANDLER_ID, BpxSetIds.GET_HK_SET)) sid_list.append(make_sid(oids.BPX_HANDLER_ID, BpxSetIds.GET_HK_SET))
@ -300,7 +300,7 @@ def pack_proc_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.TV_SETUP_TCS_FT_ON: if op_code in OpCodes.TV_SETUP_TCS_FT_ON:
# Enable scheduling # Enable scheduling
q.add_pus_tc(generate_enable_tc_sched_cmd()) q.add_pus_tc(create_enable_tc_sched_cmd())
# check whether tcs_assembly also has to be commanded to NORMAL Mode # check whether tcs_assembly also has to be commanded to NORMAL Mode
pack_tcs_sys_commands(q=q, op_code=TcsOpCodes.TCS_BOARD_ASS_NORMAL[0]) pack_tcs_sys_commands(q=q, op_code=TcsOpCodes.TCS_BOARD_ASS_NORMAL[0])
pack_cmd_ctrl_to_nml(q=q, object_id=obj_id_dict.get(oids.THERMAL_CONTROLLER_ID)) pack_cmd_ctrl_to_nml(q=q, object_id=obj_id_dict.get(oids.THERMAL_CONTROLLER_ID))
@ -736,7 +736,7 @@ def enable_listen_to_hk_for_x_seconds(
) )
for cmd in cmd_tuple: for cmd in cmd_tuple:
q.add_pus_tc(cmd) q.add_pus_tc(cmd)
generate_time_tagged_cmd( create_time_tagged_cmd(
struct.pack("!I", int(round(time.time() + interval_seconds))), struct.pack("!I", int(round(time.time() + interval_seconds))),
gen_disable_listen_to_hk_for_x_seconds(q, diag, device, sid), gen_disable_listen_to_hk_for_x_seconds(q, diag, device, sid),
) )

View File

@ -20,7 +20,7 @@ from tmtccmd.logging import get_console_logger
from tmtccmd.tc import service_provider from tmtccmd.tc import service_provider
from tmtccmd.tc.decorator import ServiceProviderParams from tmtccmd.tc.decorator import ServiceProviderParams
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd from tmtccmd.tc.pus_8_fsfw_funccmd import create_fsfw_action_cmd
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from eive_tmtc.utility.input_helper import InputHelper from eive_tmtc.utility.input_helper import InputHelper
@ -279,7 +279,7 @@ def pack_ploc_supv_commands(p: ServiceProviderParams):
print("Key invalid!") print("Key invalid!")
break break
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=PLOC_SUPV_ID, object_id=PLOC_SUPV_ID,
action_id=SupvActionIds.FACTORY_RESET, action_id=SupvActionIds.FACTORY_RESET,
user_data=bytes([key]), user_data=bytes([key]),
@ -477,7 +477,7 @@ def pack_ploc_supv_commands(p: ServiceProviderParams):
f"{prefix}: {Info.MEM_CHECK} for file {update_file} at memory ID {memory_id} at start " f"{prefix}: {Info.MEM_CHECK} for file {update_file} at memory ID {memory_id} at start "
f"address {start_address}" f"address {start_address}"
) )
command = make_fsfw_action_cmd( command = create_fsfw_action_cmd(
object_id.as_bytes, SupvActionIds.MEM_CHECK, custom_data object_id.as_bytes, SupvActionIds.MEM_CHECK, custom_data
) )
q.add_pus_tc(command) q.add_pus_tc(command)

View File

@ -23,7 +23,7 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
enable_periodic_hk_command_with_interval, enable_periodic_hk_command_with_interval,
disable_periodic_hk_command, disable_periodic_hk_command,
) )
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd from tmtccmd.tc.pus_8_fsfw_funccmd import create_fsfw_action_cmd
from tmtccmd.util import ObjectIdU32, ObjectIdBase from tmtccmd.util import ObjectIdU32, ObjectIdBase
@ -143,7 +143,7 @@ def pack_common_gomspace_cmds(
if op_code in PowerOpCodes.PRINT_SWITCH_V_I: if op_code in PowerOpCodes.PRINT_SWITCH_V_I:
q.add_log_cmd(f"{prefix}: {PowerInfo.PRINT_SWITCH_V_I}") q.add_log_cmd(f"{prefix}: {PowerInfo.PRINT_SWITCH_V_I}")
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
) )
) )
@ -153,7 +153,7 @@ def pack_common_gomspace_cmds(
if op_code in PowerOpCodes.PRINT_LATCHUPS: if op_code in PowerOpCodes.PRINT_LATCHUPS:
q.add_log_cmd(f"{prefix}: {PowerInfo.PRINT_LATCHUPS}") q.add_log_cmd(f"{prefix}: {PowerInfo.PRINT_LATCHUPS}")
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
) )
) )
@ -187,7 +187,7 @@ def pack_common_gomspace_cmds(
)) ))
""" """
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=object_id.as_bytes, object_id=object_id.as_bytes,
action_id=GomspaceDeviceActionIds.SAVE_TABLE, action_id=GomspaceDeviceActionIds.SAVE_TABLE,
user_data=bytes([source_table]), user_data=bytes([source_table]),
@ -202,7 +202,7 @@ def pack_common_gomspace_cmds(
if source_table not in [0, 1, 2]: if source_table not in [0, 1, 2]:
raise ValueError("Invalid source table index") raise ValueError("Invalid source table index")
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=object_id.as_bytes, object_id=object_id.as_bytes,
action_id=GomspaceDeviceActionIds.SAVE_TABLE_DEFAULT, action_id=GomspaceDeviceActionIds.SAVE_TABLE_DEFAULT,
user_data=bytes([source_table]), user_data=bytes([source_table]),
@ -230,7 +230,7 @@ def pack_common_gomspace_cmds(
# Will be ignored # Will be ignored
source_table = 4 source_table = 4
q.add_pus_tc( q.add_pus_tc(
make_fsfw_action_cmd( create_fsfw_action_cmd(
object_id=object_id.as_bytes, object_id=object_id.as_bytes,
action_id=GomspaceDeviceActionIds.LOAD_TABLE, action_id=GomspaceDeviceActionIds.LOAD_TABLE,
user_data=bytes([source_table, target_table]), user_data=bytes([source_table, target_table]),

View File

@ -15,7 +15,7 @@ from tmtccmd.config.tmtc import (
OpCodeEntry, OpCodeEntry,
) )
from tmtccmd.tc import service_provider from tmtccmd.tc import service_provider
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd from tmtccmd.tc.pus_8_fsfw_funccmd import create_fsfw_action_cmd
from tmtccmd.tc.decorator import ServiceProviderParams from tmtccmd.tc.decorator import ServiceProviderParams
from tmtccmd import get_console_logger from tmtccmd import get_console_logger
@ -72,7 +72,7 @@ def pack_solar_array_deployment_test_into(p: ServiceProviderParams):
else: else:
dry_run_str = "" dry_run_str = ""
q.add_log_cmd(f"Testing S/A Deployment with burn time {burn_time}{dry_run_str}") q.add_log_cmd(f"Testing S/A Deployment with burn time {burn_time}{dry_run_str}")
command = make_fsfw_action_cmd( command = create_fsfw_action_cmd(
SOLAR_ARRAY_DEPLOYMENT_ID, ActionIds.MANUAL_DEPLOYMENT, user_data SOLAR_ARRAY_DEPLOYMENT_ID, ActionIds.MANUAL_DEPLOYMENT, user_data
) )
q.add_pus_tc(command) q.add_pus_tc(command)

View File

@ -5,7 +5,7 @@ from tmtccmd.config.tmtc import (
TmtcDefinitionWrapper, TmtcDefinitionWrapper,
OpCodeEntry, OpCodeEntry,
) )
from tmtccmd.pus.pus_17_test import pack_service_17_ping_command from tmtccmd.pus.s17_test import pack_service_17_ping_command
from tmtccmd.tc import service_provider from tmtccmd.tc import service_provider
from tmtccmd.tc.decorator import ServiceProviderParams from tmtccmd.tc.decorator import ServiceProviderParams