Skip to content
Snippets Groups Projects
Commit 9015042a authored by Robin.Mueller's avatar Robin.Mueller
Browse files

rebuilding srv3 test

parent 71eb59d2
Branches
No related tags found
No related merge requests found
......@@ -11,15 +11,17 @@ from tmtc_core.tc.obsw_pus_tc_base import PusTelecommand
import config.obsw_config as g
def make_sid(set_id: int, object_id: bytearray) -> bytearray:
def make_sid(object_id: bytearray, set_id: int) -> bytearray:
set_id_bytearray = struct.pack(">I", set_id)
return object_id + set_id_bytearray
def make_interval(interval_seconds: float) -> bytearray:
return bytearray(struct.pack(">f", interval_seconds))
# adding custom defintion to hk using test pool variables
sid_thermalsensor = make_sid(0, g.THERMAL_SENSOR_DEVICE_ID)
collection_interval_hk = struct.pack('>f', 3)
collection_interval_diag = struct.pack('>f', 0.8)
sid_thermalsensor = make_sid(g.THERMAL_SENSOR_DEVICE_ID, 1)
number_of_parameters = struct.pack('>B', 5)
......@@ -32,11 +34,35 @@ def pack_service3_test_into(tc_queue: Deque) -> Deque:
tc_queue.appendleft(("export", "log/tmtc_log_service3.txt"))
return tc_queue
def pack_custom_tests(tc_queue: Deque):
# deleting pre-defined test entry
tc_queue.appendleft(("print", "Testing Service 3: "))
command = PusTelecommand(service=3, subservice=3, ssc=3100, app_data=sid_thermalsensor)
tc_queue.appendleft(("print", "Generate one Thermal Sensor packet: "))
command = PusTelecommand(service=3, subservice=27, ssc=3100, app_data=sid_thermalsensor)
tc_queue.appendleft(command.pack_command_tuple())
# tc_queue.appendleft(("print", "Enabling periodic Thermal Sensor packet generation: "))
# command = PusTelecommand(service=3, subservice=5, ssc=3101, app_data=sid_thermalsensor)
# tc_queue.appendleft(command.pack_command_tuple())
#
# new_interval = 1.0
# interval_app_data = sid_thermalsensor + make_interval(new_interval)
# tc_queue.appendleft(("print", "Setting interval to one second: "))
# command = PusTelecommand(service=3, subservice=31, ssc=3102, app_data=interval_app_data)
# tc_queue.appendleft(command.pack_command_tuple())
#
# tc_queue.appendleft(("wait", 2))
#
# tc_queue.appendleft(("print", "Disabling periodic Thermal Sensor packet generation: "))
# command = PusTelecommand(service=3, subservice=6, ssc=3103, app_data=sid_thermalsensor)
# tc_queue.appendleft(command.pack_command_tuple())
#
# tc_queue.appendleft(("print", "Generate one shot Thermal Sensor packet: "))
# command = PusTelecommand(service=3, subservice=27, ssc=3104, app_data=sid_thermalsensor)
# tc_queue.appendleft(command.pack_command_tuple())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment