Merge pull request 'Transmitter Timeout Param Command' (#138) from meier/com-ss into main
Reviewed-on: #138 Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
This commit is contained in:
commit
336ed58272
@ -21,9 +21,14 @@ from tmtccmd.tc.pus_20_fsfw_param import (
|
||||
pack_scalar_u8_parameter_app_data,
|
||||
)
|
||||
|
||||
from tmtccmd.pus.s20_fsfw_param_defs import (
|
||||
create_scalar_u32_parameter
|
||||
)
|
||||
|
||||
|
||||
class ParameterId(enum.IntEnum):
|
||||
DATARATE = 0
|
||||
TRANSMITTER_TIMEOUT = 1
|
||||
|
||||
|
||||
class Submode(enum.IntEnum):
|
||||
@ -42,6 +47,7 @@ class OpCode:
|
||||
TX_AND_RX_CARRIER_WAVE = "rx_and_tx_carrier_wave"
|
||||
UPDATE_DEFAULT_DATARATE_LOW = "update_default_rate_low"
|
||||
UPDATE_DEFAULT_DATARATE_HIGH = "update_default_rate_high"
|
||||
CHANGE_TRANSMITTER_TIMEOUT = "change_transmitter_timeout"
|
||||
READ_MODE = "read_mode"
|
||||
ANNOUNCE_MODE = "announce_mode"
|
||||
ANNOUNCE_MODE_RECURSIVE = "announce_mode_recursive"
|
||||
@ -55,6 +61,7 @@ class Info:
|
||||
TX_AND_RX_CARRIER_WAVE = "Syrlinks with TX carrier wave"
|
||||
UPDATE_DEFAULT_DATARATE_LOW = "Configure default low datarate (BPSK modulation)"
|
||||
UPDATE_DEFAULT_DATARATE_HIGH = "Configure default high datarate (0QPSK modulation)"
|
||||
CHANGE_TRANSMITTER_TIMEOUT = "Changes the transmitter timeout"
|
||||
READ_MODE = "Read Mode"
|
||||
ANNOUNCE_MODE = "Announce Mode"
|
||||
ANNOUNCE_MODE_RECURSIVE = "Announce mode recursively"
|
||||
@ -112,6 +119,19 @@ def build_com_subsystem_cmd(p: ServiceProviderParams):
|
||||
q.add_pus_tc(
|
||||
create_mode_command(COM_SUBSYSTEM_ID, Submode.RX_AND_TX_CARRIER_WAVE, 0)
|
||||
)
|
||||
elif o == OpCode.CHANGE_TRANSMITTER_TIMEOUT:
|
||||
timeout = int(input("Specify timeout to set [ms]: "))
|
||||
q.add_log_cmd(Info.CHANGE_TRANSMITTER_TIMEOUT)
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_u32_parameter(
|
||||
COM_SUBSYSTEM_ID,
|
||||
0,
|
||||
ParameterId.TRANSMITTER_TIMEOUT,
|
||||
timeout,
|
||||
).pack()
|
||||
)
|
||||
)
|
||||
elif o == OpCode.READ_MODE:
|
||||
q.add_log_cmd(Info.READ_MODE)
|
||||
q.add_pus_tc(create_read_mode_command(COM_SUBSYSTEM_ID))
|
||||
@ -132,6 +152,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.UPDATE_DEFAULT_DATARATE_LOW, Info.UPDATE_DEFAULT_DATARATE_LOW)
|
||||
oce.add(OpCode.UPDATE_DEFAULT_DATARATE_HIGH, Info.UPDATE_DEFAULT_DATARATE_HIGH)
|
||||
oce.add(OpCode.CHANGE_TRANSMITTER_TIMEOUT, Info.CHANGE_TRANSMITTER_TIMEOUT)
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user