diff --git a/.idea/runConfigurations/ccsds_handler.xml b/.idea/runConfigurations/ccsds_handler.xml
index 7c6d714..5e506bb 100644
--- a/.idea/runConfigurations/ccsds_handler.xml
+++ b/.idea/runConfigurations/ccsds_handler.xml
@@ -6,16 +6,16 @@
-
+
-
+
-
+
diff --git a/.idea/runConfigurations/pdec_handler.xml b/.idea/runConfigurations/pdec_handler.xml
index 5a2f222..cedb49e 100644
--- a/.idea/runConfigurations/pdec_handler.xml
+++ b/.idea/runConfigurations/pdec_handler.xml
@@ -6,9 +6,9 @@
-
+
-
+
diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py
index 5dff327..47d39ee 100644
--- a/pus_tc/cmd_definitions.py
+++ b/pus_tc/cmd_definitions.py
@@ -461,6 +461,10 @@ def add_rad_sens_cmds(cmd_dict: ServiceOpCodeDictT):
"0": ("Radiation Sensor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Radiation Sensor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Radiation Sensor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("Radiation Sensor: Start conversions", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("Radiation Sensor: Read conversions", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": ("Radiation Sensor: Enable debug output", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "6": ("Radiation Sensor: Disable debug putput", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_rad_sensor_tuple = ("Radiation Sensor", op_code_dict_srv_rad_sensor)
cmd_dict[CustomServiceList.RAD_SENSOR.value] = service_rad_sensor_tuple
diff --git a/pus_tc/devs/rad_sensor.py b/pus_tc/devs/rad_sensor.py
index 2dbee43..4216a23 100644
--- a/pus_tc/devs/rad_sensor.py
+++ b/pus_tc/devs/rad_sensor.py
@@ -5,6 +5,8 @@
@author J. Meier
@date 01.07.2021
"""
+import struct
+
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
@@ -12,6 +14,13 @@ from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data
+class CommandIds:
+ START_CONVERSIONS = 2
+ READ_CONVERSIONS = 3
+ ENABLE_DEBUG_OUTPUT = 4
+ DISABLE_DEBUG_OUTPUT = 5
+
+
def pack_rad_sensor_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
tc_queue.appendleft(
(
@@ -37,3 +46,27 @@ def pack_rad_sensor_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
mode_data = pack_mode_data(object_id, 0, 0)
command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "3":
+ tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Start conversions"))
+ command = object_id + struct.pack('!I', CommandIds.START_CONVERSIONS)
+ command = PusTelecommand(service=8, subservice=128, ssc=43, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "4":
+ tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Read conversions"))
+ command = object_id + struct.pack('!I', CommandIds.READ_CONVERSIONS)
+ command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "5":
+ tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Enable debug output"))
+ command = object_id + struct.pack('!I', CommandIds.ENABLE_DEBUG_OUTPUT)
+ command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "6":
+ tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Disable debug output"))
+ command = object_id + struct.pack('!I', CommandIds.DISABLE_DEBUG_OUTPUT)
+ command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())