diff --git a/eive_tmtc/tmtc/syrlinks_hk_handler.py b/eive_tmtc/tmtc/syrlinks_hk_handler.py index 003234b..fe259e4 100644 --- a/eive_tmtc/tmtc/syrlinks_hk_handler.py +++ b/eive_tmtc/tmtc/syrlinks_hk_handler.py @@ -19,6 +19,8 @@ from tmtccmd.tc import DefaultPusQueueHelper from tmtccmd.tc.pus_3_fsfw_hk import ( make_sid, create_request_one_diag_command, + create_enable_periodic_hk_command_with_interval, + create_disable_periodic_hk_command, ) from spacepackets.ecss.tc import PusTelecommand from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Mode @@ -42,6 +44,8 @@ class OpCode: SET_CW = "set_tx_carrier_wave" MODULATION = "modulation" HK_RX_REGS = "hk_rx_regs" + ENABLE_HK_RX_REGS = "enable_hk_rx" + DISABLE_HK_RX_REGS = "disable_hk_rx" HK_TX_REGS = "hk_tx_regs" TX_STATUS = "tx_status" RX_STATUS = "rx_status" @@ -50,6 +54,9 @@ class OpCode: class Info: HK_RX_REGS = "Request RX register set" HK_TX_REGS = "Request TX register set" + ENABLE_HK_RX_REGS = "Enable periodic RX register HK" + DISABLE_HK_RX_REGS = "Disable periodic RX register HK" + EMABLE_HK_TX_REGS = "Enable periodic TX register HK" TX_STATUS = "Read TX status (always read in normal mode)" RX_STATUS = "Read RX status (always read in normal mode)" SET_CW = "Set TX carrier wave" @@ -86,6 +93,8 @@ def add_syrlinks_cmds(defs: TmtcDefinitionWrapper): oce.add(OpCode.SET_CW, Info.SET_CW) oce.add(OpCode.TX_STATUS, Info.TX_STATUS) oce.add(OpCode.RX_STATUS, Info.RX_STATUS) + oce.add(OpCode.ENABLE_HK_RX_REGS, Info.ENABLE_HK_RX_REGS) + oce.add(OpCode.DISABLE_HK_RX_REGS, Info.DISABLE_HK_RX_REGS) oce.add("7", "Syrlinks Handler: Read TX waveform") oce.add("8", "Syrlinks Handler: Read TX AGC value high byte") oce.add("9", "Syrlinks Handler: Read TX AGC value low byte") @@ -133,6 +142,16 @@ def pack_syrlinks_command( q.add_log_cmd(f"{prefix}: {Info.HK_RX_REGS}") sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET) q.add_pus_tc(create_request_one_diag_command(sid)) + if op_code in OpCode.ENABLE_HK_RX_REGS: + q.add_log_cmd(f"{prefix}: {Info.ENABLE_HK_RX_REGS}") + sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET) + cmds = create_enable_periodic_hk_command_with_interval(True, sid, 2.0) + for cmd in cmds: + q.add_pus_tc(cmd) + if op_code in OpCode.DISABLE_HK_RX_REGS: + q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_RX_REGS}") + sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET) + q.add_pus_tc(create_disable_periodic_hk_command(True, sid)) if op_code in OpCode.HK_TX_REGS: q.add_log_cmd(f"{prefix}: {Info.HK_TX_REGS}") sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET) diff --git a/eive_tmtc/tmtc/tcs.py b/eive_tmtc/tmtc/tcs.py index 0d0b7ea..3641d2f 100644 --- a/eive_tmtc/tmtc/tcs.py +++ b/eive_tmtc/tmtc/tcs.py @@ -41,9 +41,7 @@ class InfoSys: OFF = "Switch TCS subsystem OFF" NML = "Switch TCS subsystem NORMAL (nominal)" REQUEST_PRIMARY_TEMP_SET = "Request HK set of primary sensor temperatures" - REQUEST_DEVICE_TEMP_SET = ( - "Request HK set of device sensor temperatures" - ) + REQUEST_DEVICE_TEMP_SET = "Request HK set of device sensor temperatures" REQUEST_DEVICE_SUS_SET = "Request HK set of the SUS temperatures"