set time ref as proper cmd

This commit is contained in:
Robin Müller 2022-11-17 15:48:22 +01:00
parent d5813e1a42
commit f730ff4180
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -125,6 +125,7 @@ class OpCodes:
START_MPSOC = ["5", "start_mpsoc"]
SHUTDOWN_MPSOC = ["6", "stop_mpsoc"]
SEL_NVM = ["7", "sel_nvm"]
SET_TIME_REF = ["set_time_ref"]
REQ_BOOT_STATUS_REPORT = ["13", "boot_report"]
START_UPDATE = ["42", "start_update"]
PERFORM_UPDATE = ["update"]
@ -138,6 +139,7 @@ class Info(str, enum.Enum):
NML = "Switch Normal"
HK_TO_OBC = "Request HK from PLOC SUPV"
REQUEST_HK = "Request HK set from PLOC Handler"
SET_TIME_REF = "Set time reference"
PERFORM_UPDATE = "Start or continue MPSoC SW update at starting bytes"
START_UPDATE = "Start new MPSoC SW update"
REQ_BOOT_STATUS_REPORT = "Request boot status report and HK"
@ -157,9 +159,9 @@ def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper):
oce.add(OpCodes.START_MPSOC, "PLOC Supervisor: Start MPSoC")
oce.add(OpCodes.SHUTDOWN_MPSOC, "PLOC Supervisor: Shutdown MPSoC")
oce.add(OpCodes.SEL_NVM, Info.SEL_NVM)
oce.add(OpCodes.SET_TIME_REF, Info.SET_TIME_REF)
oce.add("8", "PLOC Supervisor: Set max restart tries")
oce.add("9", "PLOC Supervisor: Reset MPSoC")
oce.add("10", "PLOC Supervisor: Set time reference")
oce.add("11", "PLOC Supervisor: Set boot timeout")
oce.add("12", "PLOC Supervisor: Disable Hk")
oce.add(OpCodes.REQ_BOOT_STATUS_REPORT, Info.REQ_BOOT_STATUS_REPORT)
@ -257,7 +259,7 @@ def pack_ploc_supv_commands(p: ServiceProviderParams):
q.add_log_cmd("PLOC Supervisor: Reset MPSoC")
command = object_id.as_bytes + struct.pack("!I", SupvActionIds.RESET_MPSOC)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "10":
if op_code in OpCodes.SET_TIME_REF:
q.add_log_cmd("PLOC Supervisor: Set time reference")
command = object_id.as_bytes + struct.pack("!I", SupvActionIds.SET_TIME_REF)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))