add mode cmds for COM SS

This commit is contained in:
Robin Müller 2023-02-08 01:29:38 +01:00
parent 8a96e21d1a
commit 78c3b7dd93
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -10,7 +10,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_200_fsfw_mode import create_mode_command from tmtccmd.tc.pus_200_fsfw_mode import create_mode_command, create_read_mode_command, create_announce_mode_command, create_announce_mode_recursive_command
from tmtccmd.tc.pus_20_fsfw_param import ( from tmtccmd.tc.pus_20_fsfw_param import (
create_load_param_cmd, create_load_param_cmd,
pack_scalar_u8_parameter_app_data, pack_scalar_u8_parameter_app_data,
@ -37,6 +37,9 @@ class OpCode:
TX_AND_RX_CARRIER_WAVE = "rx_and_tx_carrier_wave" TX_AND_RX_CARRIER_WAVE = "rx_and_tx_carrier_wave"
UPDATE_DEFAULT_DATARATE_LOW = "update_default_rate_low" UPDATE_DEFAULT_DATARATE_LOW = "update_default_rate_low"
UPDATE_DEFAULT_DATARATE_HIGH = "update_default_rate_high" UPDATE_DEFAULT_DATARATE_HIGH = "update_default_rate_high"
READ_MODE = "read_mode"
ANNOUNCE_MODE = "announce_mode"
ANNOUNCE_MODE_RECURSIVE = "announce_mode_recursive"
class Info: class Info:
@ -47,6 +50,9 @@ class Info:
TX_AND_RX_CARRIER_WAVE = "Syrlinks with TX carrier wave" TX_AND_RX_CARRIER_WAVE = "Syrlinks with TX carrier wave"
UPDATE_DEFAULT_DATARATE_LOW = "Configure default low datarate (BPSK modulation)" UPDATE_DEFAULT_DATARATE_LOW = "Configure default low datarate (BPSK modulation)"
UPDATE_DEFAULT_DATARATE_HIGH = "Configure default high datarate (0QPSK modulation)" UPDATE_DEFAULT_DATARATE_HIGH = "Configure default high datarate (0QPSK modulation)"
READ_MODE = "Read Mode"
ANNOUNCE_MODE = "Announce Mode"
ANNOUNCE_MODE_RECURSIVE = "Announce mode recursively"
@service_provider(CustomServiceList.COM_SS) @service_provider(CustomServiceList.COM_SS)
@ -101,6 +107,15 @@ def build_com_subsystem_cmd(p: ServiceProviderParams):
q.add_pus_tc( q.add_pus_tc(
create_mode_command(COM_SUBSYSTEM_ID, Submode.RX_AND_TX_CARRIER_WAVE, 0) create_mode_command(COM_SUBSYSTEM_ID, Submode.RX_AND_TX_CARRIER_WAVE, 0)
) )
elif o == OpCode.READ_MODE:
q.add_log_cmd(Info.READ_MODE)
q.add_pus_tc(create_read_mode_command(COM_SUBSYSTEM_ID))
elif o == OpCode.ANNOUNCE_MODE:
q.add_log_cmd(Info.ANNOUNCE_MODE)
q.add_pus_tc(create_announce_mode_command(COM_SUBSYSTEM_ID))
elif o == OpCode.ANNOUNCE_MODE_RECURSIVE:
q.add_log_cmd(Info.ANNOUNCE_MODE_RECURSIVE)
q.add_pus_tc(create_announce_mode_recursive_command(COM_SUBSYSTEM_ID))
@tmtc_definitions_provider @tmtc_definitions_provider
@ -112,4 +127,7 @@ def add_com_subsystem_cmds(defs: TmtcDefinitionWrapper):
oce.add(OpCode.TX_AND_RX_DEF_RATE, Info.TX_AND_RX_DEF_DATARATE) oce.add(OpCode.TX_AND_RX_DEF_RATE, Info.TX_AND_RX_DEF_DATARATE)
oce.add(OpCode.UPDATE_DEFAULT_DATARATE_LOW, Info.UPDATE_DEFAULT_DATARATE_LOW) oce.add(OpCode.UPDATE_DEFAULT_DATARATE_LOW, Info.UPDATE_DEFAULT_DATARATE_LOW)
oce.add(OpCode.UPDATE_DEFAULT_DATARATE_HIGH, Info.UPDATE_DEFAULT_DATARATE_HIGH) oce.add(OpCode.UPDATE_DEFAULT_DATARATE_HIGH, Info.UPDATE_DEFAULT_DATARATE_HIGH)
oce.add(OpCode.READ_MODE, Info.READ_MODE)
oce.add(OpCode.ANNOUNCE_MODE, Info.ANNOUNCE_MODE)
oce.add(OpCode.ANNOUNCE_MODE_RECURSIVE, Info.ANNOUNCE_MODE_RECURSIVE)
defs.add_service(CustomServiceList.COM_SS, "COM Subsystem", oce) defs.add_service(CustomServiceList.COM_SS, "COM Subsystem", oce)