api update done

This commit is contained in:
2022-07-05 02:12:54 +02:00
parent 4a654857ce
commit e009167784
41 changed files with 547 additions and 1104 deletions

View File

@ -3,9 +3,10 @@ from typing import Optional
from config.definitions import CustomServiceList
from pus_tc.devs.pdec_handler import CommandIds
from spacepackets.ecss import PusTelecommand
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.tc import QueueHelper
from tmtccmd.utility import ObjectId
from tmtccmd.utility import ObjectIdU32
from tmtccmd.tc.pus_200_fsfw_modes import Modes, pack_mode_data, Subservices
import config.object_ids as oids
from config.object_ids import get_object_ids
@ -44,20 +45,17 @@ class Info:
WIRTE_CONFIG = "Write config"
def specify_rtd_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict = dict()
add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.ON, info=Info.ON)
add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.NORMAL, info=Info.NORMAL)
add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.OFF, info=Info.OFF)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
op_code_entry=op_code_dict,
name=CustomServiceList.RTD.value,
info="RTD commands",
def specify_rtd_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.ON, info=Info.ON)
oce.add(keys=OpCodes.NORMAL, info=Info.NORMAL)
oce.add(keys=OpCodes.OFF, info=Info.OFF)
defs.add_service(
name=CustomServiceList.RTD.value, info="RTD commands", op_code_entry=oce
)
def pack_rtd_commands(op_code: str, object_id: Optional[ObjectId], q: QueueHelper):
def pack_rtd_commands(op_code: str, object_id: Optional[ObjectIdU32], q: QueueHelper):
if object_id is not None and object_id not in RTD_IDS:
print("Specified object ID not a valid RTD ID")
object_id = None