diff --git a/.idea/runConfigurations/PDU1_Commanding.xml b/.idea/runConfigurations/PDU1_Commanding.xml
index d8b7855..00c3379 100644
--- a/.idea/runConfigurations/PDU1_Commanding.xml
+++ b/.idea/runConfigurations/PDU1_Commanding.xml
@@ -6,7 +6,7 @@
-
+
diff --git a/.idea/runConfigurations/Star_Tracker.xml b/.idea/runConfigurations/Star_Tracker.xml
new file mode 100644
index 0000000..937313e
--- /dev/null
+++ b/.idea/runConfigurations/Star_Tracker.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/ccsds_handler.xml b/.idea/runConfigurations/ccsds_handler.xml
new file mode 100644
index 0000000..47a9e6d
--- /dev/null
+++ b/.idea/runConfigurations/ccsds_handler.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/pdec_handler.xml b/.idea/runConfigurations/pdec_handler.xml
new file mode 100644
index 0000000..5a2f222
--- /dev/null
+++ b/.idea/runConfigurations/pdec_handler.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index d2d00a0..6544b82 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -154,12 +154,12 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
("PDU1: Turn ACS Side A on", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.ACS_A_SIDE_OFF.value:
("PDU1: Turn ACS Side A off", {OpCodeDictKeys.TIMEOUT: 2.0}),
- GomspaceOpCodes.PRINT_SWITCH_V_I.value:
- ("PDU1: Print Switches, Voltages, Currents", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.SYRLINKS_ON.value:
("PDU1: Turn Syrlinks on", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.SYRLINKS_OFF.value:
("PDU1: Turn Syrlinks off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ GomspaceOpCodes.PRINT_SWITCH_V_I.value:
+ ("PDU1: Print Switches, Voltages, Currents", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
@@ -291,7 +291,10 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
"6": ("Star Tracker: Subscribe to telemetry", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": ("Star Tracker: Boot image (requires bootloader mode)", {OpCodeDictKeys.TIMEOUT: 2.0}),
"8": ("Star Tracker: Request time", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "9": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0})
+ "9": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "10": ("Star Tracker: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "11": ("Star Tracker: Download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "12": ("Star Tracker: Limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)
@@ -320,11 +323,6 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
}
service_syrlinks_handler_tuple = ("Syrlinks Handler", op_code_dict_srv_syrlinks_handler)
- op_code_dict_srv_str_img_helper = {
- "0": ("Star Tracker Image Helper: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
- }
- service_str_img_helper_tuple = ("PDEC Handler", op_code_dict_srv_str_img_helper)
-
service_op_code_dict[CustomServiceList.P60DOCK.value] = service_p60_tuple
service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu1_tuple
service_op_code_dict[CustomServiceList.PDU2.value] = service_pdu2_tuple
@@ -341,5 +339,4 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
service_op_code_dict[CustomServiceList.PLOC_MEMORY_DUMPER.value] = service_ploc_memory_dumper_tuple
service_op_code_dict[CustomServiceList.CCSDS_HANDLER.value] = service_ccsds_handler_tuple
service_op_code_dict[CustomServiceList.PDEC_HANDLER.value] = service_pdec_handler_tuple
- service_op_code_dict[CustomServiceList.STR_IMG_HELPER.value] = service_str_img_helper_tuple
service_op_code_dict[CustomServiceList.SYRLINKS.value] = service_syrlinks_handler_tuple
diff --git a/pus_tc/star_tracker.py b/pus_tc/star_tracker.py
index aa36b74..21ff070 100644
--- a/pus_tc/star_tracker.py
+++ b/pus_tc/star_tracker.py
@@ -21,9 +21,17 @@ class StarTrackerActionIds:
REQ_TIME = 4
REQ_POWER = 11
REBOOT = 7
+ DOWNLOAD_IMAGE = 9
+ UPLOAD_IMAGE = 10
SUBSCRIBE_TO_TM = 18
REQ_SOLUTION = 24
REQ_TEMPERATURE = 25
+ LIMITS = 40
+
+
+class ImagePathDefs:
+ uploadFile = "/mnt/sd0/startracker/gemma.bin"
+ jsonFile = "/mnt/sd0/startracker/full.json"
def pack_star_tracker_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
@@ -83,3 +91,20 @@ def pack_star_tracker_commands(object_id: bytearray, tc_queue: TcQueueT, op_code
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_SOLUTION)
command = PusTelecommand(service=8, subservice=128, ssc=39, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "10":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Upload image"))
+ command = object_id + struct.pack('!I', StarTrackerActionIds.UPLOAD_IMAGE) + \
+ bytearray(ImagePathDefs.uploadFile, 'utf-8')
+ command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "11":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download image"))
+ command = object_id + struct.pack('!I', StarTrackerActionIds.DOWNLOAD_IMAGE)
+ command = PusTelecommand(service=8, subservice=128, ssc=41, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "12":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set limits"))
+ command = object_id + struct.pack('!I', StarTrackerActionIds.LIMITS) + \
+ bytearray(ImagePathDefs.jsonFile, 'utf-8')
+ command = PusTelecommand(service=8, subservice=128, ssc=41, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())