eive-tmtc/pus_tc/pdec_handler.py

28 lines
927 B
Python
Raw Normal View History

2021-11-24 15:56:25 +01:00
# -*- coding: utf-8 -*-
"""
@file pdec_handler.py
@brief Test commanding of PDEC Handler
@author J. Meier
@date 22.11.2021
"""
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
class CommandIds:
# prints the clcw to the console. Useful for debugging
PRINT_CLCW = bytearray([0x0, 0x0, 0x0, 0x0])
def pack_pdec_handler_test(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
tc_queue.appendleft(
(QueueCommands.PRINT,
"Testing PDEC handler with object id: 0x" + object_id.hex())
)
if op_code == "0":
tc_queue.appendleft((QueueCommands.PRINT, "PDEC Handler: Print CLCW"))
command = object_id + CommandIds.PRINT_CLCW
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())