diff --git a/config/obsw_config.py b/config/obsw_config.py index 83c2edd08a969e763f0671b48ffcdd8c5d10d6a4..735faf963a210aeb907a02029d0bf7a8d38446a8 100644 --- a/config/obsw_config.py +++ b/config/obsw_config.py @@ -56,6 +56,14 @@ DUMMY_COMMAND_3 = bytearray([0xBA, 0xDE, 0xAF, 0xFE]) # SIDs GPS0_SID = bytearray([0x00, 0x00, 0x1f, 0x00]) GPS1_SID = bytearray([0x00, 0x00, 0x2f, 0x00]) +CUSTOM_SID_1 = bytearray([0x00, 0x00, 0x43, 0x00]) +CUSTOM_SID_2 = bytearray([0x00, 0x00, 0x44, 0x00]) +# Pool IDs +TEST_ID_1 = bytearray([0x01, 0x01, 0x01, 0x02]) +TEST_ID_2 = bytearray([0x02, 0x02, 0x02, 0x04]) +TEST_ID_3 = bytearray([0x03, 0x03, 0x03, 0x06]) +TEST_ID_4 = bytearray([0x04, 0x04, 0x04, 0x08]) +TEST_ID_5 = bytearray([0x05, 0x05, 0x05, 0x10]) """ All global variables, set in main program with arg parser diff --git a/tc/obsw_tc_service3.py b/tc/obsw_tc_service3.py index deb81ca8253b7cf8bce72e677c50ee269b28d116..5b46404e9a15ab8dd1d545398ff5ae8fa5f02755 100644 --- a/tc/obsw_tc_service3.py +++ b/tc/obsw_tc_service3.py @@ -9,21 +9,22 @@ Description: PUS Custom Service 8: Device Access, Native low-level commanding import struct from typing import Deque from tc.obsw_pus_tc_base import PusTelecommand +import config.obsw_config as g def pack_service3_test_into(tc_queue: Deque) -> Deque: tc_queue.appendleft(("print", "Testing Service 3")) # adding custom defintion to hk using test pool variables - sid1 = bytearray([0x00, 0x00, 0x43, 0x00]) - sid2 = bytearray([0x00, 0x00, 0x44, 0x00]) - sid_gps = bytearray([0x00, 0x00, 0x1f, 0x00]) + sid1 = g.CUSTOM_SID_1 + sid2 = g.CUSTOM_SID_2 + sid_gps = g.GPS0_SID collection_interval = struct.pack('>f', 3) - number_of_parameters = struct.pack('B', 5) - p1 = bytearray([0x01, 0x01, 0x01, 0x01]) - p2 = bytearray([0x02, 0x02, 0x02, 0x02]) - p3 = bytearray([0x03, 0x03, 0x03, 0x03]) - p4 = bytearray([0x04, 0x04, 0x04, 0x04]) - p5 = bytearray([0x05, 0x05, 0x05, 0x05]) + number_of_parameters = struct.pack('>B', 5) + p1 = g.TEST_ID_1 + p2 = g.TEST_ID_2 + p3 = g.TEST_ID_3 + p4 = g.TEST_ID_4 + p5 = g.TEST_ID_5 hk_definition1 = sid1 + collection_interval + number_of_parameters + p1 + p2 + p3 + p4 + p5 collection_interval = struct.pack('>f', 6) hk_definition2 = sid2 + collection_interval + number_of_parameters + p1 + p2 + p3 + p4 + p5