eive-tmtc/eive_tmtc/pus_tc/service_200_mode.py

36 lines
1.4 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-10-01 10:55:56 +02:00
from spacepackets.ecss.tc import PusTelecommand
2022-08-08 16:32:18 +02:00
from tmtccmd.tc import DefaultPusQueueHelper
2023-01-31 12:56:13 +01:00
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
2022-11-29 16:53:29 +01:00
from eive_tmtc.config.object_ids import TEST_DEVICE_ID
2021-01-10 11:42:06 +01:00
2021-03-19 18:03:41 +01:00
TEST_DEVICE_OBJ_ID = TEST_DEVICE_ID
2021-01-10 11:42:06 +01:00
2022-08-12 22:33:16 +02:00
def pack_service_200_test_into(q: DefaultPusQueueHelper):
2022-07-04 15:22:53 +02:00
q.add_log_cmd("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
2022-07-04 15:22:53 +02:00
q.add_log_cmd("Testing Service 200: Set Mode On")
2023-01-16 15:05:33 +01:00
mode_data = pack_mode_data(obj_id, Mode.ON, 0)
2022-07-04 15:22:53 +02:00
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
2021-01-10 11:42:06 +01:00
# Set Normal mode
2022-07-04 15:22:53 +02:00
q.add_log_cmd("Testing Service 200: Set Mode Normal")
2023-01-16 15:05:33 +01:00
mode_data = pack_mode_data(obj_id, Mode.NORMAL, 0)
2022-07-04 15:22:53 +02:00
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
2021-01-10 11:42:06 +01:00
# Set Raw Mode
2022-07-04 15:22:53 +02:00
q.add_log_cmd("Testing Service 200: Set Mode Raw")
2023-01-16 15:05:33 +01:00
mode_data = pack_mode_data(obj_id, Mode.RAW, 0)
2022-07-04 15:22:53 +02:00
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
2021-01-10 11:42:06 +01:00
# Set Off Mode
2022-07-04 15:22:53 +02:00
q.add_log_cmd("Testing Service 200: Set Mode Off")
2023-01-16 15:05:33 +01:00
mode_data = pack_mode_data(obj_id, Mode.OFF, 0)
2022-07-04 15:22:53 +02:00
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))