STR Extensions #244

Merged
muellerr merged 22 commits from str-extensions into main 2023-10-27 12:24:10 +02:00
Showing only changes of commit 9567146ff8 - Show all commits

View File

@ -268,10 +268,14 @@ def pack_star_tracker_commands( # noqa C901
request_dataset(q, DataSetRequest.DISABLE) request_dataset(q, DataSetRequest.DISABLE)
if op_code == OpCodes.ADD_SECONDARY_TM_TO_NORMAL_MODE: if op_code == OpCodes.ADD_SECONDARY_TM_TO_NORMAL_MODE:
q.add_log_cmd(Info.ADD_SECONDARY_TM_TO_NORMAL_MODE) q.add_log_cmd(Info.ADD_SECONDARY_TM_TO_NORMAL_MODE)
add_secondary_tm_to_normal_mode_tc() q.add_pus_tc(add_secondary_tm_to_normal_mode_tc())
if op_code == OpCodes.READ_SECONDARY_TM_SET: if op_code == OpCodes.READ_SECONDARY_TM_SET:
q.add_log_cmd(Info.READ_SECONDARY_TM_SET) q.add_log_cmd(Info.READ_SECONDARY_TM_SET)
add_read_secondary_tm_set_tc() q.add_pus_tc(
create_action_cmd(
STAR_TRACKER_ID, StarTrackerActionId.READ_SECONDARY_TM_SET
)
)
if op_code == OpCodes.RESET_SECONDARY_TM_SET: if op_code == OpCodes.RESET_SECONDARY_TM_SET:
q.add_log_cmd(Info.RESET_SECONDARY_TM_SET) q.add_log_cmd(Info.RESET_SECONDARY_TM_SET)
q.add_pus_tc( q.add_pus_tc(
@ -1160,3 +1164,13 @@ def add_str_cmds(defs: TmtcDefinitionWrapper):
oce.add(OpCodes.FW_UPDATE, Info.FW_UPDATE) oce.add(OpCodes.FW_UPDATE, Info.FW_UPDATE)
oce.add(OpCodes.SET_TIME_FROM_SYS_TIME, Info.SET_TIME_FROM_SYS_TIME) oce.add(OpCodes.SET_TIME_FROM_SYS_TIME, Info.SET_TIME_FROM_SYS_TIME)
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce) defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
def add_secondary_tm_to_normal_mode_tc() -> PusTelecommand:
# TODO: Add device command ID prompt and add it to user data.
device_id = 0
return create_action_cmd(
STAR_TRACKER_ID,
StarTrackerActionId.ADD_SECONDARY_TM_TO_NORMAL_MODE,
user_data=struct.pack("!I", device_id),
)