eive-tmtc/pus_tc/service_200_mode.py

43 lines
1.9 KiB
Python
Raw Normal View History

2021-01-10 11:42:06 +01:00
# -*- 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
"""
2021-03-19 17:39:52 +01:00
from tmtccmd.core.definitions import QueueCommands
from tmtccmd.pus_tc.base import PusTelecommand
from tmtccmd.pus_tc.packer import TcQueueT
from tmtccmd.pus_tc.service_200_mode import pack_mode_data
2021-03-19 18:01:17 +01:00
from config.object_ids import TEST_DEVICE
2021-01-10 11:42:06 +01:00
2021-03-19 18:01:17 +01:00
TEST_DEVICE_OBJ_ID = TEST_DEVICE
2021-01-10 11:42:06 +01:00
def pack_service200_test_into(tc_queue: TcQueueT) -> TcQueueT:
2021-02-03 14:14:54 +01:00
tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200"))
2021-01-10 11:42:06 +01:00
# Object ID: Dummy Device
2021-03-19 18:01:17 +01:00
obj_id = TEST_DEVICE_OBJ_ID
2021-01-10 11:42:06 +01:00
# Set On Mode
2021-02-03 14:14:54 +01:00
tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode On"))
2021-03-19 18:01:17 +01:00
mode_data = pack_mode_data(obj_id, 1, 0)
2021-01-10 11:42:06 +01:00
command = PusTelecommand(service=200, subservice=1, ssc=2000, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
# Set Normal mode
2021-02-03 14:14:54 +01:00
tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode Normal"))
2021-03-19 18:01:17 +01:00
mode_data = pack_mode_data(obj_id, 2, 0)
2021-01-10 11:42:06 +01:00
command = PusTelecommand(service=200, subservice=1, ssc=2010, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
# Set Raw Mode
2021-02-03 14:14:54 +01:00
tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode Raw"))
2021-03-19 18:01:17 +01:00
mode_data = pack_mode_data(obj_id, 3, 0)
2021-01-10 11:42:06 +01:00
command = PusTelecommand(service=200, subservice=1, ssc=2020, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
# Set Off Mode
2021-02-03 14:14:54 +01:00
tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode Off"))
2021-03-19 18:01:17 +01:00
mode_data = pack_mode_data(obj_id, 0, 0)
2021-01-10 11:42:06 +01:00
command = PusTelecommand(service=200, subservice=1, ssc=2030, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
2021-02-03 14:14:54 +01:00
tc_queue.appendleft((QueueCommands.EXPORT_LOG, "log/tmtc_log_service200.txt"))
2021-01-10 11:42:06 +01:00
return tc_queue