36 lines
1.4 KiB
Python
36 lines
1.4 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""
|
|
@file tmtcc_tc_service200_mode.py
|
|
@brief PUS Service 200: PUS custom service 200: Mode commanding
|
|
@author R. Mueller
|
|
@date 02.05.2020
|
|
"""
|
|
from spacepackets.ecss.tc import PusTelecommand
|
|
from tmtccmd.tc import DefaultPusQueueHelper
|
|
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
|
|
from config.object_ids import TEST_DEVICE_ID
|
|
|
|
TEST_DEVICE_OBJ_ID = TEST_DEVICE_ID
|
|
|
|
|
|
def pack_service200_test_into(q: DefaultPusQueueHelper):
|
|
q.add_log_cmd("Testing Service 200")
|
|
# Object ID: Dummy Device
|
|
obj_id = TEST_DEVICE_OBJ_ID
|
|
# Set On Mode
|
|
q.add_log_cmd("Testing Service 200: Set Mode On")
|
|
mode_data = pack_mode_data(obj_id, Modes.ON, 0)
|
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
|
|
# Set Normal mode
|
|
q.add_log_cmd("Testing Service 200: Set Mode Normal")
|
|
mode_data = pack_mode_data(obj_id, Modes.NORMAL, 0)
|
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
|
|
# Set Raw Mode
|
|
q.add_log_cmd("Testing Service 200: Set Mode Raw")
|
|
mode_data = pack_mode_data(obj_id, Modes.RAW, 0)
|
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
|
|
# Set Off Mode
|
|
q.add_log_cmd("Testing Service 200: Set Mode Off")
|
|
mode_data = pack_mode_data(obj_id, Modes.OFF, 0)
|
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
|