added command to request one MGM hk packet

This commit is contained in:
Robin Müller 2022-08-16 11:35:57 +02:00
parent b9cdfdf6c8
commit 37806e428f
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 45 additions and 0 deletions

View File

@ -43,6 +43,7 @@ class CustomServiceList(enum.Enum):
PDEC_HANDLER = "pdec_handler"
STR_IMG_HELPER = "str_img_helper"
SYRLINKS = "syrlinks"
ACS_CTRL = "acs-ctrl"
ACS_ASS = "acs-ass"
SUS_ASS = "sus-ass"
TCS = "tcs"

44
pus_tc/system/acs_ctrl.py Normal file
View File

@ -0,0 +1,44 @@
import enum
from config.definitions import CustomServiceList
from config.object_ids import ACS_CONTROLLER
from tmtccmd.config.tmtc import tmtc_definitions_provider, TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.tc import DefaultPusQueueHelper, service_provider
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
class SetIds(enum.IntEnum):
MGM_SET = 0
class OpCodes:
REQUEST_MGM_HK = ["0", "req-mgm-hk"]
ENABLE_MGM_HK = ["1", "enable-hk"]
DISABLE_MGM_HK = ["1", "enable-hk"]
class Info:
REQUEST_MGM_HK = "Request MGM HK once"
ENABLE_MGM_HK = "Enable MGM HK data generation"
DISABLE_MGM_HK = "Disable MGM HK data generation"
@tmtc_definitions_provider
def acs_cmd_defs(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.REQUEST_MGM_HK, info=Info.REQUEST_MGM_HK)
oce.add(keys=OpCodes.ENABLE_MGM_HK, info=Info.ENABLE_MGM_HK)
oce.add(keys=OpCodes.DISABLE_MGM_HK, info=Info.DISABLE_MGM_HK)
defs.add_service(
name=CustomServiceList.ACS_CTRL.value,
info="ACS Controller",
op_code_entry=oce
)
@service_provider(CustomServiceList.ACS_CTRL.value)
def pack_acs_ctrl_command(q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.REQUEST_MGM_HK:
sid = make_sid(ACS_CONTROLLER, SetIds.MGM_SET)
q.add_log_cmd("Requesting one MGM HK packet")
q.add_pus_tc(generate_one_hk_command(sid))