2022-05-27 11:53:57 +02:00
|
|
|
from typing import Union
|
|
|
|
|
2022-03-22 19:29:55 +01:00
|
|
|
from tmtccmd.tc.definitions import TcQueueT, QueueCommands
|
|
|
|
from spacepackets.ecss.tc import PusTelecommand
|
2022-05-05 16:15:53 +02:00
|
|
|
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes, Subservices
|
2022-03-22 19:29:55 +01:00
|
|
|
|
|
|
|
|
2022-05-17 10:41:45 +02:00
|
|
|
def command_mode(
|
2022-05-27 11:53:57 +02:00
|
|
|
object_id: bytes,
|
|
|
|
mode: Union[int, Modes],
|
|
|
|
submode: int,
|
|
|
|
tc_queue: TcQueueT,
|
|
|
|
info: str,
|
2022-03-22 19:29:55 +01:00
|
|
|
):
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, info))
|
|
|
|
mode_data = pack_mode_data(
|
|
|
|
object_id=object_id,
|
|
|
|
mode=mode,
|
|
|
|
submode=submode,
|
|
|
|
)
|
|
|
|
cmd = PusTelecommand(
|
2022-05-05 16:15:53 +02:00
|
|
|
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=mode_data
|
2022-03-22 19:29:55 +01:00
|
|
|
)
|
|
|
|
tc_queue.appendleft(cmd.pack_command_tuple())
|