diff --git a/.gitignore b/.gitignore
index ec6e113..cc672c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,17 +1,10 @@
__pycache__
log
+/gps_log.txt
.idea/*
!.idea/runConfigurations
*.json
-/Lib
-/Scripts
-/pyvenv.cfg
-/bin
-/lib
-/lib64
-/share
-
/venv
diff --git a/.gitmodules b/.gitmodules
index 0605528..477ffc1 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,7 @@
[submodule "tmtccmd"]
path = tmtccmd
- url = https://github.com/rmspacefish/tmtccmd.git
+ url = https://github.com/robamu-org/tmtccmd.git
+
+[submodule "spacepackets"]
+ path = spacepackets
+ url = https://github.com/robamu-org/py-spacepackets.git
diff --git a/.idea/runConfigurations/ACU.xml b/.idea/runConfigurations/ACU.xml
new file mode 100644
index 0000000..2898755
--- /dev/null
+++ b/.idea/runConfigurations/ACU.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/PDU1_Test_UDP.xml b/.idea/runConfigurations/BPX.xml
similarity index 76%
rename from .idea/runConfigurations/PDU1_Test_UDP.xml
rename to .idea/runConfigurations/BPX.xml
index 22ea5c2..a1fc5d3 100644
--- a/.idea/runConfigurations/PDU1_Test_UDP.xml
+++ b/.idea/runConfigurations/BPX.xml
@@ -1,5 +1,5 @@
-
+
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/.idea/runConfigurations/PDU2_Test_UDP.xml b/.idea/runConfigurations/BPX_Request_HK.xml
similarity index 76%
rename from .idea/runConfigurations/PDU2_Test_UDP.xml
rename to .idea/runConfigurations/BPX_Request_HK.xml
index fbf8adf..9783034 100644
--- a/.idea/runConfigurations/PDU2_Test_UDP.xml
+++ b/.idea/runConfigurations/BPX_Request_HK.xml
@@ -1,5 +1,5 @@
-
+
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/.idea/runConfigurations/BPX_Reset_Reboot_Counter.xml b/.idea/runConfigurations/BPX_Reset_Reboot_Counter.xml
new file mode 100644
index 0000000..6d0b32d
--- /dev/null
+++ b/.idea/runConfigurations/BPX_Reset_Reboot_Counter.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/GPS_0.xml b/.idea/runConfigurations/GPS_0.xml
new file mode 100644
index 0000000..02dbeef
--- /dev/null
+++ b/.idea/runConfigurations/GPS_0.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/GPS_1.xml b/.idea/runConfigurations/GPS_1.xml
new file mode 100644
index 0000000..d6e6330
--- /dev/null
+++ b/.idea/runConfigurations/GPS_1.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Heater_Test.xml b/.idea/runConfigurations/Heater_Test.xml
index 6debe25..65618ba 100644
--- a/.idea/runConfigurations/Heater_Test.xml
+++ b/.idea/runConfigurations/Heater_Test.xml
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/.idea/runConfigurations/IMTQ_Get_Commanded_Dipole.xml b/.idea/runConfigurations/IMTQ_Get_Commanded_Dipole.xml
index d77c885..5b55db0 100644
--- a/.idea/runConfigurations/IMTQ_Get_Commanded_Dipole.xml
+++ b/.idea/runConfigurations/IMTQ_Get_Commanded_Dipole.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/IMTQ_Neg_X_Test.xml b/.idea/runConfigurations/IMTQ_Neg_X_Test.xml
index eec3e30..765c429 100644
--- a/.idea/runConfigurations/IMTQ_Neg_X_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Neg_X_Test.xml
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/.idea/runConfigurations/IMTQ_Neg_Y_Test.xml b/.idea/runConfigurations/IMTQ_Neg_Y_Test.xml
index c8e3250..f1ef122 100644
--- a/.idea/runConfigurations/IMTQ_Neg_Y_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Neg_Y_Test.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/IMTQ_Neg_Z_Test.xml b/.idea/runConfigurations/IMTQ_Neg_Z_Test.xml
index d2cba27..feb7304 100644
--- a/.idea/runConfigurations/IMTQ_Neg_Z_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Neg_Z_Test.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/IMTQ_Pos_X_Test.xml b/.idea/runConfigurations/IMTQ_Pos_X_Test.xml
index 6d75c92..c17ae6c 100644
--- a/.idea/runConfigurations/IMTQ_Pos_X_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Pos_X_Test.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/IMTQ_Pos_Y_Test.xml b/.idea/runConfigurations/IMTQ_Pos_Y_Test.xml
index fb8e104..f375dc1 100644
--- a/.idea/runConfigurations/IMTQ_Pos_Y_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Pos_Y_Test.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/IMTQ_Pos_Z_Test.xml b/.idea/runConfigurations/IMTQ_Pos_Z_Test.xml
index 98f8f4b..594c1bb 100644
--- a/.idea/runConfigurations/IMTQ_Pos_Z_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Pos_Z_Test.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/IMTQ_Test_UDP.xml b/.idea/runConfigurations/IMTQ_Test_UDP.xml
index 318b97a..13810ef 100644
--- a/.idea/runConfigurations/IMTQ_Test_UDP.xml
+++ b/.idea/runConfigurations/IMTQ_Test_UDP.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/P60_Dock_Test_UDP.xml b/.idea/runConfigurations/P60_Dock_Commanding.xml
similarity index 80%
rename from .idea/runConfigurations/P60_Dock_Test_UDP.xml
rename to .idea/runConfigurations/P60_Dock_Commanding.xml
index 8e873b7..4631d45 100644
--- a/.idea/runConfigurations/P60_Dock_Test_UDP.xml
+++ b/.idea/runConfigurations/P60_Dock_Commanding.xml
@@ -1,5 +1,5 @@
-
+
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/PDU1_Commanding.xml b/.idea/runConfigurations/PDU1_Commanding.xml
new file mode 100644
index 0000000..28f9c0d
--- /dev/null
+++ b/.idea/runConfigurations/PDU1_Commanding.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/PDU2_Commanding.xml b/.idea/runConfigurations/PDU2_Commanding.xml
new file mode 100644
index 0000000..7b73bd9
--- /dev/null
+++ b/.idea/runConfigurations/PDU2_Commanding.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/PLOC_MPSoC.xml b/.idea/runConfigurations/PLOC_MPSoC.xml
new file mode 100644
index 0000000..e58826d
--- /dev/null
+++ b/.idea/runConfigurations/PLOC_MPSoC.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/PLOC_SUPV.xml b/.idea/runConfigurations/PLOC_SUPV.xml
new file mode 100644
index 0000000..cc0ab09
--- /dev/null
+++ b/.idea/runConfigurations/PLOC_SUPV.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/PLOC_Test_UDP_Flatsat.xml b/.idea/runConfigurations/PLOC_Test_UDP_Flatsat.xml
deleted file mode 100644
index cdfbdc6..0000000
--- a/.idea/runConfigurations/PLOC_Test_UDP_Flatsat.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/Ping_Command.xml b/.idea/runConfigurations/Ping_Command.xml
new file mode 100644
index 0000000..c62c2fb
--- /dev/null
+++ b/.idea/runConfigurations/Ping_Command.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/RW1_Test.xml b/.idea/runConfigurations/RW1_Test.xml
index e297519..fe1186c 100644
--- a/.idea/runConfigurations/RW1_Test.xml
+++ b/.idea/runConfigurations/RW1_Test.xml
@@ -12,10 +12,10 @@
-
-
+
+
-
+
diff --git a/.idea/runConfigurations/RW2_Test_.xml b/.idea/runConfigurations/RW2_Test_.xml
index bfa97e4..b03dd54 100644
--- a/.idea/runConfigurations/RW2_Test_.xml
+++ b/.idea/runConfigurations/RW2_Test_.xml
@@ -12,10 +12,10 @@
-
-
+
+
-
+
diff --git a/.idea/runConfigurations/RW3_Test_.xml b/.idea/runConfigurations/RW3_Test_.xml
index 570dc53..a5f9530 100644
--- a/.idea/runConfigurations/RW3_Test_.xml
+++ b/.idea/runConfigurations/RW3_Test_.xml
@@ -12,10 +12,10 @@
-
-
+
+
-
+
diff --git a/.idea/runConfigurations/RW4_Test_.xml b/.idea/runConfigurations/RW4_Test_.xml
index f2c0917..83f1612 100644
--- a/.idea/runConfigurations/RW4_Test_.xml
+++ b/.idea/runConfigurations/RW4_Test_.xml
@@ -12,10 +12,10 @@
-
-
+
+
-
+
diff --git a/.idea/runConfigurations/Reboot_0_0.xml b/.idea/runConfigurations/Reboot_0_0.xml
index 5ded074..2a7ce9c 100644
--- a/.idea/runConfigurations/Reboot_0_0.xml
+++ b/.idea/runConfigurations/Reboot_0_0.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/Reboot_0_1.xml b/.idea/runConfigurations/Reboot_0_1.xml
index 31348ba..6eada4d 100644
--- a/.idea/runConfigurations/Reboot_0_1.xml
+++ b/.idea/runConfigurations/Reboot_0_1.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/Reboot_1_0.xml b/.idea/runConfigurations/Reboot_1_0.xml
index c635a7e..a70dc74 100644
--- a/.idea/runConfigurations/Reboot_1_0.xml
+++ b/.idea/runConfigurations/Reboot_1_0.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/Reboot_1_1.xml b/.idea/runConfigurations/Reboot_1_1.xml
index 11e12bf..394f6d0 100644
--- a/.idea/runConfigurations/Reboot_1_1.xml
+++ b/.idea/runConfigurations/Reboot_1_1.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/Reboot_Prompt.xml b/.idea/runConfigurations/Reboot_Prompt.xml
index 8d7f4b5..af3adf1 100644
--- a/.idea/runConfigurations/Reboot_Prompt.xml
+++ b/.idea/runConfigurations/Reboot_Prompt.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/Reboot_Self.xml b/.idea/runConfigurations/Reboot_Self.xml
index ec6c747..4243632 100644
--- a/.idea/runConfigurations/Reboot_Self.xml
+++ b/.idea/runConfigurations/Reboot_Self.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/PLOC_Test_UDP_Local.xml b/.idea/runConfigurations/S_A_Deployment_Test.xml
similarity index 81%
rename from .idea/runConfigurations/PLOC_Test_UDP_Local.xml
rename to .idea/runConfigurations/S_A_Deployment_Test.xml
index 09ce41b..8b8caa3 100644
--- a/.idea/runConfigurations/PLOC_Test_UDP_Local.xml
+++ b/.idea/runConfigurations/S_A_Deployment_Test.xml
@@ -1,5 +1,5 @@
-
+
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/.idea/runConfigurations/S_A_Deployment_Test_UDP.xml b/.idea/runConfigurations/S_A_Deployment_Test_UDP.xml
deleted file mode 100644
index 4e5633e..0000000
--- a/.idea/runConfigurations/S_A_Deployment_Test_UDP.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/ACU_Test_UDP.xml b/.idea/runConfigurations/Star_Tracker.xml
similarity index 81%
rename from .idea/runConfigurations/ACU_Test_UDP.xml
rename to .idea/runConfigurations/Star_Tracker.xml
index e44f65c..982c4d8 100644
--- a/.idea/runConfigurations/ACU_Test_UDP.xml
+++ b/.idea/runConfigurations/Star_Tracker.xml
@@ -1,5 +1,5 @@
-
+
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/.idea/runConfigurations/Syrlinks.xml b/.idea/runConfigurations/Syrlinks.xml
new file mode 100644
index 0000000..d5a3454
--- /dev/null
+++ b/.idea/runConfigurations/Syrlinks.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Syrlinks_Test_UDP.xml b/.idea/runConfigurations/Syrlinks_Test_UDP.xml
index 83cc53f..30088f2 100644
--- a/.idea/runConfigurations/Syrlinks_Test_UDP.xml
+++ b/.idea/runConfigurations/Syrlinks_Test_UDP.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/TMP1075_1_Dock_Test_UDP.xml b/.idea/runConfigurations/TMP1075_1_Dock_Test_UDP.xml
index 0232820..7ba359f 100644
--- a/.idea/runConfigurations/TMP1075_1_Dock_Test_UDP.xml
+++ b/.idea/runConfigurations/TMP1075_1_Dock_Test_UDP.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/TMP1075_2_Dock_Test_UDP.xml b/.idea/runConfigurations/TMP1075_2_Dock_Test_UDP.xml
index 65b4efb..1239074 100644
--- a/.idea/runConfigurations/TMP1075_2_Dock_Test_UDP.xml
+++ b/.idea/runConfigurations/TMP1075_2_Dock_Test_UDP.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/Unittests_in_spacepackets.xml b/.idea/runConfigurations/Unittests_in_spacepackets.xml
new file mode 100644
index 0000000..bf17647
--- /dev/null
+++ b/.idea/runConfigurations/Unittests_in_spacepackets.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Unittests_in_tmtccmd.xml b/.idea/runConfigurations/Unittests_in_tmtccmd.xml
new file mode 100644
index 0000000..5cdbb08
--- /dev/null
+++ b/.idea/runConfigurations/Unittests_in_tmtccmd.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/_IMTQ_Command_Dipole.xml b/.idea/runConfigurations/_IMTQ_Command_Dipole.xml
index 7972ab7..9f28ecc 100644
--- a/.idea/runConfigurations/_IMTQ_Command_Dipole.xml
+++ b/.idea/runConfigurations/_IMTQ_Command_Dipole.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/ccsds_handler.xml b/.idea/runConfigurations/ccsds_handler.xml
new file mode 100644
index 0000000..5e506bb
--- /dev/null
+++ b/.idea/runConfigurations/ccsds_handler.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcc_Listener_Mode.xml b/.idea/runConfigurations/pdec_handler.xml
similarity index 82%
rename from .idea/runConfigurations/tmtcc_Listener_Mode.xml
rename to .idea/runConfigurations/pdec_handler.xml
index e67c129..cedb49e 100644
--- a/.idea/runConfigurations/tmtcc_Listener_Mode.xml
+++ b/.idea/runConfigurations/pdec_handler.xml
@@ -1,5 +1,5 @@
-
+
@@ -13,7 +13,7 @@
-
+
diff --git a/.idea/runConfigurations/tmtcc_Service_17.xml b/.idea/runConfigurations/tmtcc_Service_17.xml
index 4162965..01536e7 100644
--- a/.idea/runConfigurations/tmtcc_Service_17.xml
+++ b/.idea/runConfigurations/tmtcc_Service_17.xml
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/.idea/runConfigurations/tmtcc_Service_2.xml b/.idea/runConfigurations/tmtcc_Service_2.xml
index bd86ff4..ac7fd3f 100644
--- a/.idea/runConfigurations/tmtcc_Service_2.xml
+++ b/.idea/runConfigurations/tmtcc_Service_2.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/tmtcc_Service_200.xml b/.idea/runConfigurations/tmtcc_Service_200.xml
index a8d49be..b1eba62 100644
--- a/.idea/runConfigurations/tmtcc_Service_200.xml
+++ b/.idea/runConfigurations/tmtcc_Service_200.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/tmtcc_Service_3.xml b/.idea/runConfigurations/tmtcc_Service_3.xml
index 686dd13..09ca934 100644
--- a/.idea/runConfigurations/tmtcc_Service_3.xml
+++ b/.idea/runConfigurations/tmtcc_Service_3.xml
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/.idea/runConfigurations/tmtcc_Service_8.xml b/.idea/runConfigurations/tmtcc_Service_8.xml
index 698dd1f..0052698 100644
--- a/.idea/runConfigurations/tmtcc_Service_8.xml
+++ b/.idea/runConfigurations/tmtcc_Service_8.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_CLI.xml b/.idea/runConfigurations/tmtccli.xml
similarity index 77%
rename from .idea/runConfigurations/tmtcclient_CLI.xml
rename to .idea/runConfigurations/tmtccli.xml
index 3fff92f..1b4b29b 100644
--- a/.idea/runConfigurations/tmtcclient_CLI.xml
+++ b/.idea/runConfigurations/tmtccli.xml
@@ -1,5 +1,5 @@
-
+
@@ -12,10 +12,10 @@
-
+
-
+
diff --git a/.idea/runConfigurations/tmtccli_example.xml b/.idea/runConfigurations/tmtccli_example.xml
new file mode 100644
index 0000000..4760217
--- /dev/null
+++ b/.idea/runConfigurations/tmtccli_example.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_Help.xml b/.idea/runConfigurations/tmtcclient_Help.xml
index 1ce63fb..8ff85eb 100644
--- a/.idea/runConfigurations/tmtcclient_Help.xml
+++ b/.idea/runConfigurations/tmtcclient_Help.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/PLOC_SUPV_Test.xml b/.idea/runConfigurations/tmtccmd_Listener_Mode.xml
similarity index 75%
rename from .idea/runConfigurations/PLOC_SUPV_Test.xml
rename to .idea/runConfigurations/tmtccmd_Listener_Mode.xml
index cd4ce6f..a7b05bf 100644
--- a/.idea/runConfigurations/PLOC_SUPV_Test.xml
+++ b/.idea/runConfigurations/tmtccmd_Listener_Mode.xml
@@ -1,5 +1,5 @@
-
+
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/.idea/runConfigurations/tmtcclient_GUI.xml b/.idea/runConfigurations/tmtcgui.xml
similarity index 82%
rename from .idea/runConfigurations/tmtcclient_GUI.xml
rename to .idea/runConfigurations/tmtcgui.xml
index 7dd7c34..845b1c6 100644
--- a/.idea/runConfigurations/tmtcclient_GUI.xml
+++ b/.idea/runConfigurations/tmtcgui.xml
@@ -1,5 +1,5 @@
-
+
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/runConfigurations/tmtcgui_example.xml b/.idea/runConfigurations/tmtcgui_example.xml
new file mode 100644
index 0000000..7234a88
--- /dev/null
+++ b/.idea/runConfigurations/tmtcgui_example.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..86a797a
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,13 @@
+Copyright 2021 Institute of Space Systems (IRS), University of Stuttgart
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file
diff --git a/config/custom_hooks.py b/config/custom_hooks.py
index 35405b4..450de42 100644
--- a/config/custom_hooks.py
+++ b/config/custom_hooks.py
@@ -3,7 +3,7 @@
@details Template configuration file. Copy this folder to the TMTC commander root and adapt
it to your needs.
"""
-from tmtccmd.ecss.tc import PusTelecommand
+from spacepackets.ecss.tc import PusTelecommand
def command_preparation_hook() -> PusTelecommand:
@@ -12,4 +12,3 @@ def command_preparation_hook() -> PusTelecommand:
class instance
"""
return PusTelecommand(service=17, subservice=1, ssc=20)
-
diff --git a/config/custom_mode_op.py b/config/custom_mode_op.py
index 159e350..64b9033 100644
--- a/config/custom_mode_op.py
+++ b/config/custom_mode_op.py
@@ -6,7 +6,7 @@
import enum
from tmtccmd.core.backend import TmTcHandler
-from tmtccmd.utility.logger import get_console_logger
+from tmtccmd.logging import get_console_logger
LOGGER = get_console_logger()
diff --git a/config/definitions.py b/config/definitions.py
index 4e9809f..476e8e4 100644
--- a/config/definitions.py
+++ b/config/definitions.py
@@ -11,23 +11,37 @@ PUS_APID = 0x65
class CustomServiceList(enum.Enum):
- TEST_DEVICE = "test",
+ TEST_DEVICE = "test"
P60DOCK = "p60dock"
PDU1 = "pdu1"
PDU2 = "pdu2"
ACU = "acu"
+ ACS = "acs"
+ BPX_BATTERY = "bpx"
TMP1075_1 = "tmp1075_1"
TMP1075_2 = "tmp1075_2"
HEATER = "heater"
IMTQ = "imtq"
- PLOC = "ploc"
- PCDU = "pcdu",
+ PLOC_SUPV = "ploc_supv"
+ PLOC_MPSOC = "ploc_mpsoc"
+ PCDU = "pcdu"
+ PL_PCDU = "plpcdu"
SA_DEPLYOMENT = "sa_depl"
REACTION_WHEEL_1 = "reaction_wheel_1"
REACTION_WHEEL_2 = "reaction_wheel_2"
REACTION_WHEEL_3 = "reaction_wheel_3"
REACTION_WHEEL_4 = "reaction_wheel_4"
RAD_SENSOR = "rad_sensor"
- PLOC_SUPV = "ploc_supv"
PLOC_UPDATER = "ploc_updater"
- CORE = 'core'
+ GPS_0 = "gps0"
+ GPS_1 = "gps1"
+ PLOC_MEMORY_DUMPER = "ploc_memory_dumper"
+ CORE = "core"
+ STAR_TRACKER = "star_tracker"
+ CCSDS_HANDLER = "ccsds_handler"
+ PDEC_HANDLER = "pdec_handler"
+ STR_IMG_HELPER = "str_img_helper"
+ SYRLINKS = "syrlinks"
+ ACS_ASS = "acs-ass"
+ SUS_ASS = "sus-ass"
+ TCS_ASS = "tcs-ass"
diff --git a/config/events.csv b/config/events.csv
new file mode 100644
index 0000000..994e751
--- /dev/null
+++ b/config/events.csv
@@ -0,0 +1,181 @@
+2200;0x0898;STORE_SEND_WRITE_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2201;0x0899;STORE_WRITE_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2202;0x089a;STORE_SEND_READ_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2203;0x089b;STORE_READ_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2204;0x089c;UNEXPECTED_MSG;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2205;0x089d;STORING_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2206;0x089e;TM_DUMP_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2207;0x089f;STORE_INIT_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2208;0x08a0;STORE_INIT_EMPTY;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2209;0x08a1;STORE_CONTENT_CORRUPTED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2210;0x08a2;STORE_INITIALIZE;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2211;0x08a3;INIT_DONE;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2212;0x08a4;DUMP_FINISHED;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2213;0x08a5;DELETION_FINISHED;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2214;0x08a6;DELETION_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2215;0x08a7;AUTO_CATALOGS_SENDING_FAILED;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
+2600;0x0a28;GET_DATA_FAILED;LOW;;fsfw/src/fsfw/storagemanager/StorageManagerIF.h
+2601;0x0a29;STORE_DATA_FAILED;LOW;;fsfw/src/fsfw/storagemanager/StorageManagerIF.h
+2800;0x0af0;DEVICE_BUILDING_COMMAND_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+2801;0x0af1;DEVICE_SENDING_COMMAND_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+2802;0x0af2;DEVICE_REQUESTING_REPLY_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+2803;0x0af3;DEVICE_READING_REPLY_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+2804;0x0af4;DEVICE_INTERPRETING_REPLY_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+2805;0x0af5;DEVICE_MISSED_REPLY;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+2806;0x0af6;DEVICE_UNKNOWN_REPLY;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+2807;0x0af7;DEVICE_UNREQUESTED_REPLY;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+2808;0x0af8;INVALID_DEVICE_COMMAND;LOW;Indicates a SW bug in child class.;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+2809;0x0af9;MONITORING_LIMIT_EXCEEDED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+2810;0x0afa;MONITORING_AMBIGUOUS;HIGH;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+2811;0x0afb;DEVICE_WANTS_HARD_REBOOT;HIGH;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
+4201;0x1069;FUSE_CURRENT_HIGH;LOW;;fsfw/src/fsfw/power/Fuse.h
+4202;0x106a;FUSE_WENT_OFF;LOW;;fsfw/src/fsfw/power/Fuse.h
+4204;0x106c;POWER_ABOVE_HIGH_LIMIT;LOW;;fsfw/src/fsfw/power/Fuse.h
+4205;0x106d;POWER_BELOW_LOW_LIMIT;LOW;;fsfw/src/fsfw/power/Fuse.h
+4300;0x10cc;SWITCH_WENT_OFF;LOW;;fsfw/src/fsfw/power/PowerSwitchIF.h
+5000;0x1388;HEATER_ON;INFO;;fsfw/src/fsfw/thermal/Heater.h
+5001;0x1389;HEATER_OFF;INFO;;fsfw/src/fsfw/thermal/Heater.h
+5002;0x138a;HEATER_TIMEOUT;LOW;;fsfw/src/fsfw/thermal/Heater.h
+5003;0x138b;HEATER_STAYED_ON;LOW;;fsfw/src/fsfw/thermal/Heater.h
+5004;0x138c;HEATER_STAYED_OFF;LOW;;fsfw/src/fsfw/thermal/Heater.h
+5200;0x1450;TEMP_SENSOR_HIGH;LOW;;fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
+5201;0x1451;TEMP_SENSOR_LOW;LOW;;fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
+5202;0x1452;TEMP_SENSOR_GRADIENT;LOW;;fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
+5901;0x170d;COMPONENT_TEMP_LOW;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h
+5902;0x170e;COMPONENT_TEMP_HIGH;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h
+5903;0x170f;COMPONENT_TEMP_OOL_LOW;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h
+5904;0x1710;COMPONENT_TEMP_OOL_HIGH;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h
+5905;0x1711;TEMP_NOT_IN_OP_RANGE;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h
+7101;0x1bbd;FDIR_CHANGED_STATE;INFO;;fsfw/src/fsfw/fdir/FailureIsolationBase.h
+7102;0x1bbe;FDIR_STARTS_RECOVERY;MEDIUM;;fsfw/src/fsfw/fdir/FailureIsolationBase.h
+7103;0x1bbf;FDIR_TURNS_OFF_DEVICE;MEDIUM;;fsfw/src/fsfw/fdir/FailureIsolationBase.h
+7201;0x1c21;MONITOR_CHANGED_STATE;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h
+7202;0x1c22;VALUE_BELOW_LOW_LIMIT;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h
+7203;0x1c23;VALUE_ABOVE_HIGH_LIMIT;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h
+7204;0x1c24;VALUE_OUT_OF_RANGE;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h
+7400;0x1ce8;CHANGING_MODE;INFO;;fsfw/src/fsfw/modes/HasModesIF.h
+7401;0x1ce9;MODE_INFO;INFO;;fsfw/src/fsfw/modes/HasModesIF.h
+7402;0x1cea;FALLBACK_FAILED;HIGH;;fsfw/src/fsfw/modes/HasModesIF.h
+7403;0x1ceb;MODE_TRANSITION_FAILED;LOW;;fsfw/src/fsfw/modes/HasModesIF.h
+7404;0x1cec;CANT_KEEP_MODE;HIGH;;fsfw/src/fsfw/modes/HasModesIF.h
+7405;0x1ced;OBJECT_IN_INVALID_MODE;LOW;;fsfw/src/fsfw/modes/HasModesIF.h
+7406;0x1cee;FORCING_MODE;MEDIUM;;fsfw/src/fsfw/modes/HasModesIF.h
+7407;0x1cef;MODE_CMD_REJECTED;LOW;;fsfw/src/fsfw/modes/HasModesIF.h
+7506;0x1d52;HEALTH_INFO;INFO;;fsfw/src/fsfw/health/HasHealthIF.h
+7507;0x1d53;CHILD_CHANGED_HEALTH;INFO;;fsfw/src/fsfw/health/HasHealthIF.h
+7508;0x1d54;CHILD_PROBLEMS;LOW;;fsfw/src/fsfw/health/HasHealthIF.h
+7509;0x1d55;OVERWRITING_HEALTH;LOW;;fsfw/src/fsfw/health/HasHealthIF.h
+7510;0x1d56;TRYING_RECOVERY;MEDIUM;;fsfw/src/fsfw/health/HasHealthIF.h
+7511;0x1d57;RECOVERY_STEP;MEDIUM;;fsfw/src/fsfw/health/HasHealthIF.h
+7512;0x1d58;RECOVERY_DONE;MEDIUM;;fsfw/src/fsfw/health/HasHealthIF.h
+7900;0x1edc;RF_AVAILABLE;INFO;A RF available signal was detected. P1: raw RFA state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
+7901;0x1edd;RF_LOST;INFO;A previously found RF available signal was lost. P1: raw RFA state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
+7902;0x1ede;BIT_LOCK;INFO;A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
+7903;0x1edf;BIT_LOCK_LOST;INFO;A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
+7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
+8900;0x22c4;CLOCK_SET;INFO;;fsfw/src/fsfw/pus/Service9TimeManagement.h
+8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw/src/fsfw/pus/Service9TimeManagement.h
+9700;0x25e4;TEST;INFO;;fsfw/src/fsfw/pus/Service17Test.h
+10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
+10800;0x2a30;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
+10801;0x2a31;SWITCH_HAS_CHANGED;INFO;Indicated that a swithc state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
+10802;0x2a32;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h
+10900;0x2a94;GPIO_PULL_HIGH_FAILED;LOW;;mission/devices/HeaterHandler.h
+10901;0x2a95;GPIO_PULL_LOW_FAILED;LOW;;mission/devices/HeaterHandler.h
+10902;0x2a96;SWITCH_ALREADY_ON;LOW;;mission/devices/HeaterHandler.h
+10903;0x2a97;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h
+10904;0x2a98;MAIN_SWITCH_TIMEOUT;LOW;;mission/devices/HeaterHandler.h
+11000;0x2af8;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h
+11001;0x2af9;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h
+11002;0x2afa;DEPLOYMENT_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
+11003;0x2afb;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
+11004;0x2afc;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
+11101;0x2b5d;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/devices/ploc/PlocMPSoCHandler.h
+11102;0x2b5e;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h
+11103;0x2b5f;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h
+11104;0x2b60;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/devices/ploc/PlocMPSoCHandler.h
+11105;0x2b61;MPSOC_HANDLER_SEQ_CNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHandler.h
+11201;0x2bc1;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
+11202;0x2bc2;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
+11203;0x2bc3;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
+11204;0x2bc4;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
+11205;0x2bc5;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system failure) P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
+11206;0x2bc6;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
+11207;0x2bc7;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
+11208;0x2bc8;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/IMTQHandler.h
+11301;0x2c25;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/RwHandler.h
+11401;0x2c89;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h
+11402;0x2c8a;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h
+11501;0x2ced;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/devices/ploc/PlocSupervisorHandler.h
+11502;0x2cee;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/devices/ploc/PlocSupervisorHandler.h
+11503;0x2cef;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;linux/devices/ploc/PlocSupervisorHandler.h
+11504;0x2cf0;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/devices/ploc/PlocSupervisorHandler.h
+11600;0x2d50;SANITIZATION_FAILED;LOW;;bsp_q7s/memory/SdCardManager.h
+11601;0x2d51;MOUNTED_SD_CARD;INFO;;bsp_q7s/memory/SdCardManager.h
+11700;0x2db4;UPDATE_FILE_NOT_EXISTS;LOW;;linux/devices/ploc/PlocUpdater.h
+11701;0x2db5;ACTION_COMMANDING_FAILED;LOW;Failed to send command to supervisor handler P1: Return value of CommandActionHelper::commandAction P2: Action ID of command to send;linux/devices/ploc/PlocUpdater.h
+11702;0x2db6;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;linux/devices/ploc/PlocUpdater.h
+11703;0x2db7;UPDATE_TRANSFER_FAILED;LOW;Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent (inclusive the failed packet);linux/devices/ploc/PlocUpdater.h
+11704;0x2db8;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;linux/devices/ploc/PlocUpdater.h
+11705;0x2db9;UPDATE_FINISHED;INFO;MPSoC update successful completed;linux/devices/ploc/PlocUpdater.h
+11800;0x2e18;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;linux/devices/ploc/PlocMemoryDumper.h
+11801;0x2e19;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;linux/devices/ploc/PlocMemoryDumper.h
+11802;0x2e1a;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;linux/devices/ploc/PlocMemoryDumper.h
+11901;0x2e7d;INVALID_TC_FRAME;HIGH;;linux/obc/PdecHandler.h
+11902;0x2e7e;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux/obc/PdecHandler.h
+11903;0x2e7f;CARRIER_LOCK;INFO;Carrier lock detected;linux/obc/PdecHandler.h
+11904;0x2e80;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/obc/PdecHandler.h
+12000;0x2ee0;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h
+12001;0x2ee1;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h
+12002;0x2ee2;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h
+12003;0x2ee3;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrHelper.h
+12004;0x2ee4;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrHelper.h
+12005;0x2ee5;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrHelper.h
+12006;0x2ee6;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrHelper.h
+12007;0x2ee7;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrHelper.h
+12008;0x2ee8;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrHelper.h
+12009;0x2ee9;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h
+12010;0x2eea;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h
+12011;0x2eeb;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux/devices/startracker/StrHelper.h
+12012;0x2eec;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux/devices/startracker/StrHelper.h
+12013;0x2eed;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux/devices/startracker/StrHelper.h
+12014;0x2eee;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/devices/startracker/StrHelper.h
+12015;0x2eef;STR_HELPER_SENDING_PACKET_FAILED;LOW;;linux/devices/startracker/StrHelper.h
+12016;0x2ef0;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;linux/devices/startracker/StrHelper.h
+12100;0x2f44;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h
+12101;0x2f45;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h
+12102;0x2f46;SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocMPSoCHelper.h
+12103;0x2f47;MPSOC_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
+12104;0x2f48;MPSOC_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
+12105;0x2f49;MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
+12106;0x2f4a;MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
+12107;0x2f4b;ACK_FAILURE_REPORT;LOW;Received acknowledgement failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
+12108;0x2f4c;EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
+12109;0x2f4d;ACK_INVALID_APID;LOW;Expected acknowledgement report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
+12110;0x2f4e;EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
+12111;0x2f4f;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHelper.h
+12200;0x2fa8;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/devices/PayloadPcduHandler.h
+12201;0x2fa9;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
+12202;0x2faa;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
+12203;0x2fab;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
+12204;0x2fac;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
+12205;0x2fad;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
+12206;0x2fae;U_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
+12207;0x2faf;I_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
+12208;0x2fb0;U_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
+12209;0x2fb1;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
+12210;0x2fb2;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
+12211;0x2fb3;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
+12300;0x300c;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/AcsBoardAssembly.h
+12301;0x300d;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/AcsBoardAssembly.h
+12302;0x300e;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/AcsBoardAssembly.h
+12303;0x300f;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/AcsBoardAssembly.h
+12400;0x3070;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/SusAssembly.h
+12401;0x3071;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/SusAssembly.h
+12402;0x3072;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/SusAssembly.h
+12403;0x3073;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/SusAssembly.h
+12500;0x30d4;CHILDREN_LOST_MODE;MEDIUM;;mission/system/TcsBoardAssembly.h
+13600;0x3520;ALLOC_FAILURE;MEDIUM;;bsp_q7s/core/CoreController.h
+13601;0x3521;REBOOT_SW;MEDIUM; Software reboot occured. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h
+13602;0x3522;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h
+13603;0x3523;REBOOT_HW;MEDIUM;;bsp_q7s/core/CoreController.h
diff --git a/config/globals_config.py b/config/globals_config.py
index 3fc9b35..bb2640b 100644
--- a/config/globals_config.py
+++ b/config/globals_config.py
@@ -12,25 +12,22 @@ import argparse
from config.definitions import CustomServiceList, PUS_APID
from config.custom_mode_op import CustomModeList
from tmtccmd.config.definitions import CoreComInterfaces
-from tmtccmd.config.globals import set_default_globals_pre_args_parsing, \
- set_default_globals_post_args_parsing
-from tmtccmd.utility.logger import get_console_logger
+from tmtccmd.config.globals import set_default_globals_pre_args_parsing
+from tmtccmd.logging import get_console_logger
LOGGER = get_console_logger()
class CustomGlobalIds(enum.Enum):
from enum import auto
+
pass
def set_globals_pre_args_parsing(gui: bool = False):
set_default_globals_pre_args_parsing(
- gui=gui, apid=PUS_APID, com_if_id=CoreComInterfaces.TCPIP_UDP.value)
-
-
-def add_globals_post_args_parsing(args: argparse.Namespace, json_cfg_path: str):
- set_default_globals_post_args_parsing(
- args=args, custom_services_list=[CustomServiceList],
- custom_modes_list=[CustomModeList], json_cfg_path=json_cfg_path
+ gui=gui,
+ tc_apid=PUS_APID,
+ tm_apid=PUS_APID,
+ com_if_id=CoreComInterfaces.TCPIP_UDP.value,
)
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index 2dfb5e2..aa7bdf8 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -1,234 +1,350 @@
import argparse
-from typing import Union, Dict, Tuple
+from typing import Union, Dict
-from tmtccmd.config.definitions import ServiceOpCodeDictT
+from tmtccmd.config.definitions import (
+ ServiceOpCodeDictT,
+ HkReplyUnpacked,
+ DataReplyUnpacked,
+)
from tmtccmd.tm.service_3_base import Service3Base
-from tmtccmd.ecss.tm import PusTelemetry
from tmtccmd.tc.definitions import TcQueueT
+from tmtccmd.utility.retval import RetvalDictT
+from tmtccmd.pus.obj_id import ObjectIdDictT
from tmtccmd.com_if.com_interface_base import CommunicationInterface
from tmtccmd.core.backend import TmTcHandler
from tmtccmd.config.hook import TmTcHookBase
-from tmtccmd.utility.tmtc_printer import TmTcPrinter
+from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.config.globals import OpCodeDictKeys
-from config.object_ids import RW1_ID
from config.definitions import CustomServiceList
+from config.retvals import get_retval_dict
class EiveHookObject(TmTcHookBase):
+ def __init__(self, json_cfg_path: str):
+ super().__init__(json_cfg_path=json_cfg_path)
def get_service_op_code_dictionary(self) -> ServiceOpCodeDictT:
from tmtccmd.config.globals import get_default_service_op_code_dict
+
service_op_code_dict = get_default_service_op_code_dict()
- op_code_dict = {
- 'reboot': ('Reboot with Prompt', {OpCodeDictKeys.TIMEOUT: 2.0}),
- 'reboot_self': ('Reboot Self', {OpCodeDictKeys.TIMEOUT: 4.0}),
- 'reboot_0_0': ('Reboot 0 0', {OpCodeDictKeys.TIMEOUT: 4.0}),
- 'reboot_0_1': ('Reboot 0 1', {OpCodeDictKeys.TIMEOUT: 4.0}),
- 'reboot_1_0': ('Reboot 1 0', {OpCodeDictKeys.TIMEOUT: 4.0}),
- 'reboot_1_1': ('Reboot 1 1', {OpCodeDictKeys.TIMEOUT: 4.0}),
- }
- service_tuple = ('Core Controller', op_code_dict)
- service_op_code_dict[CustomServiceList.CORE.value] = service_tuple
-
- op_code_dict = {
- "0": ("ACU Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
- }
- service_tuple = ("ACU Devices", op_code_dict)
- service_op_code_dict[CustomServiceList.ACU.value] = service_tuple
-
- op_code_dict = {
- "0": ("TMP1075 Tests", {OpCodeDictKeys.TIMEOUT: 2.2}),
- }
- service_tuple = ("TMP1075 1", op_code_dict)
- service_op_code_dict[CustomServiceList.TMP1075_1.value] = service_tuple
- service_tuple = ("TMP1075 2", op_code_dict)
- service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tuple
-
- op_code_dict_srv_p60 = {
- "0": ("P60 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
- }
- service_p60_tuple = ("P60 Device", op_code_dict_srv_p60)
-
- op_code_dict_srv_pdu1 = {
- "0": ("PDU1 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
- }
- service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
-
- op_code_dict_srv_pdu2 = {
- "0": ("PDU2 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
- }
- service_pdu2_tuple = ("PDU2 Device", op_code_dict_srv_pdu2)
-
- op_code_dict_srv_heater = {
- "0": ("Heater Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
- }
- service_heater_tuple = ("Heater Device", op_code_dict_srv_heater)
-
- op_code_dict_srv_imtq = {
- "0": ("IMTQ Tests All", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "1": ("IMTQ perform pos X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "2": ("IMTQ perform neg X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "3": ("IMTQ perform pos Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "4": ("IMTQ perform neg Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "5": ("IMTQ perform pos Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "6": ("IMTQ perform neg Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "7": ("IMTQ command dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "8": ("IMTQ get commanded dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
- }
- service_imtq_tuple = ("IMTQ Device", op_code_dict_srv_imtq)
-
- op_code_dict_srv_rw = {
- "0": ("Reaction Wheel: Run all commands", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "1": ("Reaction Wheel: Set speed", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "2": ("Reaction Wheel: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "3": ("Reaction Wheel: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "4": ("Reaction Wheel: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "5": ("Reaction Wheel: Send get-telemetry-command", {OpCodeDictKeys.TIMEOUT: 2.0}),
- }
- service_rw_tuple = ("Reaction Wheel", op_code_dict_srv_rw)
-
- op_code_dict_srv_rad_sensor = {
- "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}),
- }
- service_rad_sensor_tuple = ("Radiation Sensor", op_code_dict_srv_rad_sensor)
-
- op_code_dict_srv_ploc_supv = {
- "0": ("PLOC Supervisor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "1": ("PLOC Supervisor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "2": ("PLOC Supervisor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "3": ("PLOC Supervisor: Get HK Report", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "4": ("PLOC Supervisor: Restart MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "5": ("PLOC Supervisor: Start MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "6": ("PLOC Supervisor: Shutdown MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "7": ("PLOC Supervisor: Select MPSoC boot image", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "8": ("PLOC Supervisor: Set max restart tries", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "9": ("PLOC Supervisor: Reset MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "10": ("PLOC Supervisor: Set time reference", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "11": ("PLOC Supervisor: Set boot timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "12": ("PLOC Supervisor: Disable Hk", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "13": ("PLOC Supervisor: Request boot status report", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "14": ("PLOC Supervisor: Update available", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "15": ("PLOC Supervisor: Watchdogs enable", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "16": ("PLOC Supervisor: Watchdog Configure Timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "17": ("PLOC Supervisor: Enable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "18": ("PLOC Supervisor: Disable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "19": ("PLOC Supervisor: Auto calibrate alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "20": ("PLOC Supervisor: Set alert limit", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "21": ("PLOC Supervisor: Set alert irq filter", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "22": ("PLOC Supervisor: Set ADC sweep period", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "23": ("PLOC Supervisor: Set ADC enabled channels", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "24": ("PLOC Supervisor: Set ADC window and stride", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "25": ("PLOC Supervisor: Set ADC threshold", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "26": ("PLOC Supervisor: Request latchup status report", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "27": ("PLOC Supervisor: Copy ADC data to MRAM", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "28": ("PLOC Supervisor: Enable/Disable NVM0/1/3", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "29": ("PLOC Supervisor: Select NVM", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "30": ("PLOC Supervisor: Run auto EM tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "31": ("PLOC Supervisor: MRAM Wipe", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "32": ("PLOC Supervisor: MRAM Dump", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "33": ("PLOC Supervisor: Print CPU stats", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "34": ("PLOC Supervisor: Set debug verbosity", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "35": ("PLOC Supervisor: Set GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "36": ("PLOC Supervisor: Read GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "37": ("PLOC Supervisor: Restart supervisor", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "38": ("PLOC Supervisor: Factory reset clear all", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "39": ("PLOC Supervisor: Factory reset clear mirror entries", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "40": ("PLOC Supervisor: Factory reset clear circular entries", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "41": ("PLOC Supervisor: CAN loopback test", {OpCodeDictKeys.TIMEOUT: 2.0}),
- }
- service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
-
- op_code_dict_srv_ploc_updater = {
- "0": ("Ploc Updater: Update partion A on NVM0", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "1": ("Ploc Updater: Update partion B on NVM0", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "2": ("Ploc Updater: Update partion A on NVM1", {OpCodeDictKeys.TIMEOUT: 2.0}),
- "3": ("Ploc Updater: Update partion B on NVM1", {OpCodeDictKeys.TIMEOUT: 2.0}),
- }
- service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
-
- 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.PDU1.value] = service_pdu2_tuple
- service_op_code_dict[CustomServiceList.HEATER.value] = service_heater_tuple
- service_op_code_dict[CustomServiceList.IMTQ.value] = service_imtq_tuple
- service_op_code_dict[CustomServiceList.REACTION_WHEEL_1.value] = service_rw_tuple
- service_op_code_dict[CustomServiceList.REACTION_WHEEL_2.value] = service_rw_tuple
- service_op_code_dict[CustomServiceList.REACTION_WHEEL_3.value] = service_rw_tuple
- service_op_code_dict[CustomServiceList.REACTION_WHEEL_4.value] = service_rw_tuple
- service_op_code_dict[CustomServiceList.RAD_SENSOR.value] = service_rad_sensor_tuple
- service_op_code_dict[CustomServiceList.PLOC_SUPV.value] = service_ploc_supv_tuple
- service_op_code_dict[CustomServiceList.PLOC_UPDATER.value] = service_ploc_updater_tuple
+ get_eive_service_op_code_dict(service_op_code_dict=service_op_code_dict)
return service_op_code_dict
- def get_json_config_file_path(self) -> str:
- """
- The user can specify a path and filename for the JSON configuration file by overriding this function.
- :return:
- """
- return "config/tmtc_config.json"
-
- def get_version(self) -> str:
- from config.version import SW_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_SUBMINOR
- return f"{SW_NAME} {VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_SUBMINOR}"
-
- def add_globals_pre_args_parsing(self, gui: bool = False):
- from config.globals_config import set_globals_pre_args_parsing
- set_globals_pre_args_parsing(gui=gui)
-
- def add_globals_post_args_parsing(self, args: argparse.Namespace):
- from config.globals_config import add_globals_post_args_parsing
- add_globals_post_args_parsing(args=args, json_cfg_path=self.get_json_config_file_path())
-
- def assign_communication_interface(self, com_if_key: str, tmtc_printer: TmTcPrinter) -> \
- Union[CommunicationInterface, None]:
+ def assign_communication_interface(
+ self, com_if_key: str
+ ) -> Union[CommunicationInterface, None]:
from tmtccmd.config.com_if import create_communication_interface_default
+
return create_communication_interface_default(
- com_if_key=com_if_key, tmtc_printer=tmtc_printer,
- json_cfg_path=self.get_json_config_file_path(), space_packet_id=0x0865
+ com_if_key=com_if_key,
+ json_cfg_path=self.json_cfg_path,
+ space_packet_ids=(0x0865,),
)
def perform_mode_operation(self, tmtc_backend: TmTcHandler, mode: int):
from config.custom_mode_op import custom_mode_operation
+
custom_mode_operation(mode=mode, tmtc_backend=tmtc_backend)
def pack_service_queue(self, service: int, op_code: str, service_queue: TcQueueT):
from pus_tc.tc_packer_hook import pack_service_queue_user
- pack_service_queue_user(service=service, op_code=op_code, service_queue=service_queue)
- def tm_user_factory_hook(self, raw_tm_packet: bytearray) -> PusTelemetry:
- from pus_tm.factory_hook import tm_user_factory_hook
- return tm_user_factory_hook(raw_tm_packet=raw_tm_packet)
+ pack_service_queue_user(
+ service=service, op_code=op_code, service_queue=service_queue
+ )
- def get_object_ids(self) -> Dict[bytes, list]:
+ def get_object_ids(self) -> ObjectIdDictT:
from config.object_ids import get_object_ids
+
return get_object_ids()
- @staticmethod
- def handle_service_8_telemetry(
- object_id: bytes, action_id: int, custom_data: bytearray
- ) -> Tuple[list, list]:
- from pus_tm.service_8_hook import user_analyze_service_8_data
- return user_analyze_service_8_data(
- object_id=object_id, action_id=action_id, custom_data=custom_data
- )
+ def get_retval_dict(self) -> RetvalDictT:
+ return get_retval_dict()
- @staticmethod
- def handle_service_3_housekeeping(
- object_id: bytes, set_id: int, hk_data: bytearray, service3_packet: Service3Base
- ) -> Tuple[list, list, bytearray, int]:
- from pus_tm.hk_handling import handle_user_hk_packet
- return handle_user_hk_packet(
- object_id=object_id, set_id=set_id, hk_data=hk_data, service3_packet=service3_packet
- )
- @staticmethod
- def handle_service_5_event(
- object_id: bytes, event_id: int, param_1: int, param_2: int
- ) -> str:
- if object_id == RW1_ID:
- if event_id == 1:
- return ""
- return ""
+def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
+ from pus_tc.cmd_definitions import (
+ add_bpx_cmd_definitions,
+ add_core_controller_definitions,
+ add_pcdu_cmds,
+ add_pl_pcdu_cmds,
+ add_imtq_cmds,
+ add_rw_cmds,
+ add_rad_sens_cmds,
+ add_ploc_mpsoc_cmds,
+ add_ploc_supv_cmds,
+ add_system_cmds,
+ )
+ from pus_tc.devs.gps import GpsOpCodes
+
+ add_bpx_cmd_definitions(cmd_dict=service_op_code_dict)
+ add_core_controller_definitions(cmd_dict=service_op_code_dict)
+ add_pl_pcdu_cmds(cmd_dict=service_op_code_dict)
+ add_pcdu_cmds(cmd_dict=service_op_code_dict)
+ add_imtq_cmds(cmd_dict=service_op_code_dict)
+ add_rad_sens_cmds(cmd_dict=service_op_code_dict)
+ add_rw_cmds(cmd_dict=service_op_code_dict)
+ add_ploc_mpsoc_cmds(cmd_dict=service_op_code_dict)
+ add_ploc_supv_cmds(cmd_dict=service_op_code_dict)
+ add_system_cmds(cmd_dict=service_op_code_dict)
+
+ op_code_dict = {
+ GpsOpCodes.RESET_GNSS.value: ("Reset GPS", {OpCodeDictKeys.TIMEOUT: 2.0})
+ }
+ service_tuple = ("GPS 0", op_code_dict)
+ service_op_code_dict[CustomServiceList.GPS_0.value] = service_tuple
+ service_op_code_dict[CustomServiceList.GPS_1.value] = service_tuple
+
+ op_code_dict = {
+ "0": ("ACU: Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "51": ("ACU: Print channel statistics", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_tuple = ("ACU Devices", op_code_dict)
+ service_op_code_dict[CustomServiceList.ACU.value] = service_tuple
+
+ op_code_dict = {
+ "0": ("TMP1075 Tests", {OpCodeDictKeys.TIMEOUT: 2.2}),
+ }
+ service_tuple = ("TMP1075 1", op_code_dict)
+ service_op_code_dict[CustomServiceList.TMP1075_1.value] = service_tuple
+ service_tuple = ("TMP1075 2", op_code_dict)
+ service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tuple
+
+ op_code_dict_srv_heater = {
+ "0": ("Heater Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_heater_tuple = ("Heater Device", op_code_dict_srv_heater)
+
+ op_code_dict_srv_star_tracker = {
+ "0": (
+ "Star Tracker: Mode On, Submode Bootloader",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "1": ("Star Tracker: Mode On, Submode Firmware", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("Star Tracker: Mode Normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("Star Tracker: Mode Off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("Star Tracker: Mode Raw", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": ("Star Tracker: Ping", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "6": (
+ "Star Tracker: Switch to bootloader program",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "7": ("Star Tracker: Request temperature", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "8": ("Star Tracker: Request version", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "9": ("Star Tracker: Request interface", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "10": ("Star Tracker: Request power", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "11": (
+ "Star Tracker: Set subscription parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "12": (
+ "Star Tracker: Boot image (requires bootloader mode)",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "13": ("Star Tracker: Request time", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "14": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "15": ("Star Tracker: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "16": ("Star Tracker: Download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "17": ("Star Tracker: Set limit parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "18": ("Star Tracker: Set tracking parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "19": ("Star Tracker: Set mounting parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "20": ("Star Tracker: Set camera parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "22": (
+ "Star Tracker: Set centroiding parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "23": ("Star Tracker: Set LISA parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "24": ("Star Tracker: Set matching parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "25": (
+ "Star Tracker: Set validation parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "26": ("Star Tracker: Set algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "27": ("Star Tracker: Take image", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "28": ("Star Tracker: Stop str helper", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "30": (
+ "Star Tracker: Set name of download image",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "31": ("Star Tracker: Request histogram", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "32": ("Star Tracker: Request contrast", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "33": ("Star Tracker: Set json filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "35": ("Star Tracker: Flash read", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "36": ("Star Tracker: Set flash read filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "37": ("Star Tracker: Get checksum", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "49": ("Star Tracker: Request camera parameter", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "50": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "51": (
+ "Star Tracker: Set image processor parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "52": (
+ "Star Tracker: (EGSE only) Load camera ground config ",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "53": (
+ "Star Tracker: (EGSE only) Load camera flight config",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "54": (
+ "Star Tracker: Request log level parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "55": (
+ "Star Tracker: Request mounting parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "56": (
+ "Star Tracker: Request image processor parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "57": (
+ "Star Tracker: Request centroiding parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "58": ("Star Tracker: Request lisa parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "59": (
+ "Star Tracker: Request matching parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "60": (
+ "Star Tracker: Request tracking parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "61": (
+ "Star Tracker: Request validation parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "62": ("Star Tracker: Request algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "63": (
+ "Star Tracker: Request subscription parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "64": (
+ "Star Tracker: Request log subscription parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "65": (
+ "Star Tracker: Request debug camera parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "66": ("Star Tracker: Set log level parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "67": (
+ "Star Tracker: Set log subscription parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "68": (
+ "Star Tracker: Set debug camera parameters",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "69": ("Star Tracker: Firmware update", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "70": (
+ "Star Tracker: Disable timestamp generation",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "71": (
+ "Star Tracker: Enable timestamp generation",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ }
+ service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)
+
+ op_code_dict_srv_ccsds_handler = {
+ "0": ("CCSDS Handler: Set low rate", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("CCSDS Handler: Set high rate", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("CCSDS Handler: Enable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("CCSDS Handler: Disable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("CCSDS Handler: Set arbitrary bitrate", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": (
+ "CCSDS Handler: Enable tx clock manipulator",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "6": (
+ "CCSDS Handler: Disable tx clock manipulator",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "7": (
+ "CCSDS Handler: Update tx data on rising edge",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "8": (
+ "CCSDS Handler: Update tx data on falling edge",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ }
+ service_ccsds_handler_tuple = ("CCSDS Handler", op_code_dict_srv_ccsds_handler)
+
+ op_code_dict_srv_pdec_handler = {
+ "0": ("PDEC Handler: Print CLCW", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("PDEC Handler: Print PDEC monitor", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_pdec_handler_tuple = ("PDEC Handler", op_code_dict_srv_pdec_handler)
+
+ op_code_dict_srv_syrlinks_handler = {
+ "0": ("Syrlinks Handler: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("Syrlinks Handler: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("Syrlinks Handler: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("Syrlinks Handler: Set TX standby", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("Syrlinks Handler: Set TX modulation", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": ("Syrlinks Handler: Set TX carrier wave", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "6": ("Syrlinks Handler: Read TX status", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "7": ("Syrlinks Handler: Read TX waveform", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "8": (
+ "Syrlinks Handler: Read TX AGC value high byte ",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "9": (
+ "Syrlinks Handler: Read TX AGC value low byte ",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "12": (
+ "Syrlinks Handler: Write LCL config",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "13": (
+ "Syrlinks Handler: Read RX status registers",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "14": (
+ "Syrlinks Handler: Read LCL config register",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "15": (
+ "Syrlinks Handler: Set waveform OQPSK",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "16": (
+ "Syrlinks Handler: Set waveform BPSK",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "17": (
+ "Syrlinks Handler: Set second config",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "18": (
+ "Syrlinks Handler: Enable debug output",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "19": (
+ "Syrlinks Handler: Disable debug output",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ }
+ service_syrlinks_handler_tuple = (
+ "Syrlinks Handler",
+ op_code_dict_srv_syrlinks_handler,
+ )
+ service_op_code_dict[CustomServiceList.HEATER.value] = service_heater_tuple
+ service_op_code_dict[
+ CustomServiceList.STAR_TRACKER.value
+ ] = service_star_tracker_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.SYRLINKS.value
+ ] = service_syrlinks_handler_tuple
diff --git a/config/object_ids.py b/config/object_ids.py
index 33ee78c..a70adb6 100644
--- a/config/object_ids.py
+++ b/config/object_ids.py
@@ -3,52 +3,83 @@
@details Template configuration file. Copy this folder to the TMTC commander root and adapt
it to your needs.
"""
-from typing import Dict
+import os.path
+from tmtccmd.pus.obj_id import ObjectIdDictT
+from tmtccmd.fsfw import parse_fsfw_objects_csv
+from tmtccmd.logging import get_console_logger
-PUS_SERVICE_17_ID = bytes([0x53, 0x00, 0x00, 0x17])
-TEST_DEVICE_ID = bytes([0x54, 0x00, 0xAF, 0xFE])
+
+LOGGER = get_console_logger()
+DEFAULT_OBJECTS_CSV_PATH = "config/objects.csv"
+__OBJECT_ID_DICT = None
+
+
+# Core Object IDs
+CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
+SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x00, 0xA2])
+
+# Power Object IDs
+PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0xA1])
P60_DOCK_HANDLER = bytes([0x44, 0x25, 0x00, 0x00])
PDU_1_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x01])
PDU_2_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x02])
ACU_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x03])
+BPX_HANDLER_ID = bytes([0x44, 0x26, 0x00, 0x00])
+
+# Thermal Object IDs
+HEATER_ID = bytes([0x44, 0x41, 0x00, 0xA4])
TMP_1075_1_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x04])
TMP_1075_2_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x05])
-HEATER_ID = bytes([0x44, 0x41, 0x00, 0xA4])
-PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0xA1])
-SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x10, 0xA2])
-SYRLINKS_HANDLER = bytes([0x44, 0x53, 0x00, 0xA3])
+
+# Communication Object IDs
+SYRLINKS_HANDLER_ID = bytes([0x44, 0x53, 0x00, 0xA3])
+
+# ACS Object IDs
+MGM_0_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x06])
+MGM_1_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x07])
+MGM_2_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x08])
+MGM_3_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x09])
+GYRO_0_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x10])
+GYRO_1_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x11])
+GYRO_2_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x12])
+GYRO_3_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x13])
+GPS_HANDLER_0_ID = bytes([0x44, 0x13, 0x00, 0x45])
+GPS_HANDLER_1_ID = bytes([0x44, 0x13, 0x01, 0x46])
+RW1_ID = bytes([0x44, 0x12, 0x00, 0x47])
+RW2_ID = bytes([0x44, 0x12, 0x01, 0x48])
+RW3_ID = bytes([0x44, 0x12, 0x02, 0x49])
+RW4_ID = bytes([0x44, 0x12, 0x03, 0x50])
IMTQ_HANDLER_ID = bytes([0x44, 0x14, 0x00, 0x14])
-PLOC_MPSOC_ID = bytes([0x44, 0x33, 0x00, 0x15])
-RW1_ID = bytes([0x44, 0x12, 0x00, 0x1])
-RW2_ID = bytes([0x44, 0x12, 0x00, 0x2])
-RW3_ID = bytes([0x44, 0x12, 0x00, 0x3])
-RW4_ID = bytes([0x44, 0x12, 0x00, 0x4])
-START_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
+
+# Misc Object IDs
+PUS_SERVICE_17_ID = bytes([0x53, 0x00, 0x00, 0x17])
+TEST_DEVICE_ID = bytes([0x54, 0x00, 0xAF, 0xFE])
+CCSDS_HANDLER_ID = bytes([0x50, 0x00, 0x08, 0x00])
+PDEC_HANDLER_ID = bytes([0x50, 0x00, 0x07, 0x04])
+
+# Payload Object IDs
+STAR_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
RAD_SENSOR_ID = bytes([0x44, 0x32, 0x00, 0xA5])
PLOC_SUPV_ID = bytes([0x44, 0x33, 0x00, 0x16])
PLOC_UPDATER_ID = bytes([0x44, 0x33, 0x00, 0x00])
-CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
+PLOC_MEMORY_DUMPER_ID = bytes([0x44, 0x33, 0x00, 0x01])
+STR_IMG_HELPER_ID = bytes([0x44, 0x33, 0x00, 0x02])
+PLOC_MPSOC_ID = bytes([0x44, 0x33, 0x00, 0x15])
+PL_PCDU_ID = bytes([0x44, 0x30, 0x00, 0x00])
+
+# System and Assembly Objects
+ACS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x01])
+SUS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x02])
+TCS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x03])
-def get_object_ids() -> Dict[bytes, list]:
- object_id_dict = ({
- PUS_SERVICE_17_ID: "PUS Service 17",
- TEST_DEVICE_ID: "Test Device",
- P60_DOCK_HANDLER: "P60",
- PDU_1_HANDLER_ID: "PCDU PDU1 Handler",
- PDU_2_HANDLER_ID: "PCDU PDU2 Handler",
- ACU_HANDLER_ID: "ACU Handler",
- TMP_1075_1_HANDLER_ID: "TMP 1075 Handler 1",
- TMP_1075_2_HANDLER_ID: "TMP 1075 Handler 2",
- HEATER_ID: "Heater",
- PCDU_HANDLER_ID: "PCDU",
- SOLAR_ARRAY_DEPLOYMENT_ID: "Solar Array Deployment",
- RW1_ID: "Reaction Wheel 1",
- RW2_ID: "Reaction Wheel 2",
- RW3_ID: "Reaction Wheel 3",
- RW4_ID: "Reaction Wheel 4",
- RAD_SENSOR_ID: "Radiation Sensor",
- PLOC_SUPV_ID: "PLOC Supervisor",
- CORE_CONTROLLER_ID: "Core Controller",
- })
- return object_id_dict
+def get_object_ids() -> ObjectIdDictT:
+ global __OBJECT_ID_DICT
+ if not os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
+ LOGGER.warning(f"No Objects CSV file found at {DEFAULT_OBJECTS_CSV_PATH}")
+ if __OBJECT_ID_DICT is None:
+ if os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
+ __OBJECT_ID_DICT = parse_fsfw_objects_csv(csv_file=DEFAULT_OBJECTS_CSV_PATH)
+ else:
+ __OBJECT_ID_DICT = dict()
+ return __OBJECT_ID_DICT
diff --git a/config/objects.csv b/config/objects.csv
new file mode 100644
index 0000000..a19c8e7
--- /dev/null
+++ b/config/objects.csv
@@ -0,0 +1,117 @@
+0x00005060;P60DOCK_TEST_TASK
+0x43000003;CORE_CONTROLLER
+0x43100002;ACS_CONTROLLER
+0x43400001;THERMAL_CONTROLLER
+0x44120006;MGM_0_LIS3_HANDLER
+0x44120010;GYRO_0_ADIS_HANDLER
+0x44120032;SUS_0
+0x44120033;SUS_1
+0x44120034;SUS_2
+0x44120035;SUS_3
+0x44120036;SUS_4
+0x44120037;SUS_5
+0x44120038;SUS_6
+0x44120039;SUS_7
+0x44120040;SUS_8
+0x44120041;SUS_9
+0x44120042;SUS_10
+0x44120043;SUS_11
+0x44120047;RW1
+0x44120107;MGM_1_RM3100_HANDLER
+0x44120111;GYRO_1_L3G_HANDLER
+0x44120148;RW2
+0x44120208;MGM_2_LIS3_HANDLER
+0x44120212;GYRO_2_ADIS_HANDLER
+0x44120249;RW3
+0x44120309;MGM_3_RM3100_HANDLER
+0x44120313;GYRO_3_L3G_HANDLER
+0x44120350;RW4
+0x44130001;STAR_TRACKER
+0x44130045;GPS_CONTROLLER
+0x44140014;IMTQ_HANDLER
+0x442000A1;PCDU_HANDLER
+0x44250000;P60DOCK_HANDLER
+0x44250001;PDU1_HANDLER
+0x44250002;PDU2_HANDLER
+0x44250003;ACU_HANDLER
+0x44260000;BPX_BATT_HANDLER
+0x44300000;PLPCDU_HANDLER
+0x443200A5;RAD_SENSOR
+0x44330000;PLOC_UPDATER
+0x44330001;PLOC_MEMORY_DUMPER
+0x44330002;STR_HELPER
+0x44330003;PLOC_MPSOC_HELPER
+0x44330015;PLOC_MPSOC_HANDLER
+0x44330016;PLOC_SUPERVISOR_HANDLER
+0x44330017;PLOC_SUPERVISOR_HELPER
+0x444100A2;SOLAR_ARRAY_DEPL_HANDLER
+0x444100A4;HEATER_HANDLER
+0x44420004;TMP1075_HANDLER_1
+0x44420005;TMP1075_HANDLER_2
+0x44420016;RTD_IC_3
+0x44420017;RTD_IC_4
+0x44420018;RTD_IC_5
+0x44420019;RTD_IC_6
+0x44420020;RTD_IC_7
+0x44420021;RTD_IC_8
+0x44420022;RTD_IC_9
+0x44420023;RTD_IC_10
+0x44420024;RTD_IC_11
+0x44420025;RTD_IC_12
+0x44420026;RTD_IC_13
+0x44420027;RTD_IC_14
+0x44420028;RTD_IC_15
+0x44420029;RTD_IC_16
+0x44420030;RTD_IC_17
+0x44420031;RTD_IC_18
+0x445300A3;SYRLINKS_HK_HANDLER
+0x49000000;ARDUINO_COM_IF
+0x49010005;GPIO_IF
+0x49020004;SPI_COM_IF
+0x49030003;UART_COM_IF
+0x49040002;I2C_COM_IF
+0x49050001;CSP_COM_IF
+0x50000100;CCSDS_PACKET_DISTRIBUTOR
+0x50000200;PUS_PACKET_DISTRIBUTOR
+0x50000300;TMTC_BRIDGE
+0x50000400;TMTC_POLLING_TASK
+0x50000500;FILE_SYSTEM_HANDLER
+0x50000550;SDC_MANAGER
+0x50000600;PTME
+0x50000700;PDEC_HANDLER
+0x50000800;CCSDS_HANDLER
+0x51000500;PUS_SERVICE_6
+0x53000000;FSFW_OBJECTS_START
+0x53000001;PUS_SERVICE_1_VERIFICATION
+0x53000002;PUS_SERVICE_2_DEVICE_ACCESS
+0x53000003;PUS_SERVICE_3_HOUSEKEEPING
+0x53000005;PUS_SERVICE_5_EVENT_REPORTING
+0x53000008;PUS_SERVICE_8_FUNCTION_MGMT
+0x53000009;PUS_SERVICE_9_TIME_MGMT
+0x53000017;PUS_SERVICE_17_TEST
+0x53000020;PUS_SERVICE_20_PARAMETERS
+0x53000200;PUS_SERVICE_200_MODE_MGMT
+0x53000201;PUS_SERVICE_201_HEALTH
+0x53001000;CFDP_PACKET_DISTRIBUTOR
+0x53010000;HEALTH_TABLE
+0x53010100;MODE_STORE
+0x53030000;EVENT_MANAGER
+0x53040000;INTERNAL_ERROR_REPORTER
+0x534f0100;TC_STORE
+0x534f0200;TM_STORE
+0x534f0300;IPC_STORE
+0x53500010;TIME_STAMPER
+0x53ffffff;FSFW_OBJECTS_END
+0x54000010;SPI_TEST
+0x54000020;UART_TEST
+0x54000030;I2C_TEST
+0x5400AFFE;DUMMY_HANDLER
+0x5400CAFE;DUMMY_INTERFACE
+0x54123456;LIBGPIOD_TEST
+0x54694269;TEST_TASK
+0x73000001;ACS_BOARD_ASS
+0x73000002;SUS_BOARD_ASS
+0x73000003;TCS_BOARD_ASS
+0x73000100;TM_FUNNEL
+0x73500000;CCSDS_IP_CORE_BRIDGE
+0xFFFFFFFF;NO_OBJECT
diff --git a/config/returnvalues.csv b/config/returnvalues.csv
new file mode 100644
index 0000000..01b2f67
--- /dev/null
+++ b/config/returnvalues.csv
@@ -0,0 +1,551 @@
+0x0;OK;System-wide code for ok.;RETURN_OK;HasReturnvaluesIF.h;HasReturnvaluesIF
+0x1;Failed;Unspecified system-wide code for failed.;RETURN_FAILED;HasReturnvaluesIF.h;HasReturnvaluesIF
+0x62a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;0xA0;mission/tmtc/CCSDSHandler.h;CCSDS_HANDLER
+0x68a0;SADPL_CommandNotSupported;;0xA0;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER
+0x68a1;SADPL_DeploymentAlreadyExecuting;;0xA1;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER
+0x68a2;SADPL_MainSwitchTimeoutFailure;;0xA2;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER
+0x68a3;SADPL_SwitchingDeplSa1Failed;;0xA3;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER
+0x68a4;SADPL_SwitchingDeplSa2Failed;;0xA4;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER
+0x5aa0;SUSS_ErrorUnlockMutex;;0xA0;mission/devices/SusHandler.h;SUS_HANDLER
+0x5aa1;SUSS_ErrorLockMutex;;0xA1;mission/devices/SusHandler.h;SUS_HANDLER
+0x55b0;RWHA_SpiWriteFailure;;0xB0;mission/devices/RwHandler.h;RW_HANDLER
+0x55b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;0xB1;mission/devices/RwHandler.h;RW_HANDLER
+0x55b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;0xB2;mission/devices/RwHandler.h;RW_HANDLER
+0x55b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;0xB3;mission/devices/RwHandler.h;RW_HANDLER
+0x55b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;0xB4;mission/devices/RwHandler.h;RW_HANDLER
+0x55b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;0xB5;mission/devices/RwHandler.h;RW_HANDLER
+0x55b6;RWHA_NoStartMarker;Expected a start marker as first byte;0xB6;mission/devices/RwHandler.h;RW_HANDLER
+0x55a0;RWHA_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000; 1000] or [1000; 65000];0xA0;mission/devices/RwHandler.h;RW_HANDLER
+0x55a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;0xA1;mission/devices/RwHandler.h;RW_HANDLER
+0x55a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;0xA2;mission/devices/RwHandler.h;RW_HANDLER
+0x55a3;RWHA_ExecutionFailed;Command execution failed;0xA3;mission/devices/RwHandler.h;RW_HANDLER
+0x55a4;RWHA_CrcError;Reaction wheel reply has invalid crc;0xA4;mission/devices/RwHandler.h;RW_HANDLER
+0x54a0;IMTQ_InvalidCommandCode;;0xA0;mission/devices/IMTQHandler.h;IMTQ_HANDLER
+0x54a1;IMTQ_ParameterMissing;;0xA1;mission/devices/IMTQHandler.h;IMTQ_HANDLER
+0x54a2;IMTQ_ParameterInvalid;;0xA2;mission/devices/IMTQHandler.h;IMTQ_HANDLER
+0x54a3;IMTQ_CcUnavailable;;0xA3;mission/devices/IMTQHandler.h;IMTQ_HANDLER
+0x54a4;IMTQ_InternalProcessingError;;0xA4;mission/devices/IMTQHandler.h;IMTQ_HANDLER
+0x54a5;IMTQ_RejectedWithoutReason;;0xA5;mission/devices/IMTQHandler.h;IMTQ_HANDLER
+0x54a6;IMTQ_CmdErrUnknown;;0xA6;mission/devices/IMTQHandler.h;IMTQ_HANDLER
+0x54a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;0xA7;mission/devices/IMTQHandler.h;IMTQ_HANDLER
+0x52a1;HEATER_CommandNotSupported;;0xA1;mission/devices/HeaterHandler.h;HEATER_HANDLER
+0x52a2;HEATER_InitFailed;;0xA2;mission/devices/HeaterHandler.h;HEATER_HANDLER
+0x52a3;HEATER_InvalidSwitchNr;;0xA3;mission/devices/HeaterHandler.h;HEATER_HANDLER
+0x52a4;HEATER_MainSwitchSetTimeout;;0xA4;mission/devices/HeaterHandler.h;HEATER_HANDLER
+0x52a5;HEATER_CommandAlreadyWaiting;;0xA5;mission/devices/HeaterHandler.h;HEATER_HANDLER
+0x5f00;GOMS_PacketTooLong;;0;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
+0x5f01;GOMS_InvalidTableId;;1;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
+0x5f02;GOMS_InvalidAddress;;2;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
+0x5f03;GOMS_InvalidParamSize;;3;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
+0x5f04;GOMS_InvalidPayloadSize;;4;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
+0x5f05;GOMS_UnknownReplyId;;5;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER
+0x53a0;SYRLINKS_CrcFailure;;0xA0;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
+0x53a1;SYRLINKS_UartFraminOrParityErrorAck;;0xA1;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
+0x53a2;SYRLINKS_BadCharacterAck;;0xA2;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
+0x53a3;SYRLINKS_BadParameterValueAck;;0xA3;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
+0x53a4;SYRLINKS_BadEndOfFrameAck;;0xA4;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
+0x53a5;SYRLINKS_UnknownCommandIdAck;;0xA5;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
+0x53a6;SYRLINKS_BadCrcAck;;0xA6;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
+0x53a7;SYRLINKS_ReplyWrongSize;;0xA7;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
+0x53a8;SYRLINKS_MissingStartFrameCharacter;;0xA8;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER
+0x65a0;NVMB_KeyNotExists;Specified key does not exist in json file;0xA0;mission/memory/NVMParameterBase.h;NVM_PARAM_BASE
+0x4300; HSPI_OpeningFileFailed;;0;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI
+0x4301; HSPI_FullDuplexTransferFailed;;1;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI
+0x4302; HSPI_HalfDuplexTransferFailed;;2;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI
+0x4401; HURT_UartReadFailure;;1;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART
+0x4402; HURT_UartReadSizeMissmatch;;2;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART
+0x4403; HURT_UartRxBufferTooSmall;;3;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART
+0x4601; HGIO_UnknownGpioId;;1;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO
+0x4602; HGIO_DriveGpioFailure;;2;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO
+0x4603; HGIO_GpioTypeFailure;;3;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO
+0x4604; HGIO_GpioInvalidInstance;;4;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO
+0x4605; HGIO_GpioDuplicateDetected;;5;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO
+0x4200; UXOS_ExecutionFinished;Execution of the current command has finished;0;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL
+0x4201; UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL
+0x4202; UXOS_BytesRead;Some bytes have been read from the executing process;2;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL
+0x4203; UXOS_CommandError;Command execution failed;3;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL
+0x4204; UXOS_NoCommandLoadedOrPending;;4;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL
+0x4206; UXOS_PcloseCallError;;6;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL
+0x3b00; LPIF_PoolEntryNotFound;;0x00;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF
+0x3b01; LPIF_PoolEntryTypeConflict;;0x01;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF
+0x3d00; HKM_QueueOrDestinationInvalid;;0;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER
+0x3d01; HKM_WrongHkPacketType;;1;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER
+0x3d02; HKM_ReportingStatusUnchanged;;2;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER
+0x3d03; HKM_PeriodicHelperInvalid;;3;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER
+0x3d04; HKM_PoolobjectNotFound;;4;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER
+0x3d05; HKM_DatasetNotFound;;5;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER
+0x3501; CFDP_InvalidTlvType;;1;fsfw/src/fsfw/cfdp/definitions.h;CFDP
+0x3502; CFDP_InvalidDirectiveFields;;2;fsfw/src/fsfw/cfdp/definitions.h;CFDP
+0x3503; CFDP_InvalidPduDatafieldLen;;3;fsfw/src/fsfw/cfdp/definitions.h;CFDP
+0x3504; CFDP_InvalidAckDirectiveFields;;4;fsfw/src/fsfw/cfdp/definitions.h;CFDP
+0x3505; CFDP_MetadataCantParseOptions;;5;fsfw/src/fsfw/cfdp/definitions.h;CFDP
+0x3506; CFDP_FinishedCantParseFsResponses;;6;fsfw/src/fsfw/cfdp/definitions.h;CFDP
+0x3508; CFDP_FilestoreRequiresSecondFile;;8;fsfw/src/fsfw/cfdp/definitions.h;CFDP
+0x3509; CFDP_FilestoreResponseCantParseFsMessage;;9;fsfw/src/fsfw/cfdp/definitions.h;CFDP
+0x3101; CF_ObjectHasNoFunctions;;1;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF
+0x3102; CF_AlreadyCommanding;;2;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF
+0x3201; HF_IsBusy;;1;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF
+0x3202; HF_InvalidParameters;;2;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF
+0x3203; HF_ExecutionFinished;;3;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF
+0x3204; HF_InvalidActionId;;4;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF
+0x2d01; HPA_InvalidIdentifierId;;0x01;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF
+0x2d02; HPA_InvalidDomainId;;0x02;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF
+0x2d03; HPA_InvalidValue;;0x03;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF
+0x2d05; HPA_ReadOnly;;0x05;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF
+0x2c01; PAW_UnknownDatatype;;0x01;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER
+0x2c02; PAW_DatatypeMissmatch;;0x02;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER
+0x2c03; PAW_Readonly;;0x03;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER
+0x2c04; PAW_TooBig;;0x04;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER
+0x2c05; PAW_SourceNotSet;;0x05;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER
+0x2c06; PAW_OutOfBounds;;0x06;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER
+0x2c07; PAW_NotSet;;0x07;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER
+0x2c08; PAW_ColumnOrRowsZero;;0x08;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER
+0x1701; HHI_ObjectNotHealthy;;1;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF
+0x1702; HHI_InvalidHealthState;;2;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF
+0x2701; SM_DataTooLarge;;1;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF
+0x2702; SM_DataStorageFull;;2;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF
+0x2703; SM_IllegalStorageId;;3;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF
+0x2704; SM_DataDoesNotExist;;4;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF
+0x2705; SM_IllegalAddress;;5;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF
+0x2706; SM_PoolTooLarge;;6;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF
+0x2301; MT_TooDetailedRequest;;1;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS
+0x2302; MT_TooGeneralRequest;;2;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS
+0x2303; MT_NoMatch;;3;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS
+0x2304; MT_Full;;4;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS
+0x2305; MT_NewNodeCreated;;5;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS
+0x3e01; DLEE_StreamTooShort;;0x01;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER
+0x3e02; DLEE_DecodingError;;0x02;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER
+0x2e01; ASC_TooLongForTargetType;;1;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER
+0x2e02; ASC_InvalidCharacters;;2;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER
+0x2e03; ASC_BufferTooSmall;;0x3;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER
+0x1c01; TCD_PacketLost;;1;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION
+0x1c02; TCD_DestinationNotFound;;2;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION
+0x1c03; TCD_ServiceIdAlreadyExists;;3;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION
+0x1b00; TCC_IllegalApid;;0;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK
+0x1b01; TCC_IncompletePacket;;1;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK
+0x1b02; TCC_IncorrectChecksum;;2;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK
+0x1b03; TCC_IllegalPacketType;;3;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK
+0x1b04; TCC_IllegalPacketSubtype;;4;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK
+0x1b05; TCC_IncorrectPrimaryHeader;;5;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK
+0x1b06; TCC_IncorrectSecondaryHeader;;6;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK
+0x3901; MQI_Empty;;1;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF
+0x3902; MQI_Full;No space left for more messages;2;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF
+0x3903; MQI_NoReplyPartner;Returned if a reply method was called without partner;3;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF
+0x3904; MQI_DestinationInvalid;Returned if the target destination is invalid.;4;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF
+0xf01; CM_UnknownCommand;;1;fsfw/src/fsfw/ipc/CommandMessageIF.h;COMMAND_MESSAGE
+0x3801; MUX_NotEnoughResources;;1;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x3802; MUX_InsufficientMemory;;2;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x3803; MUX_NoPrivilege;;3;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x3804; MUX_WrongAttributeSetting;;4;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x3805; MUX_MutexAlreadyLocked;;5;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x3806; MUX_MutexNotFound;;6;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x3807; MUX_MutexMaxLocks;;7;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x3808; MUX_CurrThreadAlreadyOwnsMutex;;8;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x3809; MUX_CurrThreadDoesNotOwnMutex;;9;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x380a; MUX_MutexTimeout;;10;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x380b; MUX_MutexInvalidId;;11;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x380c; MUX_MutexDestroyedWhileWaiting;;12;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF
+0x2801; TC_InvalidTargetState;;1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF
+0x28f1; TC_AboveOperationalLimit;;0xF1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF
+0x28f2; TC_BelowOperationalLimit;;0xF2;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF
+0x801; DPS_InvalidParameterDefinition;;1;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS
+0x802; DPS_SetWasAlreadyRead;;2;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS
+0x803; DPS_CommitingWithoutReading;;3;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS
+0x804; DPS_DataSetUninitialised;;4;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS
+0x805; DPS_DataSetFull;;5;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS
+0x806; DPS_PoolVarNull;;6;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS
+0x3ca0; PVA_InvalidReadWriteMode;;0xA0;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF
+0x3ca1; PVA_InvalidPoolEntry;;0xA1;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF
+0xc02; MS_InvalidEntry;;0x02;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF
+0xc03; MS_TooManyElements;;0x03;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF
+0xc04; MS_CantStoreEmpty;;0x04;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF
+0xd01; SS_SequenceAlreadyExists;;0x01;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xd02; SS_TableAlreadyExists;;0x02;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xd03; SS_TableDoesNotExist;;0x03;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xd04; SS_TableOrSequenceLengthInvalid;;0x04;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xd05; SS_SequenceDoesNotExist;;0x05;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xd06; SS_TableContainsInvalidObjectId;;0x06;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xd07; SS_FallbackSequenceDoesNotExist;;0x07;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xd08; SS_NoTargetTable;;0x08;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xd09; SS_SequenceOrTableTooLong;;0x09;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xd0b; SS_IsFallbackSequence;;0x0B;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xd0c; SS_AccessDenied;;0x0C;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xd0e; SS_TableInUse;;0x0E;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xda1; SS_TargetTableNotReached;;0xA1;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xda2; SS_TableCheckFailed;;0xA2;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM
+0xb01; SB_ChildNotFound;;0x01;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE
+0xb02; SB_ChildInfoUpdated;;0x02;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE
+0xb03; SB_ChildDoesntHaveModes;;0x03;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE
+0xb04; SB_CouldNotInsertChild;;0x04;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE
+0xb05; SB_TableContainsInvalidObjectId;;0x05;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE
+0xb00; SB_ConnBroken;;0;fsfw/src/fsfw/osal/common/TcpTmTcServer.h;SUBSYSTEM_BASE
+0x2901; IEC_NoConfigurationTable;;0x01;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2902; IEC_NoCpuTable;;0x02;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2903; IEC_InvalidWorkspaceAddress;;0x03;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2904; IEC_TooLittleWorkspace;;0x04;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2905; IEC_WorkspaceAllocation;;0x05;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2906; IEC_InterruptStackTooSmall;;0x06;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2907; IEC_ThreadExitted;;0x07;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2908; IEC_InconsistentMpInformation;;0x08;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2909; IEC_InvalidNode;;0x09;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x290a; IEC_NoMpci;;0x0a;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x290b; IEC_BadPacket;;0x0b;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x290c; IEC_OutOfPackets;;0x0c;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x290d; IEC_OutOfGlobalObjects;;0x0d;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x290e; IEC_OutOfProxies;;0x0e;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x290f; IEC_InvalidGlobalId;;0x0f;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2910; IEC_BadStackHook;;0x10;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2911; IEC_BadAttributes;;0x11;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2912; IEC_ImplementationKeyCreateInconsistency;;0x12;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2913; IEC_ImplementationBlockingOperationCancel;;0x13;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2914; IEC_MutexObtainFromBadState;;0x14;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x2915; IEC_UnlimitedAndMaximumIs0;;0x15;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES
+0x1401; SE_BufferTooShort;;1;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF
+0x1402; SE_StreamTooShort;;2;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF
+0x1403; SE_TooManyElements;;3;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF
+0x4a00; SPPA_NoPacketFound;;0x00;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER
+0x4a01; SPPA_SplitPacket;;0x01;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER
+0x1d01; PUS_ActivityStarted;;1;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF
+0x1d02; PUS_InvalidSubservice;;2;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF
+0x1d03; PUS_IllegalApplicationData;;3;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF
+0x1d04; PUS_SendTmFailed;;4;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF
+0x1d05; PUS_Timeout;;5;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF
+0x1f01; CSB_ExecutionComplete;;1;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE
+0x1f02; CSB_NoStepMessage;;2;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE
+0x1f03; CSB_ObjectBusy;;3;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE
+0x1f04; CSB_Busy;;4;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE
+0x1f05; CSB_InvalidTc;;5;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE
+0x1f06; CSB_InvalidObject;;6;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE
+0x1f07; CSB_InvalidReply;;7;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE
+0x2500; FDI_YourFault;;0;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF
+0x2501; FDI_MyFault;;1;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF
+0x2502; FDI_ConfirmLater;;2;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF
+0x4e1; RMP_CommandNoDescriptorsAvailable;;0xE1;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4e2; RMP_CommandBufferFull;;0xE2;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4e3; RMP_CommandChannelOutOfRange;;0xE3;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4e6; RMP_CommandChannelDeactivated;;0xE6;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4e7; RMP_CommandPortOutOfRange;;0xE7;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4e8; RMP_CommandPortInUse;;0xE8;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4e9; RMP_CommandNoChannel;;0xE9;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4ea; RMP_NoHwCrc;;0xEA;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4d0; RMP_ReplyNoReply;;0xD0;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4d1; RMP_ReplyNotSent;;0xD1;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4d2; RMP_ReplyNotYetSent;;0xD2;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4d3; RMP_ReplyMissmatch;;0xD3;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4d4; RMP_ReplyTimeout;;0xD4;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4c0; RMP_ReplyInterfaceBusy;;0xC0;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4c1; RMP_ReplyTransmissionError;;0xC1;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4c2; RMP_ReplyInvalidData;;0xC2;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4c3; RMP_ReplyNotSupported;;0xC3;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4f0; RMP_LinkDown;;0xF0;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4f1; RMP_SpwCredit;;0xF1;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4f2; RMP_SpwEscape;;0xF2;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4f3; RMP_SpwDisconnect;;0xF3;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4f4; RMP_SpwParity;;0xF4;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4f5; RMP_SpwWriteSync;;0xF5;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4f6; RMP_SpwInvalidAddress;;0xF6;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4f7; RMP_SpwEarlyEop;;0xF7;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4f8; RMP_SpwDma;;0xF8;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x4f9; RMP_SpwLinkError;;0xF9;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x400; RMP_ReplyOk;;0;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x401; RMP_ReplyGeneralErrorCode;;1;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x402; RMP_ReplyUnusedPacketTypeOrCommandCode;;2;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x403; RMP_ReplyInvalidKey;;3;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x404; RMP_ReplyInvalidDataCrc;;4;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x405; RMP_ReplyEarlyEop;;5;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x406; RMP_ReplyTooMuchData;;6;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x407; RMP_ReplyEep;;7;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x408; RMP_ReplyReserved;;8;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x409; RMP_ReplyVerifyBufferOverrun;;9;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x40a; RMP_ReplyCommandNotImplementedOrNotAuthorised;;10;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x40b; RMP_ReplyRmwDataLengthError;;11;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x40c; RMP_ReplyInvalidTargetLogicalAddress;;12;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL
+0x2b01; CCS_BcIsSetVrCommand;;0x01;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2b02; CCS_BcIsUnlockCommand;;0x02;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bb0; CCS_BcIllegalCommand;;0xB0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bb1; CCS_BoardReadingNotFinished;;0xB1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bf0; CCS_NsPositiveW;;0xF0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bf1; CCS_NsNegativeW;;0xF1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bf2; CCS_NsLockout;;0xF2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bf3; CCS_FarmInLockout;;0xF3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bf4; CCS_FarmInWait;;0xF4;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2be0; CCS_WrongSymbol;;0xE0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2be1; CCS_DoubleStart;;0xE1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2be2; CCS_StartSymbolMissed;;0xE2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2be3; CCS_EndWithoutStart;;0xE3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2be4; CCS_TooLarge;;0xE4;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2be5; CCS_TooShort;;0xE5;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2be6; CCS_WrongTfVersion;;0xE6;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2be7; CCS_WrongSpacecraftId;;0xE7;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2be8; CCS_NoValidFrameType;;0xE8;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2be9; CCS_CrcFailed;;0xE9;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bea; CCS_VcNotFound;;0xEA;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2beb; CCS_ForwardingFailed;;0xEB;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bec; CCS_ContentTooLarge;;0xEC;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bed; CCS_ResidualData;;0xED;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bee; CCS_DataCorrupted;;0xEE;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bef; CCS_IllegalSegmentationFlag;;0xEF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bd0; CCS_IllegalFlagCombination;;0xD0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bd1; CCS_ShorterThanHeader;;0xD1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bd2; CCS_TooShortBlockedPacket;;0xD2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x2bd3; CCS_TooShortMapExtraction;;0xD3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF
+0x37a1; SGP4_InvalidEccentricity;;0xA1;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS
+0x37a2; SGP4_InvalidMeanMotion;;0xA2;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS
+0x37a3; SGP4_InvalidPerturbationElements;;0xA3;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS
+0x37a4; SGP4_InvalidSemiLatusRectum;;0xA4;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS
+0x37a5; SGP4_InvalidEpochElements;;0xA5;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS
+0x37a6; SGP4_SatelliteHasDecayed;;0xA6;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS
+0x37b1; SGP4_TleTooOld;;0xB1;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS
+0x37b2; SGP4_TleNotInitialized;;0xB2;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS
+0x13e0; MH_UnknownCmd;;0xE0;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER
+0x13e1; MH_InvalidAddress;;0xE1;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER
+0x13e2; MH_InvalidSize;;0xE2;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER
+0x13e3; MH_StateMismatch;;0xE3;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER
+0x4100; FILS_GenericFileError;;0;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM
+0x4101; FILS_IsBusy;;1;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM
+0x4102; FILS_InvalidParameters;;2;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM
+0x4105; FILS_FileDoesNotExist;;5;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM
+0x4106; FILS_FileAlreadyExists;;6;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM
+0x4107; FILS_FileLocked;;7;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM
+0x410a; FILS_DirectoryDoesNotExist;;10;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM
+0x410b; FILS_DirectoryAlreadyExists;;11;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM
+0x410c; FILS_DirectoryNotEmpty;;12;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM
+0x410f; FILS_SequencePacketMissingWrite;;15;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM
+0x4110; FILS_SequencePacketMissingRead;;16;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM
+0x601; PP_DoItMyself;;1;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x602; PP_PointsToVariable;;2;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x603; PP_PointsToMemory;;3;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x604; PP_ActivityCompleted;;4;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x605; PP_PointsToVectorUint8;;5;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x606; PP_PointsToVectorUint16;;6;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x607; PP_PointsToVectorUint32;;7;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x608; PP_PointsToVectorFloat;;8;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x6a0; PP_DumpNotSupported;;0xA0;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x6e0; PP_InvalidSize;;0xE0;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x6e1; PP_InvalidAddress;;0xE1;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x6e2; PP_InvalidContent;;0xE2;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x6e3; PP_UnalignedAccess;;0xE3;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x6e4; PP_WriteProtected;;0xE4;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF
+0x201; OM_InsertionFailed;;1;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF
+0x202; OM_NotFound;;2;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF
+0x203; OM_ChildInitFailed;;3;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF
+0x204; OM_InternalErrReporterUninit;;4;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF
+0x501; PS_SwitchOn;;1;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF
+0x500; PS_SwitchOff;;0;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF
+0x502; PS_SwitchTimeout;;2;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF
+0x503; PS_FuseOn;;3;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF
+0x504; PS_FuseOff;;4;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF
+0x2f01; POS_InPowerTransition;;1;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER
+0x2f02; POS_SwitchStateMismatch;;2;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER
+0x1000; TIM_UnsupportedTimeFormat;;0;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS
+0x1001; TIM_NotEnoughInformationForTargetFormat;;1;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS
+0x1002; TIM_LengthMismatch;;2;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS
+0x1003; TIM_InvalidTimeFormat;;3;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS
+0x1004; TIM_InvalidDayOfYear;;4;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS
+0x1005; TIM_TimeDoesNotFitFormat;;5;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS
+0x3601; TSI_BadTimestamp;;1;fsfw/src/fsfw/timemanager/TimeStamperIF.h;TIME_STAMPER_IF
+0x2101; TMF_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF
+0x2102; TMF_LastPacketFound;;2;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF
+0x2103; TMF_StopFetch;;3;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF
+0x2104; TMF_Timeout;;4;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF
+0x2105; TMF_TmChannelFull;;5;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF
+0x2106; TMF_NotStored;;6;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF
+0x2107; TMF_AllDeleted;;7;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF
+0x2108; TMF_InvalidData;;8;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF
+0x2109; TMF_NotReady;;9;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF
+0x2001; TMB_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x2002; TMB_Full;;2;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x2003; TMB_Empty;;3;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x2004; TMB_NullRequested;;4;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x2005; TMB_TooLarge;;5;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x2006; TMB_NotReady;;6;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x2007; TMB_DumpError;;7;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x2008; TMB_CrcError;;8;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x2009; TMB_Timeout;;9;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x200a; TMB_IdlePacketFound;;10;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x200b; TMB_TelecommandFound;;11;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x200c; TMB_NoPusATm;;12;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x200d; TMB_TooSmall;;13;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x200e; TMB_BlockNotFound;;14;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0x200f; TMB_InvalidRequest;;15;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF
+0xe01; HM_InvalidMode;;0x01;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF
+0xe02; HM_TransNotAllowed;;0x02;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF
+0xe03; HM_InTransition;;0x03;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF
+0xe04; HM_InvalidSubmode;;0x04;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF
+0x1501; FM_KeyAlreadyExists;;0x01;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP
+0x1502; FM_MapFull;;0x02;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP
+0x1503; FM_KeyDoesNotExist;;0x03;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP
+0x1101; AL_Full;;0x01;fsfw/src/fsfw/container/ArrayList.h;ARRAY_LIST
+0x1601; FMM_MapFull;;0x01;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP
+0x1602; FMM_KeyDoesNotExist;;0x02;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP
+0x1801; FF_Full;;1;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS
+0x1802; FF_Empty;;2;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS
+0x3a0; DHB_InvalidChannel;;0xA0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE
+0x3b0; DHB_AperiodicReply;;0xB0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE
+0x3b1; DHB_IgnoreReplyData;;0xB1;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE
+0x3b2; DHB_IgnoreFullPacket;;0xB2;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE
+0x3c0; DHB_NothingToSend;;0xC0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE
+0x3c2; DHB_CommandMapError;;0xC2;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE
+0x3d0; DHB_NoSwitch;;0xD0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE
+0x3e0; DHB_ChildTimeout;;0xE0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE
+0x3e1; DHB_SwitchFailed;;0xE1;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE
+0x1201; AB_NeedSecondStep;;0x01;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE
+0x1202; AB_NeedToReconfigure;;0x02;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE
+0x1203; AB_ModeFallback;;0x03;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE
+0x1204; AB_ChildNotCommandable;;0x04;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE
+0x1205; AB_NeedToChangeHealth;;0x05;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE
+0x12a1; AB_NotEnoughChildrenInCorrectState;;0xa1;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE
+0x26a0; DHI_NoCommandData;;0xA0;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26a1; DHI_CommandNotSupported;;0xA1;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26a2; DHI_CommandAlreadySent;;0xA2;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26a3; DHI_CommandWasNotSent;;0xA3;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26a4; DHI_CantSwitchAddress;;0xA4;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26a5; DHI_WrongModeForCommand;;0xA5;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26a6; DHI_Timeout;;0xA6;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26a7; DHI_Busy;;0xA7;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26a8; DHI_NoReplyExpected;;0xA8;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26a9; DHI_NonOpTemperature;;0xA9;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26aa; DHI_CommandNotImplemented;;0xAA;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26b0; DHI_ChecksumError;;0xB0;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26b1; DHI_LengthMissmatch;;0xB1;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26b2; DHI_InvalidData;;0xB2;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26b3; DHI_ProtocolError;;0xB3;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26c0; DHI_DeviceDidNotExecute;;0xC0;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26c1; DHI_DeviceReportedError;;0xC1;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26c2; DHI_UnknownDeviceReply;;0xC2;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26c3; DHI_DeviceReplyInvalid;;0xC3;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26d0; DHI_InvalidCommandParameter;;0xD0;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x26d1; DHI_InvalidNumberOrLengthOfParameters;;0xD1;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF
+0x3301; DC_NoReplyReceived;;0x01;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF
+0x3302; DC_ProtocolError;;0x02;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF
+0x3303; DC_Nullpointer;;0x03;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF
+0x3304; DC_InvalidCookieType;;0x04;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF
+0x3305; DC_NotActive;;0x05;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF
+0x3306; DC_TooMuchData;;0x06;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF
+0x2401; EV_ListenerNotFound;;1;fsfw/src/fsfw/events/EventManagerIF.h;EVENT_MANAGER_IF
+0x1a01; TRC_NotEnoughSensors;;1;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK
+0x1a02; TRC_LowestValueOol;;2;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK
+0x1a03; TRC_HighestValueOol;;3;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK
+0x1a04; TRC_BothValuesOol;;4;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK
+0x1a05; TRC_DuplexOol;;5;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK
+0x3001; LIM_Unchecked;;1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x3002; LIM_Invalid;;2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x3003; LIM_Unselected;;3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x3004; LIM_BelowLowLimit;;4;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x3005; LIM_AboveHighLimit;;5;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x3006; LIM_UnexpectedValue;;6;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x3007; LIM_OutOfRange;;7;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x30a0; LIM_FirstSample;;0xA0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x30e0; LIM_InvalidSize;;0xE0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x30e1; LIM_WrongType;;0xE1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x30e2; LIM_WrongPid;;0xE2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x30e3; LIM_WrongLimitId;;0xE3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x30ee; LIM_MonitorNotFound;;0xEE;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF
+0x3a01; SPH_SemaphoreTimeout;;1;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF
+0x3a02; SPH_SemaphoreNotOwned;;2;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF
+0x3a03; SPH_SemaphoreInvalid;;3;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF
+0x7000; SDMA_OpOngoing;;0;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
+0x7001; SDMA_AlreadyOn;;1;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
+0x7002; SDMA_AlreadyMounted;;2;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
+0x7003; SDMA_AlreadyOff;;3;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
+0x700a; SDMA_StatusFileNexists;;10;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
+0x700b; SDMA_StatusFileFormatInvalid;;11;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
+0x700c; SDMA_MountError;;12;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
+0x700d; SDMA_UnmountError;;13;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
+0x700e; SDMA_SystemCallError;;14;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
+0x700f; SDMA_PopenCallError;;15;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER
+0x7100; SCBU_KeyNotFound;;0;bsp_q7s/memory/scratchApi.h;SCRATCH_BUFFER
+0x66a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;0xA0;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER
+0x66a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER
+0x69a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;0xA0;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
+0x69a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;0xA1;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
+0x69a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;0xA2;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
+0x69a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;0xA3;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
+0x69a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;0xA4;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
+0x69a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;0xA5;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
+0x69a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;0xA6;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
+0x69a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);0xA7;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
+0x69a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;0xA8;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF
+0x57e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);0xE0;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD
+0x57e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);0xE1;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD
+0x60a0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;0xA0;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER
+0x60a1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;0xA1;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER
+0x67a0; PLMPHLP_FileClosedAccidentally;File accidentally close;0xA0;linux/devices/ploc/PlocMPSoCHelper.h;PLOC_MPSOC_HELPER
+0x5da0;PLUD_UpdaterBusy;Updater is already performing an update;0xA0;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER
+0x5da1;PLUD_NameTooLong;Received update command with invalid path string (too long).;0xA1;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER
+0x5da2;PLUD_SdNotMounted;Received command to initiate update but SD card with update image not mounted.;0xA2;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER
+0x5da3;PLUD_FileNotExists;Update file received with update command does not exist.;0xA3;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER
+0x59a0;PLSV_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;0xA0;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59a1;PLSV_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;0xA1;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59a2;PLSV_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;0xA2;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59a3;PLSV_InvalidApid;Received space packet with invalid APID from PLOC supervisor;0xA3;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59a4;PLSV_GetTimeFailure;Failed to read current system time;0xA4;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59a5;PLSV_InvalidWatchdog;Received command with invalid watchdog parameter. Valid watchdogs are 0 for PS, 1 for PL and 2 for INT;0xA5;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59a6;PLSV_InvalidWatchdogTimeout;Received watchdog timeout config command with invalid timeout. Valid timeouts must be in the range between 1000 and 360000 ms.;0xA6;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59a7;PLSV_InvalidLatchupId;Received latchup config command with invalid latchup ID;0xA7;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59a8;PLSV_SweepPeriodTooSmall;Received set adc sweep period command with invalid sweep period. Must be larger than 21.;0xA8;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59a9;PLSV_InvalidTestParam;Receive auto EM test command with invalid test param. Valid params are 1 and 2.;0xA9;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59aa;PLSV_MramPacketParsingFailure;Returned when scanning for MRAM dump packets failed.;0xAA;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59ab;PLSV_InvalidMramAddresses;Returned when the start and stop addresses of the MRAM dump or MRAM wipe commands are invalid (e.g. start address bigger than stop address);0xAB;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59ac;PLSV_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;0xAC;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59ad;PLSV_PathDoesNotExist;Path to PLOC directory on SD card does not exist;0xAD;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59ae;PLSV_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;0xAE;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER
+0x59d0;PLSV_NameTooLong;Received command has file string with invalid length;0xD0;linux/devices/ploc/PlocMPSoCHandler.h;PLOC_SUPERVISOR_HANDLER
+0x6401;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE
+0x6402;JSONBASE_SetNotExists;Requested set does not exist in json file;2;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE
+0x6403;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE
+0x56a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;0xA0;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56a1;STRH_PingFailed;Ping command failed;0xA1;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56a2;STRH_VersionReqFailed;Status in version reply signals error;0xA2;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56a3;STRH_InterfaceReqFailed;Status in interface reply signals error;0xA3;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56a4;STRH_PowerReqFailed;Status in power reply signals error;0xA4;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;0xA5;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56a6;STRH_ActionFailed;Status of reply to action command signals error;0xA6;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56a7;STRH_FilePathTooLong;Received invalid path string. Exceeds allowed length;0xA7;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56a8;STRH_FilenameTooLong;Name of file received with command is too long;0xA8;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56a9;STRH_InvalidProgram;Received version reply with invalid program ID;0xA9;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56aa;STRH_ReplyError;Status field reply signals error;0xAA;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56ab;STRH_CommandTooShort;Received command which is too short (some data is missing for proper execution);0xAB;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56ac;STRH_InvalidLength;Received command with invalid length (too few or too many parameters);0xAC;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56ad;STRH_RegionMismatch;Region mismatch between send and received data;0xAD;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56ae;STRH_AddressMismatch;Address mismatch between send and received data;0xAE;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56af;STRH_LengthMismatch;Length field mismatch between send and received data;0xAF;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56b0;STRH_FileNotExists;Specified file does not exist;0xB0;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56b1;STRH_InvalidType;Download blob pixel command has invalid type field;0xB1;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56b2;STRH_InvalidId;Received FPGA action command with invalid ID;0xB2;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56b3;STRH_ReplyTooShort;Received reply is too short;0xB3;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56b4;STRH_CrcFailure;Received reply with invalid CRC;0xB4;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56b5;STRH_StrHelperExecuting;Star tracker handler currently executing a command and using the communication interface;0xB5;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;0xB6;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56b7;STRH_StartrackerRunningFirmware;Star tracker is in firmware mode but must be in bootloader mode to execute this command;0xB7;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x56b8;STRH_StartrackerRunningBootloader;Star tracker is in bootloader mode but must be in firmware mode to execute this command;0xB8;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER
+0x5ea0;STRHLP_SdNotMounted;SD card specified in path string not mounted;0xA0;linux/devices/startracker/StrHelper.h;STR_HELPER
+0x5ea1;STRHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;linux/devices/startracker/StrHelper.h;STR_HELPER
+0x5ea2;STRHLP_PathNotExists;Specified path does not exist;0xA2;linux/devices/startracker/StrHelper.h;STR_HELPER
+0x5ea3;STRHLP_FileCreationFailed;Failed to create download image or read flash file;0xA3;linux/devices/startracker/StrHelper.h;STR_HELPER
+0x5ea4;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;0xA4;linux/devices/startracker/StrHelper.h;STR_HELPER
+0x5ea5;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;0xA5;linux/devices/startracker/StrHelper.h;STR_HELPER
+0x5ea6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;0xA6;linux/devices/startracker/StrHelper.h;STR_HELPER
+0x5ea7;STRHLP_StatusError;Status field in reply signals error;0xA7;linux/devices/startracker/StrHelper.h;STR_HELPER
+0x5ea8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);0xA8;linux/devices/startracker/StrHelper.h;STR_HELPER
+0x5ba0;IPCI_PapbBusy;;0xA0;linux/obc/PapbVcInterface.h;CCSDS_IP_CORE_BRIDGE
+0x5ca0;PTME_UnknownVcId;;0xA0;linux/obc/Ptme.h;PTME
+0x63a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;0xA0;linux/obc/PtmeConfig.h;RATE_SETTER
+0x63a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);0xA1;linux/obc/PtmeConfig.h;RATE_SETTER
+0x63a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;0xA2;linux/obc/PtmeConfig.h;RATE_SETTER
+0x63a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;0xA3;linux/obc/PtmeConfig.h;RATE_SETTER
+0x61a0;PDEC_AbandonedCltu;;0xA0;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61a1;PDEC_FrameDirty;;0xA1;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61a2;PDEC_FrameIllegalMultipleReasons;;0xA2;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61a3;PDEC_AdDiscardedLockout;;0xA3;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61a4;PDEC_AdDiscardedWait;;0xA4;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61a5;PDEC_AdDiscardedNsVs;;0xA5;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61b0;PDEC_CommandNotImplemented;Received action message with unknown action id;0xB0;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61a6;PDEC_NoReport;;0xA6;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61a7;PDEC_ErrorVersionNumber;;0xA7;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61a8;PDEC_IllegalCombination;;0xA8;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61a9;PDEC_InvalidScId;;0xA9;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61aa;PDEC_InvalidVcIdMsb;;0xAA;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61ab;PDEC_InvalidVcIdLsb;;0xAB;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61ac;PDEC_NsNotZero;;0xAC;linux/obc/PdecHandler.h;PDEC_HANDLER
+0x61ae;PDEC_InvalidBcCc;;0xAE;linux/obc/PdecHandler.h;PDEC_HANDLER
diff --git a/config/retvals.py b/config/retvals.py
new file mode 100644
index 0000000..d6f7be9
--- /dev/null
+++ b/config/retvals.py
@@ -0,0 +1,22 @@
+import os
+from tmtccmd.fsfw import parse_fsfw_returnvalues_csv, RetvalDictT
+from tmtccmd.logging import get_console_logger
+
+DEFAULT_RETVAL_CSV_NAME = "config/returnvalues.csv"
+__RETVAL_DICT = None
+LOGGER = get_console_logger()
+
+
+def get_retval_dict() -> RetvalDictT:
+ global __RETVAL_DICT
+ if __RETVAL_DICT is None:
+ if os.path.exists(DEFAULT_RETVAL_CSV_NAME):
+ __RETVAL_DICT = parse_fsfw_returnvalues_csv(
+ csv_file=DEFAULT_RETVAL_CSV_NAME
+ )
+ else:
+ LOGGER.warning(
+ f"No Return Value CSV file found at {DEFAULT_RETVAL_CSV_NAME}"
+ )
+ __RETVAL_DICT = dict()
+ return __RETVAL_DICT
diff --git a/config/version.py b/config/version.py
index eb51c97..56db5af 100644
--- a/config/version.py
+++ b/config/version.py
@@ -1,6 +1,6 @@
SW_NAME = "eive"
VERSION_MAJOR = 1
-VERSION_MINOR = 8
+VERSION_MINOR = 9
VERSION_SUBMINOR = 0
-__version__ = "1.8.0"
+__version__ = "1.9.0"
diff --git a/gomspace/gomspace_common.py b/gomspace/gomspace_common.py
index 1b3df79..546730f 100644
--- a/gomspace/gomspace_common.py
+++ b/gomspace/gomspace_common.py
@@ -6,15 +6,35 @@
@author J. Meier
@date 17.12.2020
"""
+import enum
+
+from tmtccmd.tc.service_8_functional_cmd import generate_action_command
+from tmtccmd.tc.definitions import PusTelecommand
-class GomspaceDeviceActions:
- PING = bytearray([0x0, 0x0, 0x0, 0x1])
- REBOOT = bytearray([0x0, 0x0, 0x0, 0x4])
- PARAM_GET = bytearray([0x0, 0x0, 0x0, 0x00])
- PARAM_SET = bytearray([0x0, 0x0, 0x0, 0xFF])
- WDT_RESET = bytearray([0x0, 0x0, 0x0, 0x9])
- REQUEST_HK_TABLE = bytearray([0x0, 0x0, 0x0, 0x10])
+class GomspaceDeviceActionIds(enum.IntEnum):
+ PING = 1
+ REBOOT = 4
+ PARAM_GET = 0
+ PARAM_SET = 255
+ WDT_RESET = 9
+ REQUEST_HK_TABLE = 16
+ PRINT_SWITCH_V_I = 32
+ PRINT_LATCHUPS = 33
+
+
+class GomspaceOpCodes:
+ # Request HK
+ REQUEST_HK_ONCE = ["req-hk-once", "128"]
+ PRINT_SWITCH_V_I = ["print-switch-vi", "129"]
+ PRINT_LATCHUPS = ["print-latchups", "130"]
+
+
+class SetIds:
+ PDU_1 = 0x01
+ PDU_2 = 0x02
+ P60_DOCK = 0x03
+ ACU = 0x04
class TableIds:
@@ -37,96 +57,104 @@ class Channel:
off = 0
-def pack_get_param_command(object_id: bytearray, table_id: int, memory_address: bytearray,
- parameter_size: int) -> bytearray:
- """ Function to generate a command to retrieve parameters like the temperature from a gomspace device.
+def pack_get_param_command(
+ object_id: bytearray, table_id: int, memory_address: bytearray, parameter_size: int
+) -> PusTelecommand:
+ """Function to generate a command to retrieve parameters like the temperature from a gomspace device.
@param object_id: The object id of the gomspace device handler.
@param table_id: The table id of the gomspace device
@param memory_address: Address offset within table of the value to read.
@param parameter_size: Size of the value to read. E.g. temperature is uint16_t and thus parameter_size is 2
@return: The command as bytearray.
"""
- action_id = GomspaceDeviceActions.PARAM_GET
- command = bytearray()
- command = command + object_id + action_id
- command.append(table_id)
- command = command + memory_address
- command.append(parameter_size)
- return command
+ app_data = bytearray()
+ app_data.append(table_id)
+ app_data.extend(memory_address)
+ app_data.append(parameter_size)
+ return generate_action_command(
+ object_id=object_id,
+ action_id=GomspaceDeviceActionIds.PARAM_GET,
+ app_data=app_data,
+ )
-def pack_set_param_command(object_id: bytearray, memory_address: bytearray, parameter_size: int,
- parameter: int) -> bytearray:
- """ Function to generate a command to set a parameter
- @param object_id: The object id of the gomspace device handler.
- @param memory_address: Address offset within table of the value to set.
- @param parameter: The parameter value to set.
- @param parameter_size: Size of the value to set. There are uint8_t, uint16_t and uint32_t in the device tables.
- @return: The command as bytearray.
+def pack_set_param_command(
+ object_id: bytearray,
+ memory_address: bytearray,
+ parameter_size: int,
+ parameter: int,
+ ssc: int = 0,
+) -> PusTelecommand:
+ """Function to generate a command to set a parameter
+ :param object_id: The object id of the gomspace device handler.
+ :param memory_address: Address offset within table of the value to set.
+ :param parameter: The parameter value to set.
+ :param parameter_size: Size of the value to set. There are uint8_t, uint16_t and uint32_t
+ in the device tables.
+ :param ssc:
+ :return: The command as bytearray.
"""
- action_id = GomspaceDeviceActions.PARAM_SET
- command = bytearray()
- command = command + object_id + action_id
- command = command + memory_address
- command.append(parameter_size)
+ action_id = GomspaceDeviceActionIds.PARAM_SET
+ app_data = bytearray()
+ app_data += memory_address
+ app_data.append(parameter_size)
if parameter_size == 1:
- command.append(parameter)
+ app_data.append(parameter)
elif parameter_size == 2:
byte_one = 0xFF00 & parameter >> 8
byte_two = 0xFF & parameter
- command.append(byte_one)
- command.append(byte_two)
+ app_data.append(byte_one)
+ app_data.append(byte_two)
elif parameter_size == 4:
byte_one = 0xFF000000 & parameter >> 24
byte_two = 0xFF0000 & parameter >> 16
byte_three = 0xFF00 & parameter >> 8
byte_four = 0xFF & parameter
- command.append(byte_one)
- command.append(byte_two)
- command.append(byte_three)
- command.append(byte_four)
- return command
+ app_data.append(byte_one)
+ app_data.append(byte_two)
+ app_data.append(byte_three)
+ app_data.append(byte_four)
+ return generate_action_command(
+ object_id=object_id, action_id=action_id, app_data=app_data, ssc=ssc
+ )
-def pack_ping_command(object_id: bytearray, data: bytearray) -> bytearray:
- """" Function to generate the command to ping a gomspace device
+def pack_ping_command(object_id: bytearray, data: bytearray) -> PusTelecommand:
+ """ " Function to generate the command to ping a gomspace device
@param object_id Object Id of the gomspace device handler.
@param data Bytearray containing the bytes to send to the gomspace device. For now the on board software
supports only the handling of up to 33 bytes.
@note The ping request sends the specified data to a gompsace device. These
data are simply copied by the device and then sent back.
"""
- action_id = GomspaceDeviceActions.PING
- command = object_id + action_id + data
- return command
+ return generate_action_command(
+ object_id=object_id, action_id=GomspaceDeviceActionIds.PING, app_data=data
+ )
-def pack_gnd_wdt_reset_command(object_id: bytearray) -> bytearray:
- """" Function to generate the command to reset the watchdog of a gomspace device.
+def pack_gnd_wdt_reset_command(object_id: bytearray) -> PusTelecommand:
+ """ " Function to generate the command to reset the watchdog of a gomspace device.
@param object_id Object Id of the gomspace device handler.
"""
- action_id = GomspaceDeviceActions.WDT_RESET
- command = bytearray()
- command += object_id + action_id
- return command
+ return generate_action_command(
+ object_id=object_id, action_id=GomspaceDeviceActionIds.WDT_RESET
+ )
-def pack_reboot_command(object_id: bytearray) -> bytearray:
- """ Function to generate the command which triggers a reboot of a gomspace device
+def pack_reboot_command(object_id: bytearray) -> PusTelecommand:
+ """Function to generate the command which triggers a reboot of a gomspace device
@param object_id The object id of the gomspace device handler.
"""
- action_id = GomspaceDeviceActions.REBOOT
- command = bytearray()
- command += object_id + action_id
- return command
+ return generate_action_command(
+ object_id=object_id, action_id=GomspaceDeviceActionIds.REBOOT
+ )
-def pack_request_full_hk_table_command(object_id: bytearray) -> bytearray:
- """ Function to generate the command to request the full housekeeping table from a gomspace
+def pack_request_full_hk_table_command(object_id: bytearray) -> PusTelecommand:
+ """Function to generate the command to request the full housekeeping table from a gomspace
device.
@param object_id The object id of the gomspace device handler.
"""
- action_id = GomspaceDeviceActions.REQUEST_HK_TABLE
- command = bytearray()
- command = object_id + action_id
- return command
+ return generate_action_command(
+ object_id=object_id, action_id=GomspaceDeviceActionIds.REQUEST_HK_TABLE
+ )
diff --git a/lint.py b/lint.py
index 4a42485..e91bd36 100755
--- a/lint.py
+++ b/lint.py
@@ -4,19 +4,37 @@ import sys
def main():
- # Ignore folder created by venv
- exclude_dirs_flag = '--exclude bin,lib'
- additional_flags_both_steps = '--count --statistics'
- additional_flags_first_step = '--select=E9,F63,F7,F82 --show-source'
- flake8_first_step_cmd = \
- f'flake8 . {additional_flags_both_steps} {additional_flags_first_step} {exclude_dirs_flag}'
+ exclude_dirs_flag = ""
+ if not os.path.exists("setup.cfg"):
+ exclude_dirs_flag = (
+ "--exclude .git,__pycache__,docs/conf.py,old,build,dist,venv"
+ )
+ additional_flags_both_steps = "--count --statistics"
+ additional_flags_first_step = "--select=E9,F63,F7,F82 --show-source"
+ python_exe = ""
+ if os.name == "nt":
+ python_exe = "py -m"
+ flake8_first_step_cmd = (
+ f"{python_exe} flake8 . {additional_flags_both_steps} "
+ f"{additional_flags_first_step} {exclude_dirs_flag}"
+ )
status = os.system(flake8_first_step_cmd)
- if os.WEXITSTATUS(status) != 0:
- print("Flake8 linter errors")
- sys.exit(0)
- flake8_second_step_cmd = \
- f'flake8 . {additional_flags_both_steps} --exit-zero --max-complexity=10 ' \
- f'--max-line-length=127 {exclude_dirs_flag}'
+ if os.name == "nt":
+ if status != 0:
+ print(f"Flake8 linter errors with status {status}")
+ else:
+ if os.WEXITSTATUS(status) != 0:
+ print(f"Flake8 linter errors with status {status}")
+ sys.exit(0)
+ additional_flags_second_step = (
+ '--exit-zero --max-complexity=10 --per-file-ignores="__init__.py:F401"'
+ )
+ if not os.path.exists("setup.cfg"):
+ additional_flags_second_step += " --max-line-length=100"
+ flake8_second_step_cmd = (
+ f"{python_exe} flake8 . {additional_flags_both_steps} {additional_flags_second_step}"
+ f" {exclude_dirs_flag}"
+ )
os.system(flake8_second_step_cmd)
diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py
new file mode 100644
index 0000000..fafaa78
--- /dev/null
+++ b/pus_tc/cmd_definitions.py
@@ -0,0 +1,747 @@
+from tmtccmd.config import (
+ add_op_code_entry,
+ add_service_op_code_entry,
+ generate_op_code_options,
+ ServiceOpCodeDictT,
+ OpCodeDictKeys,
+)
+from config.definitions import CustomServiceList
+from pus_tc.devs.bpx_batt import BpxOpCodes
+
+
+def add_bpx_cmd_definitions(cmd_dict: ServiceOpCodeDictT):
+ op_code_dict = dict()
+ add_op_code_entry(
+ op_code_dict=op_code_dict, keys=BpxOpCodes.HK, info="Request BPX HK"
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict, keys=BpxOpCodes.RST_BOOT_CNT, info="Reset Boot Count"
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=BpxOpCodes.REQUEST_CFG,
+ info="Request Configuration Struct (Step 1)",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=BpxOpCodes.REQUEST_CFG_HK,
+ info="Request Configuration Struct HK (Step 2)",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict, keys=BpxOpCodes.REBOOT, info="Reboot Command"
+ )
+ add_service_op_code_entry(
+ srv_op_code_dict=cmd_dict,
+ name=CustomServiceList.BPX_BATTERY.value,
+ info="BPX Battery Handler",
+ op_code_entry=op_code_dict,
+ )
+
+
+def add_core_controller_definitions(cmd_dict: ServiceOpCodeDictT):
+ from pus_tc.system.core import OpCodes
+
+ od = dict()
+ add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT, info="Reboot with Prompt")
+ add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_SELF, info="Reboot Self")
+ add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_0_0, info="Reboot 0 0")
+ add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_0_1, info="Reboot 0 1")
+ add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_1_0, info="Reboot 1 0")
+ add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_1_1, info="Reboot 1 1")
+ add_op_code_entry(
+ op_code_dict=od,
+ keys=OpCodes.ENABLE_REBOOT_FILE_HANDLING,
+ info="Enable reboot file handling",
+ )
+ add_op_code_entry(
+ op_code_dict=od,
+ keys=OpCodes.DISABLE_REBOOT_FILE_HANDLING,
+ info="Disable reboot file handling",
+ )
+ add_op_code_entry(
+ op_code_dict=od,
+ keys=OpCodes.RESET_ALL_REBOOT_COUNTERS,
+ info="Reset all reboot counters",
+ )
+ add_op_code_entry(
+ op_code_dict=od,
+ keys=OpCodes.RESET_REBOOT_COUNTER_00,
+ info="Reset reboot counter 0 0",
+ )
+ add_op_code_entry(
+ op_code_dict=od,
+ keys=OpCodes.RESET_REBOOT_COUNTER_01,
+ info="Reset reboot counter 0 1",
+ )
+ add_op_code_entry(
+ op_code_dict=od,
+ keys=OpCodes.RESET_REBOOT_COUNTER_10,
+ info="Reset reboot counter 1 0",
+ )
+ add_op_code_entry(
+ op_code_dict=od,
+ keys=OpCodes.RESET_REBOOT_COUNTER_11,
+ info="Reset reboot counter 1 1",
+ )
+ add_op_code_entry(
+ op_code_dict=od,
+ keys=OpCodes.GET_HK,
+ info="Request housekeeping set",
+ )
+ add_service_op_code_entry(
+ srv_op_code_dict=cmd_dict,
+ name=CustomServiceList.CORE.value,
+ info="Reboot Self",
+ op_code_entry=od,
+ )
+
+
+def add_pl_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
+ from pus_tc.devs.plpcdu import OpCodes, Info
+
+ op_code_dict = dict()
+ add_op_code_entry(
+ op_code_dict=op_code_dict, keys=OpCodes.SWITCH_ON, info=Info.SWITCH_ON
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.NORMAL_SSR,
+ info=Info.NORMAL_SSR,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.NORMAL_DRO,
+ info=Info.NORMAL_DRO,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.NORMAL_X8,
+ info=Info.NORMAL_X8,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.NORMAL_TX,
+ info=Info.NORMAL_TX,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.NORMAL_MPA,
+ info=Info.NORMAL_MPA,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.NORMAL_HPA,
+ info=Info.NORMAL_HPA,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict, keys=OpCodes.SWITCH_OFF, info=Info.SWITCH_OFF
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.UPDATE_DRO_TO_X8_WAIT,
+ info="Update DRO to X8 wait time",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.INJECT_SSR_TO_DRO_FAILURE,
+ info="Inject failure SSR to DRO transition",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.INJECT_DRO_TO_X8_FAILURE,
+ info="Inject failure in DRO to X8 transition",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.INJECT_X8_TO_TX_FAILURE,
+ info="Inject failure in X8 to TX transition",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.INJECT_TX_TO_MPA_FAILURE,
+ info="Inject failure in TX to MPA transition",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.INJECT_MPA_TO_HPA_FAILURE,
+ info="Inject failure in MPA to HPA transition",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=OpCodes.INJECT_ALL_ON_FAILURE,
+ info="Inject failure in all on mode",
+ )
+ add_service_op_code_entry(
+ srv_op_code_dict=cmd_dict,
+ name=CustomServiceList.PL_PCDU.value,
+ info="PL PCDU",
+ op_code_entry=op_code_dict,
+ )
+
+
+def add_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
+ from pus_tc.devs.p60dock import P60OpCodes, GomspaceOpCodes, Info
+ from pus_tc.devs.pdu1 import Pdu1OpCodes
+ from pus_tc.devs.pdu2 import Pdu2OpCodes
+
+ op_code_dict = dict()
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=P60OpCodes.STACK_3V3_ON,
+ info=Info.STACK_3V3_ON,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=P60OpCodes.STACK_3V3_OFF,
+ info=Info.STACK_3V3_OFF,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=P60OpCodes.STACK_5V_ON,
+ info=Info.STACK_5V_ON,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=P60OpCodes.STACK_5V_OFF,
+ info=Info.STACK_5V_OFF,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=GomspaceOpCodes.REQUEST_HK_ONCE,
+ info="P60 Dock: Request HK once",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
+ info="P60 Dock: Print Switches, Voltages, Currents",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=GomspaceOpCodes.PRINT_LATCHUPS,
+ info="P60 Dock: Print Latchups",
+ )
+ add_op_code_entry(op_code_dict=op_code_dict, keys=P60OpCodes.TEST, info="P60 Tests")
+ add_service_op_code_entry(
+ srv_op_code_dict=cmd_dict,
+ name=CustomServiceList.P60DOCK.value,
+ info="P60 Device",
+ op_code_entry=op_code_dict,
+ )
+
+ op_code_dict = dict()
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.TCS_BOARD_ON.value,
+ info="PDU1: Turn TCS board on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.TCS_BOARD_OFF.value,
+ info="PDU1: Turn TCS board off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.STAR_TRACKER_ON.value,
+ info="PDU1: Turn star tracker on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.STAR_TRACKER_OFF.value,
+ info="PDU1: Turn star tracker off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.SUS_NOMINAL_ON.value,
+ info="PDU1: Turn SUS nominal on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.SUS_NOMINAL_OFF.value,
+ info="PDU1: Turn SUS nominal off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.ACS_A_SIDE_ON.value,
+ info="PDU1: Turn ACS A side on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.ACS_A_SIDE_OFF.value,
+ info="PDU1: Turn ACS A side off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.SYRLINKS_ON.value,
+ info="PDU1: Turn Syrlinks on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.SYRLINKS_OFF.value,
+ info="PDU1: Turn Syrlinks off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.MGT_ON.value,
+ info="PDU1: Turn MGT on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.MGT_OFF.value,
+ info="PDU1: Turn MGT off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.PLOC_ON.value,
+ info="PDU1: Turn PLOC on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.PLOC_OFF.value,
+ info="PDU1: Turn PLOC off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.SCEX_ON.value,
+ info="PDU1: Turn Solar Cell Experiment on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu1OpCodes.SCEX_OFF.value,
+ info="PDU1: Turn Solar Cell Experiment off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=GomspaceOpCodes.REQUEST_HK_ONCE,
+ info="PDU1: Request HK once",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
+ info="PDU1: Print Switches, Voltages, Currents",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=GomspaceOpCodes.PRINT_LATCHUPS,
+ info="PDU1: Print Latchups",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict, keys=Pdu1OpCodes.TESTS.value, info="PDU1 Tests"
+ )
+ add_service_op_code_entry(
+ srv_op_code_dict=cmd_dict,
+ name=CustomServiceList.PDU1.value,
+ info="PDU1 Device",
+ op_code_entry=op_code_dict,
+ )
+
+ op_code_dict = dict()
+ add_op_code_entry(op_code_dict=op_code_dict, keys="0", info="PDU2 Tests")
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.ACS_SIDE_B_ON.value,
+ info="PDU2: Turn ACS Side B on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.ACS_SIDE_B_OFF.value,
+ info="PDU2: Turn ACS Side B off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.SUS_REDUNDANT_ON.value,
+ info="PDU2: Turn SUS redundant on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.SUS_REDUNDANT_OFF.value,
+ info="PDU2: Turn SUS redundant off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.RW_ON.value,
+ info="PDU2: Turn reaction wheels on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.RW_OFF.value,
+ info="PDU2: Turn reaction wheels off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.PL_PCDU_VBAT_NOM_ON.value,
+ info="PDU2: PL PCDU Switch Channel Nominal (1) on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.PL_PCDU_VBAT_NOM_OFF.value,
+ info="PDU2: PL PCDU Switch Channel Nominal (1) off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.PL_PCDU_VBAT_RED_ON.value,
+ info="PDU2: PL PCDU Switch Channel Redundant (1) on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.PL_PCDU_VBAT_RED_OFF.value,
+ info="PDU2: PL PCDU Switch Channel Redundant (1) off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.TCS_HEATER_IN_ON.value,
+ info="PDU2: Switch TCS Heater Input on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.TCS_HEATER_IN_OFF.value,
+ info="PDU2: Switch TCS Heater Input off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.SOLAR_ARRAY_DEPL_ON.value,
+ info="PDU2: Switch Solar Array Deployment On",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.SOLAR_ARRAY_DEPL_OFF.value,
+ info="PDU2: Switch Solar Array Deployment Off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.PL_CAMERA_ON.value,
+ info="PDU2: Turn payload camera on",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=Pdu2OpCodes.PL_CAMERA_OFF.value,
+ info="PDU2: Turn payload camera off",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=GomspaceOpCodes.REQUEST_HK_ONCE,
+ info="PDU2: Request HK once",
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
+ info="PDU2: Print Switches, Voltages, Currents",
+ options={OpCodeDictKeys.TIMEOUT: 2.0},
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=GomspaceOpCodes.PRINT_LATCHUPS,
+ info="PDU2: Print Latchups",
+ )
+ add_service_op_code_entry(
+ srv_op_code_dict=cmd_dict,
+ name="pdu2",
+ info="PDU2 Device",
+ op_code_entry=op_code_dict,
+ )
+
+
+def add_imtq_cmds(cmd_dict: ServiceOpCodeDictT):
+ op_code_dict_srv_imtq = {
+ "0": ("IMTQ Tests All", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("IMTQ perform pos X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("IMTQ perform neg X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("IMTQ perform pos Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("IMTQ perform neg Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": ("IMTQ perform pos Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "6": ("IMTQ perform neg Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "7": ("IMTQ command dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "8": ("IMTQ get commanded dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_imtq_tuple = ("IMTQ Device", op_code_dict_srv_imtq)
+ cmd_dict[CustomServiceList.IMTQ.value] = service_imtq_tuple
+
+
+def add_rw_cmds(cmd_dict: ServiceOpCodeDictT):
+ op_code_dict_srv_rw = {
+ "0": ("Reaction Wheel: Run all commands", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("Reaction Wheel: Set speed", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("Reaction Wheel: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("Reaction Wheel: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("Reaction Wheel: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": (
+ "Reaction Wheel: Send get-telemetry-command",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ }
+ service_rw_tuple = ("Reaction Wheel", op_code_dict_srv_rw)
+ cmd_dict[CustomServiceList.REACTION_WHEEL_1.value] = service_rw_tuple
+ cmd_dict[CustomServiceList.REACTION_WHEEL_2.value] = service_rw_tuple
+ cmd_dict[CustomServiceList.REACTION_WHEEL_3.value] = service_rw_tuple
+ cmd_dict[CustomServiceList.REACTION_WHEEL_4.value] = service_rw_tuple
+
+
+def add_rad_sens_cmds(cmd_dict: ServiceOpCodeDictT):
+ op_code_dict_srv_rad_sensor = {
+ "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
+
+
+def add_ploc_mpsoc_cmds(cmd_dict: ServiceOpCodeDictT):
+ op_code_dict_srv_ploc_mpsoc = {
+ "0": ("Ploc MPSoC: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("Ploc MPSoC: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("Ploc MPSoC: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("Ploc MPSoC: Memory write", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("Ploc MPSoC: Memory read", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": ("Ploc MPSoC: Flash write", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "6": ("Ploc MPSoC: Flash delete", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "7": ("Ploc MPSoC: Replay start", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "8": ("Ploc MPSoC: Replay stop", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "9": ("Ploc MPSoC: Downlink pwr on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "10": ("Ploc MPSoC: Downlink pwr off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "11": ("Ploc MPSoC: Replay write sequence", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "12": ("Ploc MPSoC: OBSW reset sequence count", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "13": ("Ploc MPSoC: Read DEADBEEF address", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "14": ("Ploc MPSoC: Mode replay", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_ploc_mpsoc_tuple = ("Ploc MPSoC", op_code_dict_srv_ploc_mpsoc)
+ cmd_dict[CustomServiceList.PLOC_MPSOC.value] = service_ploc_mpsoc_tuple
+
+
+def add_ploc_supv_cmds(cmd_dict: ServiceOpCodeDictT):
+ op_code_dict_ploc_mem_dumper = {
+ "0": ("PLOC Memory Dumper: MRAM dump", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_ploc_memory_dumper_tuple = (
+ "PLOC Memory Dumper",
+ op_code_dict_ploc_mem_dumper,
+ )
+
+ op_code_dict_srv_ploc_supv = {
+ "0": ("PLOC Supervisor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("PLOC Supervisor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("PLOC Supervisor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("PLOC Supervisor: Get HK Report", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("PLOC Supervisor: Restart MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": ("PLOC Supervisor: Start MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "6": ("PLOC Supervisor: Shutdown MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "7": (
+ "PLOC Supervisor: Select MPSoC boot image",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "8": ("PLOC Supervisor: Set max restart tries", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "9": ("PLOC Supervisor: Reset MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "10": ("PLOC Supervisor: Set time reference", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "11": ("PLOC Supervisor: Set boot timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "12": ("PLOC Supervisor: Disable Hk", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "13": (
+ "PLOC Supervisor: Request boot status report",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "14": ("PLOC Supervisor: Update available", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "15": ("PLOC Supervisor: Watchdogs enable", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "16": (
+ "PLOC Supervisor: Watchdog Configure Timeout",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "17": ("PLOC Supervisor: Enable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "18": ("PLOC Supervisor: Disable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "19": ("PLOC Supervisor: Auto calibrate alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "20": ("PLOC Supervisor: Set alert limit", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "21": ("PLOC Supervisor: Set alert irq filter", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "22": ("PLOC Supervisor: Set ADC sweep period", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "23": (
+ "PLOC Supervisor: Set ADC enabled channels",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "24": (
+ "PLOC Supervisor: Set ADC window and stride",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "25": ("PLOC Supervisor: Set ADC threshold", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "26": (
+ "PLOC Supervisor: Request latchup status report",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "27": ("PLOC Supervisor: Copy ADC data to MRAM", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "28": (
+ "PLOC Supervisor: Enable/Disable NVM0/1/3",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "29": ("PLOC Supervisor: Select NVM", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "30": ("PLOC Supervisor: Run auto EM tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "31": ("PLOC Supervisor: MRAM Wipe", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "33": ("PLOC Supervisor: Print CPU stats", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "34": ("PLOC Supervisor: Set debug verbosity", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "35": ("PLOC Supervisor: Set GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "36": ("PLOC Supervisor: Read GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "37": ("PLOC Supervisor: Restart supervisor", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "38": (
+ "PLOC Supervisor: Factory reset clear all",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "39": (
+ "PLOC Supervisor: Factory reset clear mirror entries",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "40": (
+ "PLOC Supervisor: Factory reset clear circular entries",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "41": ("PLOC Supervisor: CAN loopback test", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
+
+ op_code_dict_srv_ploc_updater = {
+ "0": (
+ "Ploc Updater: Update uboot on partition A",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "1": (
+ "Ploc Updater: Update bitstream on partition A",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "2": (
+ "Ploc Updater: Update linux on partition A",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "3": (
+ "Ploc Updater: Update application on partition A",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "4": (
+ "Ploc Updater: Update uboot on partition B",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "5": (
+ "Ploc Updater: Update bitstream on partition B",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "6": (
+ "Ploc Updater: Update linux on partition B",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ "7": (
+ "Ploc Updater: Update application on partition B",
+ {OpCodeDictKeys.TIMEOUT: 2.0},
+ ),
+ }
+ service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
+ cmd_dict[CustomServiceList.PLOC_SUPV.value] = service_ploc_supv_tuple
+ cmd_dict[CustomServiceList.PLOC_UPDATER.value] = service_ploc_updater_tuple
+ cmd_dict[
+ CustomServiceList.PLOC_MEMORY_DUMPER.value
+ ] = service_ploc_memory_dumper_tuple
+
+
+def add_system_cmds(cmd_dict: ServiceOpCodeDictT):
+ from pus_tc.system.acs import AcsOpCodes, SusOpCodes
+ import pus_tc.system.tcs as tcs
+
+ default_opts = generate_op_code_options(
+ enter_listener_mode=False, custom_timeout=8.0
+ )
+ op_code_dict = dict()
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=AcsOpCodes.ACS_ASS_A_SIDE,
+ info="Switch to ACS board A side",
+ options=default_opts,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=AcsOpCodes.ACS_ASS_B_SIDE,
+ info="Switch to ACS board B side",
+ options=default_opts,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=AcsOpCodes.ACS_ASS_DUAL_MODE,
+ info="Switch to ACS board dual mode",
+ options=default_opts,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=AcsOpCodes.ACS_ASS_A_ON,
+ info="Switch ACS board A side on",
+ options=default_opts,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=AcsOpCodes.ACS_ASS_B_ON,
+ info="Switch ACS board B side on",
+ options=default_opts,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=AcsOpCodes.ACS_ASS_DUAL_ON,
+ info="Switch ACS board dual mode on",
+ options=default_opts,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=AcsOpCodes.ACS_ASS_OFF,
+ info="Switch off ACS board",
+ options=default_opts,
+ )
+ add_service_op_code_entry(
+ srv_op_code_dict=cmd_dict,
+ name=CustomServiceList.ACS_ASS.value,
+ info="ACS Assemblies",
+ op_code_entry=op_code_dict,
+ )
+
+ op_code_dict = dict()
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=SusOpCodes.SUS_ASS_NOM_SIDE,
+ info="Switch SUS board to nominal side",
+ options=default_opts,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=SusOpCodes.SUS_ASS_RED_SIDE,
+ info="Switch SUS board to redundant side",
+ options=default_opts,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=SusOpCodes.SUS_ASS_OFF,
+ info="Switch off SUS board",
+ options=default_opts,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=SusOpCodes.SUS_ASS_DUAL_MODE,
+ info="Switch SUS board to dual mode",
+ options=default_opts,
+ )
+ add_service_op_code_entry(
+ srv_op_code_dict=cmd_dict,
+ name=CustomServiceList.SUS_ASS.value,
+ info="SUS Assembly",
+ op_code_entry=op_code_dict,
+ )
+
+ op_code_dict = dict()
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=tcs.OpCodes.TCS_BOARD_ASS_NORMAL,
+ info=tcs.Info.TCS_BOARD_ASS_NORMAL,
+ options=default_opts,
+ )
+ add_op_code_entry(
+ op_code_dict=op_code_dict,
+ keys=tcs.OpCodes.TCS_BOARD_ASS_OFF,
+ info=tcs.Info.TCS_BOARD_ASS_OFF,
+ options=default_opts,
+ )
+ add_service_op_code_entry(
+ srv_op_code_dict=cmd_dict,
+ name=CustomServiceList.TCS_ASS.value,
+ info="TCS Board Assembly",
+ op_code_entry=op_code_dict,
+ )
diff --git a/pus_tc/core.py b/pus_tc/core.py
deleted file mode 100644
index c29c6fe..0000000
--- a/pus_tc/core.py
+++ /dev/null
@@ -1,112 +0,0 @@
-import enum
-
-from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.tc.definitions import TcQueueT
-from tmtccmd.tc.service_8_functional_cmd import generate_action_command
-from tmtccmd.utility.logger import get_console_logger
-from config.object_ids import CORE_CONTROLLER_ID
-
-LOGGER = get_console_logger()
-
-
-class ActionIds(enum.IntEnum):
- REBOOT = 32
-
-
-class OpCodes(enum.Enum):
- REBOOT = 'reboot'
- REBOOT_SELF = 'reboot_self'
- REBOOT_0_0 = 'reboot_0_0'
- REBOOT_0_1 = 'reboot_0_1'
- REBOOT_1_0 = 'reboot_1_0'
- REBOOT_1_1 = 'reboot_1_1'
-
-
-class Chip(enum.IntEnum):
- CHIP_0 = 0
- CHIP_1 = 1
- NONE = 2
-
-
-class Copy(enum.IntEnum):
- COPY_0_NOM = 0
- COPY_1_GOLD = 1
- NONE = 2
-
-
-def pack_core_commands(tc_queue: TcQueueT, op_code: str):
- if op_code == OpCodes.REBOOT.value:
- reboot_self, chip_select, copy_select = determine_reboot_params()
- perform_reboot_cmd(
- tc_queue=tc_queue, reboot_self=reboot_self, chip=chip_select, copy=copy_select
- )
- elif op_code == OpCodes.REBOOT_SELF.value:
- perform_reboot_cmd(tc_queue=tc_queue, reboot_self=True)
- elif op_code == OpCodes.REBOOT_0_0.value:
- perform_reboot_cmd(
- tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_0, copy=Copy.COPY_0_NOM
- )
- elif op_code == OpCodes.REBOOT_0_1.value:
- perform_reboot_cmd(
- tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_0, copy=Copy.COPY_1_GOLD
- )
- elif op_code == OpCodes.REBOOT_1_0.value:
- perform_reboot_cmd(
- tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_1, copy=Copy.COPY_0_NOM
- )
- elif op_code == OpCodes.REBOOT_1_1.value:
- perform_reboot_cmd(
- tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_1, copy=Copy.COPY_1_GOLD
- )
-
-
-def determine_reboot_params() -> (bool, Chip, Copy):
- chip_select = -1
- copy_select = -1
- reboot_self = input('Reboot self? [y/n]: ')
- if reboot_self in ['y', 'yes', '1']:
- LOGGER.info('Rebooting currently running image')
- return True, chip_select, copy_select
- LOGGER.info('Rebooting image specified by chip and copy')
- while True:
- chip_select = input('Chip select [0/1]: ')
- if chip_select in ['0', '1']:
- if chip_select == '0':
- chip_select = Chip.CHIP_0
- else:
- chip_select = Chip.CHIP_1
- break
- else:
- LOGGER.warning('Invalid chip select value. Try again')
- while True:
- copy_select = input('Copy select [0/1]: ')
- if copy_select in ['0', '1']:
- if copy_select == '0':
- copy_select = Copy.COPY_0_NOM
- else:
- copy_select = Copy.COPY_1_GOLD
- break
- else:
- LOGGER.warning('Invalid copy select value. Try again')
- return False, chip_select, copy_select
-
-
-def perform_reboot_cmd(
- tc_queue: TcQueueT, reboot_self: bool, chip: Chip = Chip.NONE, copy: Copy = Copy.NONE
-):
- tc_data = bytearray()
- if reboot_self:
- tc_queue.appendleft((QueueCommands.PRINT, 'Packing reboot command for current image'))
- tc_data.append(True)
- else:
- tc_data.append(False)
- tc_data.append(chip)
- tc_data.append(copy)
- tc_queue.append(
- (QueueCommands.PRINT, f'Packing reboot command for chip {chip} and copy {copy}')
- )
- action_cmd = generate_action_command(
- object_id=CORE_CONTROLLER_ID, action_id=ActionIds.REBOOT, app_data=tc_data, ssc=0
- )
- tc_queue.appendleft(action_cmd.pack_command_tuple())
-
diff --git a/pus_tc/devs/__init__.py b/pus_tc/devs/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/pus_tc/acu.py b/pus_tc/devs/acu.py
similarity index 58%
rename from pus_tc/acu.py
rename to pus_tc/devs/acu.py
index d31cba6..f08494d 100644
--- a/pus_tc/acu.py
+++ b/pus_tc/devs/acu.py
@@ -5,14 +5,11 @@
@author J. Meier
@date 21.12.2020
"""
-
+import struct
from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
from tmtccmd.config.definitions import QueueCommands
from gomspace.gomspace_common import *
-from pus_tc.p60dock import P60DockConfigTable
-
-from config.object_ids import P60_DOCK_HANDLER
+from pus_tc.devs.p60dock import P60DockConfigTable
class ACUTestProcedure:
@@ -21,6 +18,7 @@ class ACUTestProcedure:
@details Setting all to True will run all tests.
Setting all to False will only run the tests set to True.
"""
+
all = False
reboot = False
read_gnd_wdt = False
@@ -53,79 +51,109 @@ class ACUHkTable:
wdt_gnd_left = TableEntry(bytearray([0x00, 0x74]), TableEntry.uint32_size)
-def pack_acu_test_into(object_id: bytearray, tc_queue: TcQueueT):
+class CommandId:
+ PRINT_CHANNEL_STATS = 51
+
+
+def pack_acu_test_into(
+ object_id: bytearray, tc_queue: TcQueueT, op_code: str
+) -> TcQueueT:
tc_queue.appendleft((QueueCommands.PRINT, "Testing ACU"))
- tc_queue.appendleft(
- (QueueCommands.PRINT, "P60 Dock: Enabling ACU connected to X1 slot (channel 0)")
- )
- p60dock_object_id = P60_DOCK_HANDLER
- command = pack_set_param_command(
- p60dock_object_id, P60DockConfigTable.out_en_0.parameter_address,
- P60DockConfigTable.out_en_0.parameter_size, Channel.on
- )
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "51":
+ tc_queue.appendleft((QueueCommands.PRINT, "ACU: Print channel stats"))
+ command = object_id + struct.pack("!I", CommandId.PRINT_CHANNEL_STATS)
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ return
if ACUTestProcedure.all or ACUTestProcedure.reboot:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reboot"))
command = pack_reboot_command(object_id)
- command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
+ # command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if ACUTestProcedure.all or ACUTestProcedure.read_gnd_wdt:
- tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading ground watchdog timer value"))
- command = pack_get_param_command(
- object_id, TableIds.hk, ACUHkTable.wdt_gnd_left.parameter_address,
- ACUHkTable.wdt_gnd_left.parameter_size
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "ACU: Reading ground watchdog timer value")
)
- command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
+ command = pack_get_param_command(
+ object_id,
+ TableIds.hk,
+ ACUHkTable.wdt_gnd_left.parameter_address,
+ ACUHkTable.wdt_gnd_left.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if ACUTestProcedure.all or ACUTestProcedure.gnd_wdt_reset:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Testing ground watchdog reset"))
command = pack_gnd_wdt_reset_command(object_id)
- command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
+ # command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if ACUTestProcedure.all or ACUTestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Ping Test"))
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
command = pack_ping_command(object_id, ping_data)
- command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
+ # command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if ACUTestProcedure.all or ACUTestProcedure.read_temperature3:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading temperature 3"))
- command = pack_get_param_command(object_id, TableIds.hk, ACUHkTable.temperature3.parameter_address,
- ACUHkTable.temperature3.parameter_size)
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ command = pack_get_param_command(
+ object_id,
+ TableIds.hk,
+ ACUHkTable.temperature3.parameter_address,
+ ACUHkTable.temperature3.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if ACUTestProcedure.all or ACUTestProcedure.read_vboost:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading vboost value"))
- command = pack_get_param_command(object_id, TableIds.config, ACUConfigTable.vboost.parameter_address,
- ACUConfigTable.vboost.parameter_size)
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ command = pack_get_param_command(
+ object_id,
+ TableIds.config,
+ ACUConfigTable.vboost.parameter_address,
+ ACUConfigTable.vboost.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if ACUTestProcedure.all or ACUTestProcedure.read_vbat_max_hi:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading vbat_max_hi"))
- command = pack_get_param_command(object_id, TableIds.config, ACUConfigTable.vbat_max_hi.parameter_address,
- ACUConfigTable.vbat_max_hi.parameter_size)
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ command = pack_get_param_command(
+ object_id,
+ TableIds.config,
+ ACUConfigTable.vbat_max_hi.parameter_address,
+ ACUConfigTable.vbat_max_hi.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if ACUTestProcedure.all or ACUTestProcedure.read_vbat_max_lo:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading vbat_max_lo"))
- command = pack_get_param_command(object_id, TableIds.config, ACUConfigTable.vbat_max_lo.parameter_address,
- ACUConfigTable.vbat_max_lo.parameter_size)
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ command = pack_get_param_command(
+ object_id,
+ TableIds.config,
+ ACUConfigTable.vbat_max_lo.parameter_address,
+ ACUConfigTable.vbat_max_lo.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if ACUTestProcedure.all or ACUTestProcedure.read_ov_mode:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading ov_mode"))
- command = pack_get_param_command(object_id, TableIds.config, ACUConfigTable.ov_mode.parameter_address,
- ACUConfigTable.ov_mode.parameter_size)
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ command = pack_get_param_command(
+ object_id,
+ TableIds.config,
+ ACUConfigTable.ov_mode.parameter_address,
+ ACUConfigTable.ov_mode.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning off ACU"))
- command = pack_set_param_command(p60dock_object_id, P60DockConfigTable.out_en_0.parameter_address,
- P60DockConfigTable.out_en_0.parameter_size, Channel.off)
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ command = pack_set_param_command(
+ p60dock_object_id,
+ P60DockConfigTable.out_en_0.parameter_address,
+ P60DockConfigTable.out_en_0.parameter_size,
+ Channel.off,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
diff --git a/pus_tc/devs/bpx_batt.py b/pus_tc/devs/bpx_batt.py
new file mode 100644
index 0000000..a9f6311
--- /dev/null
+++ b/pus_tc/devs/bpx_batt.py
@@ -0,0 +1,56 @@
+from tmtccmd.tc.definitions import TcQueueT, QueueCommands
+from config.object_ids import BPX_HANDLER_ID
+from tmtccmd.tc.service_8_functional_cmd import generate_action_command
+from tmtccmd.tc.service_3_housekeeping import generate_one_hk_command, make_sid
+
+
+class BpxSetIds:
+ GET_HK_SET = 0
+ GET_CFG_SET = 5
+
+
+class BpxActionIds:
+ REBOOT = 2
+ RESET_COUNTERS = 3
+ SET_CFG = 4
+ GET_CFG = 5
+
+
+class BpxOpCodes:
+ HK = ["0", "hk"]
+ RST_BOOT_CNT = ["1", "rst_boot_cnt"]
+ REQUEST_CFG = ["2", "cfg"]
+ REQUEST_CFG_HK = ["3", "cfg_hk"]
+ REBOOT = ["4", "reboot"]
+
+
+def pack_bpx_commands(tc_queue: TcQueueT, op_code: str):
+ if op_code in BpxOpCodes.HK:
+ tc_queue.appendleft((QueueCommands.PRINT, "Requesting BPX battery HK set"))
+ sid = make_sid(object_id=BPX_HANDLER_ID, set_id=BpxSetIds.GET_HK_SET)
+ cmd = generate_one_hk_command(sid=sid, ssc=0)
+ tc_queue.appendleft(cmd.pack_command_tuple())
+ if op_code in BpxOpCodes.RST_BOOT_CNT:
+ tc_queue.appendleft((QueueCommands.PRINT, "Resetting reboot counters"))
+ cmd = generate_action_command(
+ object_id=BPX_HANDLER_ID, action_id=BpxActionIds.RESET_COUNTERS
+ )
+ tc_queue.appendleft(cmd.pack_command_tuple())
+ if op_code in BpxOpCodes.REQUEST_CFG:
+ tc_queue.appendleft((QueueCommands.PRINT, "Requesting configuration struct"))
+ cmd = generate_action_command(
+ object_id=BPX_HANDLER_ID, action_id=BpxActionIds.GET_CFG
+ )
+ tc_queue.appendleft(cmd.pack_command_tuple())
+ if op_code in BpxOpCodes.REQUEST_CFG_HK:
+ tc_queue.appendleft((QueueCommands.PRINT, "Requesting configuration struct HK"))
+ sid = make_sid(object_id=BPX_HANDLER_ID, set_id=BpxSetIds.GET_CFG_SET)
+ cmd = generate_one_hk_command(sid=sid, ssc=0)
+ tc_queue.appendleft(cmd.pack_command_tuple())
+ if op_code in BpxOpCodes.REBOOT:
+ tc_queue.appendleft((QueueCommands.PRINT, "Rebooting BPX battery"))
+ cmd = generate_action_command(
+ object_id=BPX_HANDLER_ID, action_id=BpxActionIds.REBOOT
+ )
+ tc_queue.appendleft(cmd.pack_command_tuple())
+ pass
diff --git a/pus_tc/devs/ccsds_handler.py b/pus_tc/devs/ccsds_handler.py
new file mode 100644
index 0000000..a7e400d
--- /dev/null
+++ b/pus_tc/devs/ccsds_handler.py
@@ -0,0 +1,115 @@
+# -*- coding: utf-8 -*-
+"""
+@file ccsds_handler.py
+@brief Test commanding of CCSDS Handler
+@author J. Meier
+@date 20.11.2021
+"""
+import struct
+
+from tmtccmd.config.definitions import QueueCommands
+from tmtccmd.tc.packer import TcQueueT
+from spacepackets.ecss.tc import PusTelecommand
+
+
+class CommandIds:
+ # Configures input rate of syrlinks to 400 Khz (results in downlink rate of 200 kbps)
+ SET_LOW_RATE = 0
+ # Configures input rate of syrlinks to 2000 Khz (results in downlink rate of 1000 kbps)
+ SET_HIGH_RATE = 1
+ # Enables the syrlinks transmitter (by using RS485 enables lines)
+ EN_TRANSMITTER = 2
+ # Disables the syrlinks transmitter (by using RS485 enables lines)
+ DIS_TRANSMITTER = 3
+ # Sets an arbitrary bitrate. Normally only set low and set high rate commands should be
+ # required
+ ARBITRARY_BITRATE = 4
+ ENABLE_TX_CLK_MANIPULATOR = 5
+ DISABLE_TX_CLK_MANIPULATOR = 6
+ # Tx data will be updated on rising edge of tx clock
+ UPDATE_ON_RISING_EDGE = 7
+ # Tx data will be updated on falling edge of tx clock
+ UPDATE_ON_FALLING_EDGE = 8
+
+
+def pack_ccsds_handler_test(
+ object_id: bytearray, tc_queue: TcQueueT, op_code: str
+) -> TcQueueT:
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "Testing CCSDS handler with object id: 0x" + object_id.hex(),
+ )
+ )
+ if op_code == "0":
+ tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set low rate"))
+ command = object_id + struct.pack("!I", CommandIds.SET_LOW_RATE)
+ command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "1":
+ tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set high rate"))
+ command = object_id + struct.pack("!I", CommandIds.SET_HIGH_RATE)
+ command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "2":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "CCSDS Handler: Enables the transmitter")
+ )
+ command = object_id + struct.pack("!I", CommandIds.EN_TRANSMITTER)
+ command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "3":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "CCSDS Handler: Disables the transmitter")
+ )
+ command = object_id + struct.pack("!I", CommandIds.DIS_TRANSMITTER)
+ command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "4":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "CCSDS Handler: Set arbitrary bitrate")
+ )
+ bitrate = int(input("Specify bit rate (bps): "))
+ command = (
+ object_id
+ + struct.pack("!I", CommandIds.ARBITRARY_BITRATE)
+ + struct.pack("!I", bitrate)
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "5":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "CCSDS Handler: Enable tx clock manipulator")
+ )
+ command = object_id + struct.pack("!I", CommandIds.ENABLE_TX_CLK_MANIPULATOR)
+ command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "6":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "CCSDS Handler: Disable tx clock manipulator")
+ )
+ command = object_id + struct.pack("!I", CommandIds.DISABLE_TX_CLK_MANIPULATOR)
+ command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "7":
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "CCSDS Handler: Update tx data on rising edge of tx clock",
+ )
+ )
+ command = object_id + struct.pack("!I", CommandIds.UPDATE_ON_RISING_EDGE)
+ command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "8":
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "CCSDS Handler: Update tx data on falling edge of tx clock",
+ )
+ )
+ command = object_id + struct.pack("!I", CommandIds.UPDATE_ON_FALLING_EDGE)
+ command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ return tc_queue
diff --git a/pus_tc/devs/gps.py b/pus_tc/devs/gps.py
new file mode 100644
index 0000000..5297530
--- /dev/null
+++ b/pus_tc/devs/gps.py
@@ -0,0 +1,22 @@
+import enum
+
+from tmtccmd.config.definitions import QueueCommands
+from tmtccmd.tc.definitions import TcQueueT
+from tmtccmd.tc.service_8_functional_cmd import generate_action_command
+
+
+from config.object_ids import GPS_HANDLER_1_ID, GPS_HANDLER_0_ID
+
+
+class GpsOpCodes(enum.Enum):
+ RESET_GNSS = "5"
+
+
+def pack_gps_command(object_id: bytes, tc_queue: TcQueueT, op_code: str):
+ if op_code == GpsOpCodes.RESET_GNSS.value:
+ if object_id == GPS_HANDLER_0_ID:
+ tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 0"))
+ elif object_id == GPS_HANDLER_1_ID:
+ tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 1"))
+ cmd = generate_action_command(object_id=object_id, action_id=int(op_code))
+ tc_queue.appendleft(cmd.pack_command_tuple())
diff --git a/pus_tc/heater.py b/pus_tc/devs/heater.py
similarity index 78%
rename from pus_tc/heater.py
rename to pus_tc/devs/heater.py
index 18adf80..e04b5b0 100644
--- a/pus_tc/heater.py
+++ b/pus_tc/devs/heater.py
@@ -7,7 +7,7 @@
"""
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
+from spacepackets.ecss.tc import PusTelecommand
class SwitchNumbers:
@@ -29,8 +29,8 @@ class ActionIds:
def pack_heater_test_into(object_id: bytearray, tc_queue: TcQueueT):
tc_queue.appendleft((QueueCommands.PRINT, "Testing Heater Switching"))
- heater_number = int(input("Type number of heater to switch: "))
- if heater_number >= SwitchNumbers.NUMBER_OF_SWITCHES:
+ heater_number = int(input("Type number of heater to switch [0-7]: "))
+ if heater_number >= SwitchNumbers.NUMBER_OF_SWITCHES or heater_number < 0:
print("Invalid heater switch number")
return
action = int(input("Turn switch on or off? (0 - off, 1 - on): "))
@@ -43,14 +43,17 @@ def pack_heater_test_into(object_id: bytearray, tc_queue: TcQueueT):
tc_queue.appendleft(command.pack_command_tuple())
-def pack_switch_heater_command(object_id: bytearray, switch_nr: int, switch_action: int) -> bytearray:
- """ Function to generate the command switch a heater
+def pack_switch_heater_command(
+ object_id: bytearray, switch_nr: int, switch_action: int
+) -> bytearray:
+ """Function to generate the command switch a heater
@param object_id The object id of the HeaterHandler object.
@param switch_nr The switch number identifying the heater to switch
@param switch_action Action to perform. 0 - Sets switch off, 1 - Sets switch on.
"""
action_id = ActionIds.SWITCH_HEATER
- command = object_id + action_id
+ command = bytearray()
+ command += object_id + action_id
command.append(switch_nr)
command.append(switch_action)
return command
diff --git a/pus_tc/imtq.py b/pus_tc/devs/imtq.py
similarity index 71%
rename from pus_tc/imtq.py
rename to pus_tc/devs/imtq.py
index 943157c..2ef75a8 100644
--- a/pus_tc/imtq.py
+++ b/pus_tc/devs/imtq.py
@@ -8,7 +8,7 @@
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
+from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command
@@ -38,10 +38,14 @@ class ImtqActionIds:
read_self_test_results = bytearray([0x0, 0x0, 0x0, 0x0D])
-def pack_imtq_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
+def pack_imtq_test_into(
+ object_id: bytearray, tc_queue: TcQueueT, op_code: str
+) -> TcQueueT:
tc_queue.appendleft(
- (QueueCommands.PRINT,
- "Testing ISIS IMTQ handler with object id: 0x" + object_id.hex())
+ (
+ QueueCommands.PRINT,
+ "Testing ISIS IMTQ handler with object id: 0x" + object_id.hex(),
+ )
)
if op_code == "0" or op_code == "1":
@@ -50,12 +54,22 @@ def pack_imtq_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Initiate reading of positive x self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Initiate reading of positive x self test results",
+ )
+ )
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Request dataset with positive x self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Request dataset with positive x self test results",
+ )
+ )
sid = make_sid(object_id, ImtqSetIds.POSITIVE_X_TEST)
command = generate_one_hk_command(sid, 24)
tc_queue.appendleft(command.pack_command_tuple())
@@ -66,12 +80,22 @@ def pack_imtq_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Initiate reading of negative x self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Initiate reading of negative x self test results",
+ )
+ )
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Request dataset with negative x self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Request dataset with negative x self test results",
+ )
+ )
sid = make_sid(object_id, ImtqSetIds.NEGATIVE_X_TEST)
command = generate_one_hk_command(sid, 27)
tc_queue.appendleft(command.pack_command_tuple())
@@ -82,12 +106,22 @@ def pack_imtq_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Initiate reading of positive y self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Initiate reading of positive y self test results",
+ )
+ )
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=29, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Request dataset with positive y self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Request dataset with positive y self test results",
+ )
+ )
sid = make_sid(object_id, ImtqSetIds.POSITIVE_Y_TEST)
command = generate_one_hk_command(sid, 30)
tc_queue.appendleft(command.pack_command_tuple())
@@ -98,12 +132,22 @@ def pack_imtq_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Initiate reading of negative y self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Initiate reading of negative y self test results",
+ )
+ )
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Request dataset with negative y self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Request dataset with negative y self test results",
+ )
+ )
sid = make_sid(object_id, ImtqSetIds.NEGATIVE_Y_TEST)
command = generate_one_hk_command(sid, 33)
tc_queue.appendleft(command.pack_command_tuple())
@@ -114,12 +158,22 @@ def pack_imtq_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
command = PusTelecommand(service=8, subservice=128, ssc=34, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Initiate reading of positive z self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Initiate reading of positive z self test results",
+ )
+ )
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Request dataset with positive z self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Request dataset with positive z self test results",
+ )
+ )
sid = make_sid(object_id, ImtqSetIds.POSITIVE_Y_TEST)
command = generate_one_hk_command(sid, 36)
tc_queue.appendleft(command.pack_command_tuple())
@@ -130,12 +184,22 @@ def pack_imtq_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Initiate reading of negative z self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Initiate reading of negative z self test results",
+ )
+ )
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Request dataset with negative z self test results"))
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "IMTQ: Request dataset with negative z self test results",
+ )
+ )
sid = make_sid(object_id, ImtqSetIds.NEGATIVE_Z_TEST)
command = generate_one_hk_command(sid, 37)
tc_queue.appendleft(command.pack_command_tuple())
@@ -145,7 +209,7 @@ def pack_imtq_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
x_dipole = 0
y_dipole = 0
z_dipole = 0
- duration = 0 # ms
+ duration = 0 # ms
command = pack_dipole_command(object_id, x_dipole, y_dipole, z_dipole, duration)
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
@@ -159,8 +223,10 @@ def pack_imtq_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
return tc_queue
-def pack_dipole_command(object_id: bytearray, x_dipole: int, y_dipole: int, z_dipole: int, duration: int) -> bytearray:
- """ This function packs the command causing the ISIS IMTQ to generate a dipole.
+def pack_dipole_command(
+ object_id: bytearray, x_dipole: int, y_dipole: int, z_dipole: int, duration: int
+) -> bytearray:
+ """This function packs the command causing the ISIS IMTQ to generate a dipole.
@param object_id The object id of the IMTQ handler.
@param x_dipole The dipole of the x coil in 10^-4*Am^2 (max. 2000)
@param y_dipole The dipole of the y coil in 10^-4*Am^2 (max. 2000)
@@ -172,8 +238,8 @@ def pack_dipole_command(object_id: bytearray, x_dipole: int, y_dipole: int, z_di
action_id = ImtqActionIds.start_actuation_dipole
command = bytearray()
command = object_id + action_id
- command.extend(x_dipole.to_bytes(length=2, byteorder='big'))
- command.extend(y_dipole.to_bytes(length=2, byteorder='big'))
- command.extend(z_dipole.to_bytes(length=2, byteorder='big'))
- command.extend(duration.to_bytes(length=2, byteorder='big'))
+ command.extend(x_dipole.to_bytes(length=2, byteorder="big"))
+ command.extend(y_dipole.to_bytes(length=2, byteorder="big"))
+ command.extend(z_dipole.to_bytes(length=2, byteorder="big"))
+ command.extend(duration.to_bytes(length=2, byteorder="big"))
return command
diff --git a/pus_tc/devs/p60dock.py b/pus_tc/devs/p60dock.py
new file mode 100644
index 0000000..2f358ca
--- /dev/null
+++ b/pus_tc/devs/p60dock.py
@@ -0,0 +1,319 @@
+# -*- coding: utf-8 -*-
+"""
+@file tmtcc_tc_p60dock.py
+@brief P60 Dock tests
+@author J. Meier
+@date 13.12.2020
+"""
+from tmtccmd.config.definitions import QueueCommands
+from tmtccmd.tc.packer import TcQueueT
+from tmtccmd.tc.service_3_housekeeping import (
+ generate_one_hk_command,
+ make_sid,
+ generate_one_diag_command,
+)
+from gomspace.gomspace_common import *
+from config.object_ids import P60_DOCK_HANDLER
+
+
+HK_SET_ID = 0x3
+
+
+class P60OpCodes:
+ STACK_3V3_ON = ["stack-3v3-on", "1"]
+ STACK_3V3_OFF = ["stack-3v3-off", "2"]
+ STACK_5V_ON = ["stack-5v-on", "3"]
+ STACK_5V_OFF = ["stack-5v-off", "4"]
+ TEST = ["test", "0"]
+
+
+class Info:
+ PREFIX = "P60 Dock"
+ STACK_3V3_ON = f"{PREFIX}: Turn Stack 3V3 on"
+ STACK_3V3_OFF = f"{PREFIX}: Turn Stack 3V3 off"
+ STACK_5V_ON = f"{PREFIX}: Turn Stack 5V on"
+ STACK_5V_OFF = f"{PREFIX}: Turn Stack 5V off"
+
+
+class P60DockTestProcedure:
+ """
+ @brief Use this class to define the tests to perform for the P60Dock.
+ @details Setting all to True will run all tests.
+ Setting all to False will only run the tests set to True.
+ """
+
+ all = False
+ reboot = False
+ read_gnd_wdt = False
+ gnd_wdt_reset = False
+ ping = False
+ channel_3_off = False # pdu2
+ read_temperature1 = False
+ read_channel_3_state = False # pdu2
+ read_cur_lu_lim_0 = False
+ channel_3_on = False # pdu2
+ invalid_table_id_test = (
+ False # Test to check if software properly handles invalid table ids
+ )
+ invalid_address_test = (
+ False # Test to check if software properly handles invalid addresses
+ )
+ invalid_parameter_size_test = False
+
+
+class P60DockConfigTable:
+ out_en_0 = TableEntry(bytearray([0x00, 0x68]), TableEntry.uint8_size) # ACU VCC
+ out_en_1 = TableEntry(bytearray([0x00, 0x69]), TableEntry.uint8_size) # PDU1 VCC
+ out_en_2 = TableEntry(bytearray([0x00, 0x6A]), TableEntry.uint8_size) # unused
+ out_en_3 = TableEntry(bytearray([0x00, 0x6B]), TableEntry.uint8_size) # PDU2 VCC
+ out_en_4 = TableEntry(bytearray([0x00, 0x6C]), TableEntry.uint8_size) # ACU VBAT
+ out_en_5 = TableEntry(bytearray([0x00, 0x6D]), TableEntry.uint8_size) # unused
+ out_en_6 = TableEntry(bytearray([0x00, 0x6E]), TableEntry.uint8_size) # PDU1 VBAT
+ out_en_7 = TableEntry(bytearray([0x00, 0x6F]), TableEntry.uint8_size) # PDU2 VBAT
+ out_en_8 = TableEntry(bytearray([0x00, 0x70]), TableEntry.uint8_size) # Stack VBAT
+ out_en_9 = TableEntry(bytearray([0x00, 0x71]), TableEntry.uint8_size) # Stack 3V3
+ out_en_10 = TableEntry(bytearray([0x00, 0x72]), TableEntry.uint8_size) # Stack 5V
+ out_en_11 = TableEntry(
+ bytearray([0x00, 0x73]), TableEntry.uint8_size
+ ) # GS 3V3 (unused)
+ out_en_12 = TableEntry(
+ bytearray([0x00, 0x74]), TableEntry.uint8_size
+ ) # GS 5V (unused)
+ # When channel consumes more than cur_lu_lim, channel is turned of immediately
+ cur_lu_lim_0 = TableEntry(bytearray([0x00, 0xF8]), TableEntry.uint16_size)
+
+
+class P60DockHkTable:
+ temperature1 = TableEntry(bytearray([0x00, 0x44]), TableEntry.uint16_size)
+ temperature2 = TableEntry(bytearray([0x00, 0x46]), TableEntry.uint16_size)
+ # Ground WDT value (remaining seconds until reboot)
+ wdt_gnd_left = TableEntry(bytearray([0x00, 0xA8]), TableEntry.uint32_size)
+
+
+def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
+ if op_code in P60OpCodes.STACK_3V3_ON:
+ tc_queue.appendleft((QueueCommands.PRINT, Info.STACK_3V3_ON))
+ command = pack_set_param_command(
+ object_id,
+ P60DockConfigTable.out_en_9.parameter_address,
+ P60DockConfigTable.out_en_9.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in P60OpCodes.STACK_3V3_OFF:
+ tc_queue.appendleft((QueueCommands.PRINT, Info.STACK_3V3_OFF))
+ command = pack_set_param_command(
+ object_id,
+ P60DockConfigTable.out_en_9.parameter_address,
+ P60DockConfigTable.out_en_9.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in P60OpCodes.STACK_5V_ON:
+ tc_queue.appendleft((QueueCommands.PRINT, Info.STACK_5V_ON))
+ command = pack_set_param_command(
+ object_id,
+ P60DockConfigTable.out_en_10.parameter_address,
+ P60DockConfigTable.out_en_10.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in P60OpCodes.STACK_5V_OFF:
+ tc_queue.appendleft((QueueCommands.PRINT, Info.STACK_5V_OFF))
+ command = pack_set_param_command(
+ object_id,
+ P60DockConfigTable.out_en_10.parameter_address,
+ P60DockConfigTable.out_en_10.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in GomspaceOpCodes.REQUEST_HK_ONCE:
+ tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Requesting HK Table Once"))
+ hk_sid = make_sid(object_id=P60_DOCK_HANDLER, set_id=SetIds.P60_DOCK)
+ command = generate_one_hk_command(sid=hk_sid, ssc=0)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in GomspaceOpCodes.PRINT_SWITCH_V_I:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "P60 Dock: Print Switches, Voltages, Currents")
+ )
+ command = generate_action_command(
+ object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in GomspaceOpCodes.PRINT_LATCHUPS:
+ tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Print Latchups"))
+ command = generate_action_command(
+ object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.reboot:
+ tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Reboot"))
+ command = pack_reboot_command(object_id)
+ # command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.read_gnd_wdt:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "P60 Dock: Reading ground watchdog timer value")
+ )
+ command = pack_get_param_command(
+ object_id,
+ TableIds.hk,
+ P60DockHkTable.wdt_gnd_left.parameter_address,
+ P60DockHkTable.wdt_gnd_left.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.gnd_wdt_reset:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "P60 Dock: Testing ground watchdog reset")
+ )
+ command = pack_gnd_wdt_reset_command(object_id)
+ # command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.ping:
+ tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Ping"))
+ ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
+ command = pack_ping_command(object_id, ping_data)
+ # command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_off:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "P60 Dock: Testing setting output channel 3 off")
+ )
+ parameter = 0 # set channel off
+ command = pack_set_param_command(
+ object_id,
+ P60DockConfigTable.out_en_3.parameter_address,
+ P60DockConfigTable.out_en_3.parameter_size,
+ parameter,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.read_temperature1:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "P60 Dock: Testing temperature reading")
+ )
+ command = pack_get_param_command(
+ object_id,
+ TableIds.hk,
+ P60DockHkTable.temperature1.parameter_address,
+ P60DockHkTable.temperature1.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_on:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "P60 Dock: Testing Output Channel 3 state (PDU2)")
+ )
+ command = pack_get_param_command(
+ object_id,
+ TableIds.config,
+ P60DockConfigTable.out_en_3.parameter_address,
+ P60DockConfigTable.out_en_3.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.read_cur_lu_lim_0:
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "P60 Dock: Reading current limit value of output channel 0",
+ )
+ )
+ command = pack_get_param_command(
+ object_id,
+ TableIds.config,
+ P60DockConfigTable.cur_lu_lim_0.parameter_address,
+ P60DockConfigTable.cur_lu_lim_0.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_on:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "P60 Dock: Testing setting output channel 3 on")
+ )
+ parameter = 1 # set channel on
+ command = pack_set_param_command(
+ object_id,
+ P60DockConfigTable.out_en_3.parameter_address,
+ P60DockConfigTable.out_en_3.parameter_size,
+ parameter,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.invalid_table_id_test:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "P60 Dock: Testing invalid table id handling")
+ )
+ table_id_invalid = 5
+ command = pack_get_param_command(
+ object_id,
+ table_id_invalid,
+ P60DockHkTable.temperature1.parameter_address,
+ P60DockHkTable.temperature1.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.invalid_address_test:
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "P60 Dock: Testing invalid address handling in get param command",
+ )
+ )
+ invalid_address = bytearray([0x01, 0xF4])
+ command = pack_get_param_command(
+ object_id,
+ TableIds.hk,
+ invalid_address,
+ P60DockHkTable.temperature1.parameter_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=29, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "P60 Dock: Testing invalid address handling in set param command",
+ )
+ )
+ invalid_address = bytearray([0x01, 0xF4])
+ parameter_size = 2
+ parameter = 1
+ command = pack_set_param_command(
+ object_id, invalid_address, parameter_size, parameter
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if P60DockTestProcedure.all or P60DockTestProcedure.invalid_parameter_size_test:
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "P60 Dock: Testing handling of invalid parameter sizes in get-param command",
+ )
+ )
+ invalid_size = 5
+ command = pack_get_param_command(
+ object_id,
+ TableIds.hk,
+ P60DockHkTable.temperature1.parameter_address,
+ invalid_size,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "P60 Dock: Testing handling of invalid parameter size in set-param command",
+ )
+ )
+ parameter = 1
+ command = pack_set_param_command(
+ object_id,
+ P60DockConfigTable.out_en_3.parameter_address,
+ invalid_size,
+ parameter,
+ )
+ # command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ return tc_queue
diff --git a/pus_tc/devs/pdec_handler.py b/pus_tc/devs/pdec_handler.py
new file mode 100644
index 0000000..c62a639
--- /dev/null
+++ b/pus_tc/devs/pdec_handler.py
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+"""
+@file pdec_handler.py
+@brief Test commanding of PDEC Handler
+@author J. Meier
+@date 22.11.2021
+"""
+from tmtccmd.config.definitions import QueueCommands
+from tmtccmd.tc.packer import TcQueueT
+from spacepackets.ecss.tc import PusTelecommand
+
+
+class CommandIds:
+ # prints the clcw to the console. Useful for debugging
+ PRINT_CLCW = bytearray([0x0, 0x0, 0x0, 0x0])
+ # Print PDEC monitor register
+ PRINT_PDEC_MON = bytearray([0x0, 0x0, 0x0, 0x1])
+
+
+def pack_pdec_handler_test(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "Testing PDEC handler with object id: 0x" + object_id.hex(),
+ )
+ )
+
+ if op_code == "0":
+ tc_queue.appendleft((QueueCommands.PRINT, "PDEC Handler: Print CLCW"))
+ command = object_id + CommandIds.PRINT_CLCW
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "1":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDEC Handler: Print PDEC monitor register")
+ )
+ command = object_id + CommandIds.PRINT_PDEC_MON
+ command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/devs/pdu1.py b/pus_tc/devs/pdu1.py
new file mode 100644
index 0000000..80e3696
--- /dev/null
+++ b/pus_tc/devs/pdu1.py
@@ -0,0 +1,285 @@
+# -*- coding: utf-8 -*-
+"""PDU2 is mounted on the X2 slot of the P60 dock
+@author J. Meier
+@date 17.12.2020
+"""
+from tmtccmd.config.definitions import QueueCommands
+from tmtccmd.tc.packer import TcQueueT
+from tmtccmd.tc.service_3_housekeeping import generate_one_hk_command, make_sid
+from gomspace.gomspace_common import *
+from gomspace.gomspace_pdu_definitions import *
+from config.object_ids import PDU_1_HANDLER_ID
+
+
+class Pdu1OpCodes(enum.Enum):
+ TCS_BOARD_ON = "0"
+ TCS_BOARD_OFF = "1"
+ STAR_TRACKER_ON = "2"
+ STAR_TRACKER_OFF = "3"
+ SUS_NOMINAL_ON = "4"
+ SUS_NOMINAL_OFF = "5"
+ ACS_A_SIDE_ON = "6"
+ ACS_A_SIDE_OFF = "7"
+ SYRLINKS_ON = "8"
+ SYRLINKS_OFF = "9"
+ MGT_ON = "10"
+ MGT_OFF = "11"
+ # Solar Cell Experiment
+ SCEX_ON = "12"
+ SCEX_OFF = "13"
+ PLOC_ON = "14"
+ PLOC_OFF = "15"
+
+ TESTS = "32"
+
+
+class PDU1TestProcedure:
+ """
+ @brief Use this class to define the tests to perform for the PDU2.
+ @details Setting all to True will run all tests.
+ Setting all to False will only run the tests set to True.
+ """
+
+ all = False
+ reboot = False
+ ping = False
+ read_temperature = False
+ turn_channel_2_on = False # Star Tracker connected to this channel (5V)
+ turn_channel_2_off = False
+ turn_channel_3_on = False # MTQ connected to this channel (5V)
+ turn_channel_3_off = False
+
+
+def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
+ tc_queue.appendleft((QueueCommands.PRINT, "Commanding PDU1"))
+
+ if op_code == Pdu1OpCodes.TCS_BOARD_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn TCS board on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_0.parameter_address,
+ PDUConfigTable.out_en_0.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.TCS_BOARD_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn TCS board off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_0.parameter_address,
+ PDUConfigTable.out_en_0.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.STAR_TRACKER_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn star tracker on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_2.parameter_address,
+ PDUConfigTable.out_en_2.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.STAR_TRACKER_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn star tracker off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_2.parameter_address,
+ PDUConfigTable.out_en_2.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.SUS_NOMINAL_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_4.parameter_address,
+ PDUConfigTable.out_en_4.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.SUS_NOMINAL_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_4.parameter_address,
+ PDUConfigTable.out_en_4.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.ACS_A_SIDE_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn ACS Side A on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_7.parameter_address,
+ PDUConfigTable.out_en_7.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.ACS_A_SIDE_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn ACS Side A off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_7.parameter_address,
+ PDUConfigTable.out_en_7.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.SUS_NOMINAL_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_4.parameter_address,
+ PDUConfigTable.out_en_4.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.SCEX_ON.value:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU1: Turn Solar Cell Experiment on")
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_5.parameter_address,
+ PDUConfigTable.out_en_5.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.SCEX_OFF.value:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU1: Turn Solar Cell Experiment off")
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_5.parameter_address,
+ PDUConfigTable.out_en_5.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.SYRLINKS_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn Syrlinks on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_1.parameter_address,
+ PDUConfigTable.out_en_1.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.SYRLINKS_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn Syrlinks off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_1.parameter_address,
+ PDUConfigTable.out_en_1.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.MGT_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn MGT on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_3.parameter_address,
+ PDUConfigTable.out_en_3.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.MGT_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn MGT off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_3.parameter_address,
+ PDUConfigTable.out_en_3.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.PLOC_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn PLOC on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_6.parameter_address,
+ PDUConfigTable.out_en_6.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu1OpCodes.PLOC_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn PLOC off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_6.parameter_address,
+ PDUConfigTable.out_en_6.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in GomspaceOpCodes.REQUEST_HK_ONCE:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Requesting HK Table Once"))
+ hk_sid = make_sid(object_id=PDU_1_HANDLER_ID, set_id=SetIds.PDU_1)
+ command = generate_one_hk_command(sid=hk_sid, ssc=0)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in GomspaceOpCodes.PRINT_SWITCH_V_I:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU1: Print Switches, Voltages, Currents")
+ )
+ command = generate_action_command(
+ object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in GomspaceOpCodes.PRINT_LATCHUPS:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Print Latchups"))
+ command = generate_action_command(
+ object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU1TestProcedure.all or PDU1TestProcedure.ping:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
+ ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
+ command = pack_ping_command(object_id, ping_data)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU1TestProcedure.all or PDU1TestProcedure.read_temperature:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Testing temperature reading"))
+ command = pack_get_param_command(
+ object_id,
+ TableIds.hk,
+ PDUHkTable.temperature.parameter_address,
+ PDUHkTable.temperature.parameter_size,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_on:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU1: Turn channel 2 on (Star Tracker)")
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_2.parameter_address,
+ PDUConfigTable.out_en_2.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_off:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU1: Turn channel 2 off (Star Tracker)")
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_2.parameter_address,
+ PDUConfigTable.out_en_2.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_3_on:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 3 on (MTQ)"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_3.parameter_address,
+ PDUConfigTable.out_en_3.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_3_off:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 3 off (MTQ)"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_3.parameter_address,
+ PDUConfigTable.out_en_3.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/devs/pdu2.py b/pus_tc/devs/pdu2.py
new file mode 100644
index 0000000..5ac74af
--- /dev/null
+++ b/pus_tc/devs/pdu2.py
@@ -0,0 +1,344 @@
+# -*- coding: utf-8 -*-
+"""
+@file tmtcc_tc_pdu2.py
+@brief PDU2 tests
+@details PDU2 is mounted on the X4 slot of the P60 dock
+@author J. Meier
+@date 17.12.2020
+"""
+from tmtccmd.config.definitions import QueueCommands
+from tmtccmd.tc.packer import TcQueueT
+from tmtccmd.tc.service_3_housekeeping import generate_one_hk_command, make_sid
+from gomspace.gomspace_common import *
+from gomspace.gomspace_pdu_definitions import *
+from config.object_ids import PDU_2_HANDLER_ID
+
+
+class Pdu2OpCodes(enum.Enum):
+ ACS_SIDE_B_ON = "1"
+ ACS_SIDE_B_OFF = "2"
+ SUS_REDUNDANT_ON = "3"
+ SUS_REDUNDANT_OFF = "4"
+ RW_ON = "5"
+ RW_OFF = "6"
+ PL_PCDU_VBAT_NOM_ON = "7"
+ PL_PCDU_VBAT_NOM_OFF = "8"
+ PL_PCDU_VBAT_RED_ON = "9"
+ PL_PCDU_VBAT_RED_OFF = "10"
+ TCS_HEATER_IN_ON = "11"
+ TCS_HEATER_IN_OFF = "12"
+ SOLAR_ARRAY_DEPL_ON = "13"
+ SOLAR_ARRAY_DEPL_OFF = "14"
+ PL_CAMERA_ON = "15"
+ PL_CAMERA_OFF = "16"
+ # There is not really a point of the on command, the SW can not be commanded if the OBC is off
+ Q7S_OFF = "32"
+
+
+class PDU2TestProcedure:
+ """
+ @brief Use this class to define the tests to perform for the PDU2.
+ @details Setting all to True will run all tests.
+ Setting all to False will only run the tests set to True.
+ """
+
+ all = False
+ reboot = False
+ read_gnd_wdt = False
+ gnd_wdt_reset = False
+ ping = False
+ channel_2_off = False # Reaction wheels 5V
+ read_temperature = False
+ read_channel_2_state = False # Reaction wheels 5V
+ read_cur_lu_lim_0 = False # OBC
+ channel_2_on = False # Reaction wheels 5V
+ invalid_table_id_test = (
+ False # Test to check if software properly handles invalid table ids
+ )
+ invalid_address_test = (
+ False # Test to check if software properly handles invalid addresses
+ )
+ invalid_parameter_size_test = False
+ request_hk_table = False
+
+
+def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
+ tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU2"))
+
+ if op_code == Pdu2OpCodes.ACS_SIDE_B_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn ACS Side B on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_7.parameter_address,
+ PDUConfigTable.out_en_7.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ return tc_queue
+ if op_code == Pdu2OpCodes.ACS_SIDE_B_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn ACS Side B off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_7.parameter_address,
+ PDUConfigTable.out_en_7.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ return tc_queue
+ if op_code == Pdu2OpCodes.Q7S_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "Turning off Q7S OBC"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_0.parameter_address,
+ PDUConfigTable.out_en_0.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.SUS_REDUNDANT_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_4.parameter_address,
+ PDUConfigTable.out_en_4.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.SUS_REDUNDANT_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_4.parameter_address,
+ PDUConfigTable.out_en_4.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.RW_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_2.parameter_address,
+ PDUConfigTable.out_en_2.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.RW_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_2.parameter_address,
+ PDUConfigTable.out_en_2.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.PL_PCDU_VBAT_NOM_ON.value:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 1 on")
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_1.parameter_address,
+ PDUConfigTable.out_en_1.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.PL_PCDU_VBAT_NOM_OFF.value:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 1 off")
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_1.parameter_address,
+ PDUConfigTable.out_en_1.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.PL_PCDU_VBAT_RED_ON.value:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 6 on")
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_6.parameter_address,
+ PDUConfigTable.out_en_6.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.PL_PCDU_VBAT_RED_OFF.value:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 6 off")
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_6.parameter_address,
+ PDUConfigTable.out_en_6.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.TCS_HEATER_IN_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn TCS Heater Input on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_3.parameter_address,
+ PDUConfigTable.out_en_3.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.TCS_HEATER_IN_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn TCS Heater Input off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_3.parameter_address,
+ PDUConfigTable.out_en_3.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.SOLAR_ARRAY_DEPL_ON.value:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Turn Solar Array Deployment On")
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_5.parameter_address,
+ PDUConfigTable.out_en_5.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.SOLAR_ARRAY_DEPL_OFF.value:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Turn Solar Array Deployment Off")
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_5.parameter_address,
+ PDUConfigTable.out_en_5.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.PL_CAMERA_ON.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn payload camera on"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_8.parameter_address,
+ PDUConfigTable.out_en_8.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == Pdu2OpCodes.PL_CAMERA_OFF.value:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn payload camera off"))
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_8.parameter_address,
+ PDUConfigTable.out_en_8.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in GomspaceOpCodes.REQUEST_HK_ONCE:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Requesting HK Table Once"))
+ hk_sid = make_sid(object_id=PDU_2_HANDLER_ID, set_id=SetIds.PDU_2)
+ command = generate_one_hk_command(sid=hk_sid, ssc=0)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in GomspaceOpCodes.PRINT_SWITCH_V_I:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Print Switches, Currents, Voltahes")
+ )
+ command = generate_action_command(
+ object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code in GomspaceOpCodes.PRINT_LATCHUPS:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Latchups"))
+ command = generate_action_command(
+ object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU2TestProcedure.all or PDU2TestProcedure.reboot:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reboot"))
+ command = pack_reboot_command(object_id)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU2TestProcedure.all or PDU2TestProcedure.read_gnd_wdt:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Reading ground watchdog timer value")
+ )
+ command = pack_get_param_command(
+ object_id,
+ TableIds.hk,
+ PDUHkTable.wdt_gnd_left.parameter_address,
+ PDUHkTable.wdt_gnd_left.parameter_size,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU2TestProcedure.all or PDU2TestProcedure.gnd_wdt_reset:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Testing ground watchdog reset")
+ )
+ command = pack_gnd_wdt_reset_command(object_id)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU2TestProcedure.all or PDU2TestProcedure.ping:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Ping Test"))
+ ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
+ command = pack_ping_command(object_id, ping_data)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU2TestProcedure.all or PDU2TestProcedure.channel_2_on:
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "PDU2: Testing setting output channel 2 on (TCS Heater)",
+ )
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_2.parameter_address,
+ PDUConfigTable.out_en_2.parameter_size,
+ Channel.on,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU2TestProcedure.all or PDU2TestProcedure.read_temperature:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing temperature reading"))
+ command = pack_get_param_command(
+ object_id,
+ TableIds.hk,
+ PDUHkTable.temperature.parameter_address,
+ PDUHkTable.temperature.parameter_size,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU2TestProcedure.all or PDU2TestProcedure.read_channel_2_state:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Reading output channel 2 state (TCS Heater)")
+ )
+ command = pack_get_param_command(
+ object_id,
+ TableIds.config,
+ PDUConfigTable.out_en_2.parameter_address,
+ PDUConfigTable.out_en_2.parameter_size,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU2TestProcedure.all or PDU2TestProcedure.read_cur_lu_lim_0:
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "PDU2: Reading current limit value of output channel 0 (OBC)",
+ )
+ )
+ command = pack_get_param_command(
+ object_id,
+ TableIds.config,
+ PDUConfigTable.cur_lu_lim_0.parameter_address,
+ PDUConfigTable.cur_lu_lim_0.parameter_size,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU2TestProcedure.all or PDU2TestProcedure.channel_2_off:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Testing setting output channel 2 off")
+ )
+ command = pack_set_param_command(
+ object_id,
+ PDUConfigTable.out_en_2.parameter_address,
+ PDUConfigTable.out_en_2.parameter_size,
+ Channel.off,
+ )
+ tc_queue.appendleft(command.pack_command_tuple())
+ if PDU2TestProcedure.all or PDU2TestProcedure.request_hk_table:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PDU2: Requesting housekeeping table")
+ )
+ command = pack_request_full_hk_table_command(object_id)
+ tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/devs/ploc_memory_dumper.py b/pus_tc/devs/ploc_memory_dumper.py
new file mode 100644
index 0000000..36edc8e
--- /dev/null
+++ b/pus_tc/devs/ploc_memory_dumper.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+"""
+@file ploc_memory_dumper.py
+@brief This file implements the command to dump memory sectors of the PLOC. Memories of the PLOC which can be dumped
+ are one MRAM, two flash memories and the SRAM.
+@author J. Meier
+@date 31.08.2021
+"""
+import struct
+
+from tmtccmd.config.definitions import QueueCommands
+
+from tmtccmd.tc.packer import TcQueueT
+from spacepackets.ecss.tc import PusTelecommand
+
+
+class ActionIds:
+ DUMP_MRAM = 1
+
+
+def pack_ploc_memory_dumper_cmd(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "Testing PLOC memory dumper with object id: 0x" + object_id.hex(),
+ )
+ )
+
+ if op_code == "0":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Dump MRAM"))
+ command = pack_mram_dump_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+
+def pack_mram_dump_cmd(object_id: bytearray) -> bytearray:
+ start = int(input("Start address: 0x"), 16)
+ end = int(input("End address: 0x"), 16)
+ command = bytearray()
+ command = object_id + struct.pack("!I", ActionIds.DUMP_MRAM)
+ command = command + struct.pack("!I", start)
+ command = command + struct.pack("!I", end)
+ return command
diff --git a/pus_tc/devs/ploc_mpsoc.py b/pus_tc/devs/ploc_mpsoc.py
new file mode 100644
index 0000000..4806e15
--- /dev/null
+++ b/pus_tc/devs/ploc_mpsoc.py
@@ -0,0 +1,284 @@
+# -*- coding: utf-8 -*-
+"""
+@file ploc_mpsoc.py
+@brief Tests for commanding the MPSoC of the PLOC.
+ The MPSoC is programmed by the ILH.
+@author J. Meier
+@date 06.03.2021
+"""
+import struct
+import enum
+
+from tmtccmd.config.definitions import QueueCommands
+from tmtccmd.logging import get_console_logger
+from tmtccmd.tc.packer import TcQueueT
+from spacepackets.ecss.tc import PusTelecommand
+from utility.input_helper import InputHelper
+from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
+
+LOGGER = get_console_logger()
+
+MANUAL_INPUT = "1"
+
+flash_write_file_dict = {
+ MANUAL_INPUT: ["manual input", ""],
+ "2": ["/mnt/sd0/ploc/mpsoc/flash_write.bin", "/mnt/sd0/ploc/mpsoc/flash_write.bin"],
+}
+
+mpsoc_file_dict = {
+ MANUAL_INPUT: ["manual input", ""],
+ "2": ["0:/flash", "0:/flash"],
+}
+
+sequence_file_dict = {
+ MANUAL_INPUT: ["manual input", ""],
+ "2": ["0:/EM16/231", "0:/EM16/231"],
+ "3": ["0:/EQ04/E-75", "0:/EQ04/E-75"],
+}
+
+
+class CommandIds(enum.IntEnum):
+ TC_MEM_WRITE = 1
+ TC_MEM_READ = 2
+ FLASH_WRITE = 9
+ TC_FLASH_DELETE = 10
+ TC_REPLAY_START = 11
+ TC_REPLAY_STOP = 12
+ TC_REPLAY_WRITE_SEQUENCE = 13
+ TC_DOWNLINK_PWR_ON = 14
+ TC_DOWNLINK_PWR_OFF = 15
+ OBSW_RESET_SEQ_COUNT = 50
+ TC_MODE_REPLAY = 16
+
+
+class MemAddresses(enum.IntEnum):
+ DEADBEEF = 0x40000004
+
+
+class PlocReplyIds:
+ tm_mem_read_report = 6
+
+
+def pack_ploc_mpsoc_commands(
+ object_id: bytearray, tc_queue: TcQueueT, op_code: str
+) -> TcQueueT:
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "Generate command for PLOC MPSoC with object id: 0x" + object_id.hex(),
+ )
+ )
+
+ if op_code == "0":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Set mode off"))
+ command = pack_mode_data(object_id, Modes.OFF, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=9, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "1":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Set mode on"))
+ command = pack_mode_data(object_id, Modes.ON, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=10, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "2":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Mode Normal"))
+ command = pack_mode_data(object_id, Modes.NORMAL, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=11, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "3":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: TC mem write test"))
+ memory_address = int(
+ input("PLOC MPSoC: Tc Mem Write: Type memory address: 0x"), 16
+ )
+ memory_data = int(input("PLOC MPSoC: Tc Mem Write: Type memory data: 0x"), 16)
+ # TODO: implement variable length mem write command
+ mem_len = 1 # 1 32-bit word
+ command = generate_write_mem_command(
+ object_id, memory_address, memory_data, mem_len
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "4":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: TC mem read test"))
+ command = prepare_mem_read_command(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "5":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Flash write"))
+ command = prepare_flash_write_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "6":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Flash delete"))
+ command = prepare_flash_delete_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "7":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Replay start"))
+ command = prepare_replay_start_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "8":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Replay stop"))
+ command = object_id + struct.pack("!I", CommandIds.TC_REPLAY_STOP)
+ command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "9":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Downlink pwr on"))
+ command = prepare_downlink_pwr_on_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "10":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Downlink pwr off"))
+ command = object_id + struct.pack("!I", CommandIds.TC_DOWNLINK_PWR_OFF)
+ command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "11":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Replay write sequence"))
+ command = prepare_replay_write_sequence_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "12":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC MPSoC: Reset OBSW sequence count")
+ )
+ command = object_id + struct.pack("!I", CommandIds.OBSW_RESET_SEQ_COUNT)
+ command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "13":
+ num_words = 1
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Read DEADBEEF address"))
+ command = (
+ object_id
+ + struct.pack("!I", CommandIds.TC_MEM_READ)
+ + struct.pack("!I", MemAddresses.DEADBEEF)
+ + struct.pack("!H", num_words)
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=29, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "14":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Tc mode replay"))
+ command = object_id + struct.pack("!I", CommandIds.TC_MODE_REPLAY)
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ return tc_queue
+
+
+def generate_write_mem_command(
+ object_id: bytearray, memory_address: int, memory_data: int, mem_len: int
+) -> bytearray:
+ """This function generates the command to write to a memory address within the PLOC
+ @param object_id The object id of the PlocHandler
+ @param memory_address The PLOC memory address where to write to.
+ @param memory_data The data to write to the memory address specified by the bytearray memory_address.
+ """
+ command = (
+ object_id
+ + struct.pack("!I", CommandIds.TC_MEM_WRITE)
+ + struct.pack("!I", memory_address)
+ + struct.pack("!H", mem_len)
+ + struct.pack("!I", memory_data)
+ )
+ return command
+
+
+def prepare_mem_read_command(object_id: bytearray) -> bytearray:
+ memory_address = int(input("PLOC MPSoC Tc Mem Read: Type memory address: 0x"), 16)
+ num_words = int(input("PLOC MPSoC specify number of words (32-bit) to read: "))
+ command = (
+ object_id
+ + struct.pack("!I", CommandIds.TC_MEM_READ)
+ + struct.pack("!I", memory_address)
+ + struct.pack("!H", num_words)
+ )
+ return command
+
+
+def prepare_flash_write_cmd(object_id: bytearray) -> bytearray:
+ obcFile = get_obc_file()
+ mpsocFile = get_mpsoc_file()
+ command = (
+ object_id
+ + struct.pack("!I", CommandIds.FLASH_WRITE)
+ + bytearray(obcFile, "utf-8")
+ + bytearray(mpsocFile, "utf-8")
+ )
+ return command
+
+
+def prepare_flash_delete_cmd(object_id: bytearray) -> bytearray:
+ file = get_mpsoc_file()
+ command = (
+ object_id
+ + struct.pack("!I", CommandIds.TC_FLASH_DELETE)
+ + bytearray(file, "utf-8")
+ )
+ return command
+
+
+def prepare_replay_start_cmd(object_id: bytearray) -> bytearray:
+ replay = int(input("Specify replay mode (0 - once, 1 - repeated): "))
+ command = (
+ object_id
+ + struct.pack("!I", CommandIds.TC_REPLAY_START)
+ + struct.pack("!B", replay)
+ )
+ return command
+
+
+def prepare_downlink_pwr_on_cmd(object_id: bytearray) -> bytearray:
+ mode = int(input("Specify JESD mode (0 - 5): "))
+ lane_rate = int(input("Specify lane rate (0 - 9): "))
+ command = (
+ object_id
+ + struct.pack("!I", CommandIds.TC_DOWNLINK_PWR_ON)
+ + struct.pack("!B", mode)
+ + struct.pack("!B", lane_rate)
+ )
+ return command
+
+
+def prepare_replay_write_sequence_cmd(object_id: bytearray) -> bytearray:
+ null_terminator = 0
+ use_decoding = int(input("Use decoding (set to 1): "))
+ file = get_sequence_file()
+ command = (
+ object_id
+ + struct.pack("!I", CommandIds.TC_REPLAY_WRITE_SEQUENCE)
+ + struct.pack("!B", use_decoding)
+ + bytearray(file, "utf-8")
+ )
+ return command
+
+
+def get_obc_file() -> str:
+ LOGGER.info("Specify OBC file ")
+ input_helper = InputHelper(flash_write_file_dict)
+ key = input_helper.get_key()
+ if key == MANUAL_INPUT:
+ file = input("Ploc MPSoC: Specify absolute name of flash file: ")
+ else:
+ file = flash_write_file_dict[key][1]
+ return file
+
+
+def get_mpsoc_file() -> str:
+ LOGGER.info("Specify MPSoC file")
+ input_helper = InputHelper(mpsoc_file_dict)
+ key = input_helper.get_key()
+ if key == MANUAL_INPUT:
+ file = input("Ploc MPSoC: Specify absolute name file: ")
+ else:
+ file = mpsoc_file_dict[key][1]
+ return file
+
+
+def get_sequence_file() -> str:
+ LOGGER.info("Specify sequence file")
+ input_helper = InputHelper(sequence_file_dict)
+ key = input_helper.get_key()
+ if key == MANUAL_INPUT:
+ file = input("Ploc MPSoC: Specify absolute name file: ")
+ else:
+ file = sequence_file_dict[key][1]
+ return file
diff --git a/pus_tc/ploc_supervisor.py b/pus_tc/devs/ploc_supervisor.py
similarity index 67%
rename from pus_tc/ploc_supervisor.py
rename to pus_tc/devs/ploc_supervisor.py
index eb8a9b0..25fb543 100644
--- a/pus_tc/ploc_supervisor.py
+++ b/pus_tc/devs/ploc_supervisor.py
@@ -8,23 +8,24 @@
"""
import struct
+from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.config.definitions import QueueCommands
-
from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
-from tmtccmd.utility.logger import get_console_logger
+from tmtccmd.logging import get_console_logger
+from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
LOGGER = get_console_logger()
latchup_id_dict = {
- "0": "0.85V",
- "1": "1.8V",
- "2": "MISC",
- "3": "3.3V",
- "4": "NVM_4XO",
- "5": "MISSION",
- "6": "SAFECOTS"
- }
+ "0": "0.85V",
+ "1": "1.8V",
+ "2": "MISC",
+ "3": "3.3V",
+ "4": "NVM_4XO",
+ "5": "MISSION",
+ "6": "SAFECOTS",
+}
+
class SupvActionIds:
HK_REPORT = 1
@@ -75,34 +76,54 @@ class SupvHkIds:
BOOT_STATUS_REPORT = 53
-def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
+def pack_ploc_supv_commands(
+ object_id: bytearray, tc_queue: TcQueueT, op_code: str
+) -> TcQueueT:
tc_queue.appendleft(
- (QueueCommands.PRINT,
- "Testing PLOC Supervisor with object id: 0x" + object_id.hex())
+ (
+ QueueCommands.PRINT,
+ "Testing PLOC Supervisor with object id: 0x" + object_id.hex(),
+ )
)
-
+ if op_code == "0":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set mode off"))
+ command = pack_mode_data(object_id, Modes.OFF, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=9, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "1":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set mode on"))
+ command = pack_mode_data(object_id, Modes.ON, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=10, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "2":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode Normal"))
+ command = pack_mode_data(object_id, Modes.NORMAL, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=11, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
if op_code == "3":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: TC Get Hk Report"))
- command = object_id + struct.pack('!I', SupvActionIds.HK_REPORT)
+ command = object_id + struct.pack("!I", SupvActionIds.HK_REPORT)
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "4":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Restart MPSoC"))
- command = object_id + struct.pack('!I', SupvActionIds.RESTART_MPSOC)
+ command = object_id + struct.pack("!I", SupvActionIds.RESTART_MPSOC)
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "5":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Start MPSoC"))
- command = object_id + struct.pack('!I', SupvActionIds.START_MPSOC)
+ command = object_id + struct.pack("!I", SupvActionIds.START_MPSOC)
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "6":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Shutdown MPSoC"))
- command = object_id + struct.pack('!I', SupvActionIds.SHUTWOWN_MPSOC)
+ command = object_id + struct.pack("!I", SupvActionIds.SHUTWOWN_MPSOC)
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "7":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Select MPSoC boot image"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Select MPSoC boot image")
+ )
mem = int(input("MEM (NVM0 - 0 or NVM1 - 1):"))
bp0 = int(input("BP0 (0 or 1):"))
bp1 = int(input("BP1 (0 or 1):"))
@@ -111,35 +132,49 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "8":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set max restart tries"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Set max restart tries")
+ )
restart_tries = int(input("Set maximum restart tries:"))
- command = object_id + struct.pack('!I', SupvActionIds.SET_MAX_RESTART_TRIES) + struct.pack('!B', restart_tries)
+ command = (
+ object_id
+ + struct.pack("!I", SupvActionIds.SET_MAX_RESTART_TRIES)
+ + struct.pack("!B", restart_tries)
+ )
command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "9":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Reset MPSoC"))
- command = object_id + struct.pack('!I', SupvActionIds.RESET_MPSOC)
+ command = object_id + struct.pack("!I", SupvActionIds.RESET_MPSOC)
command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "10":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set time reference"))
- command = object_id + struct.pack('!I', SupvActionIds.SET_TIME_REF)
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Set time reference")
+ )
+ command = object_id + struct.pack("!I", SupvActionIds.SET_TIME_REF)
command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "11":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set boot timeout"))
boot_timeout = int(input("Specify boot timeout [ms]:"))
- command = object_id + struct.pack('!I', SupvActionIds.SET_BOOT_TIMEOUT) + struct.pack('!I', boot_timeout)
+ command = (
+ object_id
+ + struct.pack("!I", SupvActionIds.SET_BOOT_TIMEOUT)
+ + struct.pack("!I", boot_timeout)
+ )
command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "12":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Disable HK"))
- command = object_id + struct.pack('!I', SupvActionIds.DISABLE_HK)
+ command = object_id + struct.pack("!I", SupvActionIds.DISABLE_HK)
command = PusTelecommand(service=8, subservice=128, ssc=29, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "13":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Request boot status report"))
- command = object_id + struct.pack('!I', SupvActionIds.GET_BOOT_STATUS_REPORT)
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Request boot status report")
+ )
+ command = object_id + struct.pack("!I", SupvActionIds.GET_BOOT_STATUS_REPORT)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "14":
@@ -153,22 +188,30 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "16":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Watchdog configure timeout"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Watchdog configure timeout")
+ )
command = pack_watchdog_config_timeout_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "17":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Enable latchup alert"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Enable latchup alert")
+ )
command = pack_lachtup_alert_cmd(object_id, True)
command = PusTelecommand(service=8, subservice=128, ssc=34, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "18":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Disable latchup alert"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Disable latchup alert")
+ )
command = pack_lachtup_alert_cmd(object_id, False)
command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "19":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Auto calibrate alert"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Auto calibrate alert")
+ )
command = pack_auto_calibrate_alert_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
@@ -178,22 +221,30 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = PusTelecommand(service=8, subservice=128, ssc=37, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "21":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set alert irq filter"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Set alert irq filter")
+ )
command = pack_set_alert_irq_filter_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=38, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "22":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set ADC sweep period"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Set ADC sweep period")
+ )
command = pack_set_adc_sweep_period_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=39, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "23":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set ADC enabled channels"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Set ADC enabled channels")
+ )
command = pack_set_adc_enabled_channels_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "24":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set ADC window and stride"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Set ADC window and stride")
+ )
command = pack_set_adc_window_and_stride_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=41, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
@@ -203,17 +254,23 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = PusTelecommand(service=8, subservice=128, ssc=42, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "26":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Request latchup status report"))
- command = object_id + struct.pack('!I', SupvActionIds.GET_LATCHUP_STATUS_REPORT)
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Request latchup status report")
+ )
+ command = object_id + struct.pack("!I", SupvActionIds.GET_LATCHUP_STATUS_REPORT)
command = PusTelecommand(service=8, subservice=128, ssc=43, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "27":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Copy ADC data to MRAM"))
- command = object_id + struct.pack('!I', SupvActionIds.COPY_ADC_DATA_TO_MRAM)
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Copy ADC data to MRAM")
+ )
+ command = object_id + struct.pack("!I", SupvActionIds.COPY_ADC_DATA_TO_MRAM)
command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "28":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Enalbe/Disable NVMs"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Enalbe/Disable NVMs")
+ )
command = pack_enable_nvms_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
@@ -232,18 +289,15 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = pack_mram_wipe_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=46, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- elif op_code == "32":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Dump MRAM"))
- command = pack_mram_dump_cmd(object_id)
- command = PusTelecommand(service=8, subservice=128, ssc=47, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "33":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Print CPU stats"))
command = pack_print_cpu_stats_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=48, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "34":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set debug verbosity"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Set debug verbosity")
+ )
command = pack_set_debug_verbosity_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=49, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
@@ -258,36 +312,59 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = PusTelecommand(service=8, subservice=128, ssc=51, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "37":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Restart supervisor"))
- command = command = object_id + struct.pack('!I', SupvActionIds.RESTART_SUPERVISOR)
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Restart supervisor")
+ )
+ command = command = object_id + struct.pack(
+ "!I", SupvActionIds.RESTART_SUPERVISOR
+ )
command = PusTelecommand(service=8, subservice=128, ssc=52, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "38":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear all"))
- command = command = object_id + struct.pack('!I', SupvActionIds.FACTORY_RESET_CLEAR_ALL)
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear all")
+ )
+ command = command = object_id + struct.pack(
+ "!I", SupvActionIds.FACTORY_RESET_CLEAR_ALL
+ )
command = PusTelecommand(service=8, subservice=128, ssc=53, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "39":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear mirror entries"))
- command = command = object_id + struct.pack('!I', SupvActionIds.FACTORY_RESET_CLEAR_MIRROR)
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear mirror entries")
+ )
+ command = command = object_id + struct.pack(
+ "!I", SupvActionIds.FACTORY_RESET_CLEAR_MIRROR
+ )
command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "40":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear circular entries"))
- command = command = object_id + struct.pack('!I', SupvActionIds.FACTORY_RESET_CLEAR_CIRCULAR)
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "PLOC Supervisor: Factory reset clear circular entries",
+ )
+ )
+ command = command = object_id + struct.pack(
+ "!I", SupvActionIds.FACTORY_RESET_CLEAR_CIRCULAR
+ )
command = PusTelecommand(service=8, subservice=128, ssc=55, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "41":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: CAN loopback test"))
- command = command = object_id + struct.pack('!I', SupvActionIds.CAN_LOOPBACK_TEST)
+ command = command = object_id + struct.pack(
+ "!I", SupvActionIds.CAN_LOOPBACK_TEST
+ )
command = PusTelecommand(service=8, subservice=128, ssc=56, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
-def pack_sel_boot_image_cmd(object_id: bytearray, mem: int, bp0: int, bp1: int, bp2: int) -> bytearray:
- """ This function can be used to generate the command to select the image from which the MPSoC will boot
+def pack_sel_boot_image_cmd(
+ object_id: bytearray, mem: int, bp0: int, bp1: int, bp2: int
+) -> bytearray:
+ """This function can be used to generate the command to select the image from which the MPSoC will boot
@param object_id The object id of the PLOC supervisor handler.
@param mem The memory from which the MPSoC shall boot (NVM0 - 0, NVM1 - 1)
@param bp0 Partition pin 0
@@ -295,11 +372,11 @@ def pack_sel_boot_image_cmd(object_id: bytearray, mem: int, bp0: int, bp1: int,
@param bp2 Partition pin 2
"""
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.SEL_MPSOC_BOOT_IMAGE)
- command = command + struct.pack('!B', mem)
- command = command + struct.pack('!B', bp0)
- command = command + struct.pack('!B', bp1)
- command = command + struct.pack('!B', bp2)
+ command = object_id + struct.pack("!I", SupvActionIds.SEL_MPSOC_BOOT_IMAGE)
+ command = command + struct.pack("!B", mem)
+ command = command + struct.pack("!B", bp0)
+ command = command + struct.pack("!B", bp1)
+ command = command + struct.pack("!B", bp2)
return command
@@ -314,12 +391,12 @@ def pack_update_available_cmd(object_id: bytearray) -> bytearray:
image_crc = 0x0
number_of_packets = 150
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.UPDATE_AVAILABLE)
- command = command + struct.pack('!B', image_select)
- command = command + struct.pack('!B', image_partition)
- command = command + struct.pack('!I', image_size)
- command = command + struct.pack('!I', image_crc)
- command = command + struct.pack('!I', number_of_packets)
+ command = object_id + struct.pack("!I", SupvActionIds.UPDATE_AVAILABLE)
+ command = command + struct.pack("!B", image_select)
+ command = command + struct.pack("!B", image_partition)
+ command = command + struct.pack("!I", image_size)
+ command = command + struct.pack("!I", image_crc)
+ command = command + struct.pack("!I", number_of_packets)
return command
@@ -333,10 +410,10 @@ def pack_watchdogs_enable_cmd(object_id: bytearray) -> bytearray:
watchdog_pl = 1
watchdog_int = 0
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.WATCHDOGS_ENABLE)
- command = command + struct.pack('!B', watchdog_ps)
- command = command + struct.pack('!B', watchdog_pl)
- command = command + struct.pack('!B', watchdog_int)
+ command = object_id + struct.pack("!I", SupvActionIds.WATCHDOGS_ENABLE)
+ command = command + struct.pack("!B", watchdog_ps)
+ command = command + struct.pack("!B", watchdog_pl)
+ command = command + struct.pack("!B", watchdog_int)
return command
@@ -348,9 +425,9 @@ def pack_watchdog_config_timeout_cmd(object_id: bytearray) -> bytearray:
watchdog = int(input("Specify watchdog (0 - PS, 1 - PL, 2 - INT):"))
timeout = int(input("Specify timeout (1000 ms - 360000 ms):"))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.WATCHDOGS_CONFIG_TIMEOUT)
- command = command + struct.pack('!B', watchdog)
- command = command + struct.pack('!I', timeout)
+ command = object_id + struct.pack("!I", SupvActionIds.WATCHDOGS_CONFIG_TIMEOUT)
+ command = command + struct.pack("!B", watchdog)
+ command = command + struct.pack("!I", timeout)
return command
@@ -363,10 +440,10 @@ def pack_lachtup_alert_cmd(object_id: bytearray, state: bool) -> bytearray:
latchup_id = get_latchup_id()
command = bytearray()
if state:
- command = object_id + struct.pack('!I', SupvActionIds.ENABLE_LATCHUP_ALERT)
+ command = object_id + struct.pack("!I", SupvActionIds.ENABLE_LATCHUP_ALERT)
else:
- command = object_id + struct.pack('!I', SupvActionIds.DISABLE_LATCHUP_ALERT)
- command = command + struct.pack('!B', latchup_id)
+ command = object_id + struct.pack("!I", SupvActionIds.DISABLE_LATCHUP_ALERT)
+ command = command + struct.pack("!B", latchup_id)
return command
@@ -378,9 +455,9 @@ def pack_auto_calibrate_alert_cmd(object_id: bytearray) -> bytearray:
latchup_id = get_latchup_id()
mg = int(input("Specify MG:"))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.AUTO_CALIBRATE_ALERT)
- command = command + struct.pack('!B', latchup_id)
- command = command + struct.pack('!I', mg)
+ command = object_id + struct.pack("!I", SupvActionIds.AUTO_CALIBRATE_ALERT)
+ command = command + struct.pack("!B", latchup_id)
+ command = command + struct.pack("!I", mg)
return command
@@ -408,9 +485,9 @@ def pack_set_alert_limit_cmd(object_id: bytearray) -> bytearray:
latchup_id = get_latchup_id()
dutycycle = int(input("Specify dutycycle:"))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.AUTO_CALIBRATE_ALERT)
- command = command + struct.pack('!B', latchup_id)
- command = command + struct.pack('!I', dutycycle)
+ command = object_id + struct.pack("!I", SupvActionIds.SET_ALERT_LIMIT)
+ command = command + struct.pack("!B", latchup_id)
+ command = command + struct.pack("!I", dutycycle)
return command
@@ -420,13 +497,13 @@ def pack_set_alert_irq_filter_cmd(object_id: bytearray) -> bytearray:
@param object_id The object id of the PLOC supervisor handler.
"""
latchup_id = get_latchup_id()
- tp = int(input("Specify TP:"))
- div = int(input("Specify DIV:"))
+ tp = int(input("Specify filter type (TP):"))
+ div = int(input("Specify clock divider (DIV):"))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.SET_ALERT_IRQ_FILTER)
- command = command + struct.pack('!B', latchup_id)
- command = command + struct.pack('!B', tp)
- command = command + struct.pack('!B', div)
+ command = object_id + struct.pack("!I", SupvActionIds.SET_ALERT_IRQ_FILTER)
+ command = command + struct.pack("!B", latchup_id)
+ command = command + struct.pack("!B", tp)
+ command = command + struct.pack("!B", div)
return command
@@ -437,8 +514,8 @@ def pack_set_adc_sweep_period_cmd(object_id: bytearray) -> bytearray:
"""
sweep_period = int(input("Specify sweep period (min 21 us):"))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.SET_ADC_SWEEP_PERIOD)
- command = command + struct.pack('!I', sweep_period)
+ command = object_id + struct.pack("!I", SupvActionIds.SET_ADC_SWEEP_PERIOD)
+ command = command + struct.pack("!I", sweep_period)
return command
@@ -449,8 +526,8 @@ def pack_set_adc_enabled_channels_cmd(object_id: bytearray) -> bytearray:
"""
ch = int(input("Specify ch:"))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.SET_ADC_ENABLED_CHANNELS)
- command = command + struct.pack('!H', ch)
+ command = object_id + struct.pack("!I", SupvActionIds.SET_ADC_ENABLED_CHANNELS)
+ command = command + struct.pack("!H", ch)
return command
@@ -458,17 +535,17 @@ def pack_set_adc_window_and_stride_cmd(object_id: bytearray) -> bytearray:
window_size = int(input("Specify window size:"))
striding_step_size = int(input("Specify striding step size:"))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.SET_ADC_WINDOW_AND_STRIDE)
- command = command + struct.pack('!H', window_size)
- command = command + struct.pack('!H', striding_step_size)
+ command = object_id + struct.pack("!I", SupvActionIds.SET_ADC_WINDOW_AND_STRIDE)
+ command = command + struct.pack("!H", window_size)
+ command = command + struct.pack("!H", striding_step_size)
return command
def pack_set_adc_threshold_cmd(object_id: bytearray) -> bytearray:
threshold = int(input("Specify threshold:"))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.SET_ADC_THRESHOLD)
- command = command + struct.pack('!I', threshold)
+ command = object_id + struct.pack("!I", SupvActionIds.SET_ADC_THRESHOLD)
+ command = command + struct.pack("!I", threshold)
return command
@@ -476,25 +553,25 @@ def pack_enable_nvms_cmd(object_id: bytearray) -> bytearray:
n01 = int(input("NVM0/1 (0 - off, 1 - on):"))
n3 = int(input("NVM3 (0 - off, 1 - on):"))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.ENABLE_NVMS)
- command = command + struct.pack('!B', n01)
- command = command + struct.pack('!B', n3)
+ command = object_id + struct.pack("!I", SupvActionIds.ENABLE_NVMS)
+ command = command + struct.pack("!B", n01)
+ command = command + struct.pack("!B", n3)
return command
def pack_select_nvm_cmd(object_id: bytearray) -> bytearray:
mem = int(input("Specify NVM (0 - NVM0, 1 - MVM1):"))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.SELECT_NVM)
- command = command + struct.pack('!B', mem)
+ command = object_id + struct.pack("!I", SupvActionIds.SELECT_NVM)
+ command = command + struct.pack("!B", mem)
return command
def pack_auto_em_tests_cmd(object_id: bytearray) -> bytearray:
test = int(input("Specify test (1 - complete, 2 - short):"))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.RUN_AUTO_EM_TESTS)
- command = command + struct.pack('!B', test)
+ command = object_id + struct.pack("!I", SupvActionIds.RUN_AUTO_EM_TESTS)
+ command = command + struct.pack("!B", test)
return command
@@ -502,35 +579,25 @@ def pack_mram_wipe_cmd(object_id: bytearray) -> bytearray:
start = int(input("Start address: 0x"), 16)
stop = int(input("Stop address: 0x"), 16)
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.WIPE_MRAM)
- command = command + struct.pack('!I', start)
- command = command + struct.pack('!I', stop)
- return command
-
-
-def pack_mram_dump_cmd(object_id: bytearray) -> bytearray:
- start = int(input("Start address: 0x"), 16)
- stop = int(input("Stop address: 0x"), 16)
- command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.DUMP_MRAM)
- command = command + struct.pack('!I', start)
- command = command + struct.pack('!I', stop)
+ command = object_id + struct.pack("!I", SupvActionIds.WIPE_MRAM)
+ command = command + struct.pack("!I", start)
+ command = command + struct.pack("!I", stop)
return command
def pack_print_cpu_stats_cmd(object_id: bytearray) -> bytearray:
en = 1
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.PRINT_CPU_STATS)
- command = command + struct.pack('!B', en)
+ command = object_id + struct.pack("!I", SupvActionIds.PRINT_CPU_STATS)
+ command = command + struct.pack("!B", en)
return command
def pack_set_debug_verbosity_cmd(object_id: bytearray) -> bytearray:
command = bytearray()
verbosity = get_debug_verbosity()
- command = object_id + struct.pack('!I', SupvActionIds.SET_DBG_VERBOSITY)
- command = command + struct.pack('!B', verbosity)
+ command = object_id + struct.pack("!I", SupvActionIds.SET_DBG_VERBOSITY)
+ command = command + struct.pack("!B", verbosity)
return command
@@ -545,7 +612,7 @@ def get_debug_verbosity() -> int:
2: "Warn",
3: "Info",
}
- print("{:<6} | {}".format('Key', 'Description'))
+ print("{:<6} | {}".format("Key", "Description"))
for entry in verbosity_options_dict.items():
print("{:<6} | {}".format(entry[0], entry[1]))
verbosity = int(input("Specify verbosity key: "))
@@ -564,10 +631,10 @@ def pack_set_gpio_cmd(object_id: bytearray) -> bytearray:
pin = int(input("Specify pin: "))
val = int(input("Specify val: "))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.SET_GPIO)
- command = command + struct.pack('!B', port)
- command = command + struct.pack('!B', pin)
- command = command + struct.pack('!B', val)
+ command = object_id + struct.pack("!I", SupvActionIds.SET_GPIO)
+ command = command + struct.pack("!B", port)
+ command = command + struct.pack("!B", pin)
+ command = command + struct.pack("!B", val)
return command
@@ -575,9 +642,7 @@ def pack_read_gpio_cmd(object_id: bytearray) -> bytearray:
port = int(input("Specify port: "))
pin = int(input("Specify pin: "))
command = bytearray()
- command = object_id + struct.pack('!I', SupvActionIds.READ_GPIO)
- command = command + struct.pack('!B', port)
- command = command + struct.pack('!B', pin)
+ command = object_id + struct.pack("!I", SupvActionIds.READ_GPIO)
+ command = command + struct.pack("!B", port)
+ command = command + struct.pack("!B", pin)
return command
-
-
diff --git a/pus_tc/devs/ploc_upater.py b/pus_tc/devs/ploc_upater.py
new file mode 100644
index 0000000..6b49275
--- /dev/null
+++ b/pus_tc/devs/ploc_upater.py
@@ -0,0 +1,148 @@
+# -*- coding: utf-8 -*-
+"""
+@file ploc_udpater.py
+@brief Commands to initiate update transfer to ploc supervisor. This only updates the software of the MPSoC, it is not
+ possible to update the software of the supervisor.
+ The supervisor is programmed by Thales.
+@author J. Meier
+@date 10.07.2021
+"""
+import struct
+
+from tmtccmd.config.definitions import QueueCommands
+
+from tmtccmd.tc.packer import TcQueueT
+from spacepackets.ecss.tc import PusTelecommand
+
+
+latchup_id_dict = {
+ "0": "0.85V",
+ "1": "1.8V",
+ "2": "MISC",
+ "3": "3.3V",
+ "4": "NVM_4XO",
+ "5": "MISSION",
+ "6": "SAFECOTS",
+}
+
+
+class UpdaterActionIds:
+ UPDATE_A_UBOOT = 0
+ UPDATE_A_BITSTREAM = 1
+ UPDATE_A_LINUX = 2
+ UPDATE_A_APP_SW = 3
+ UPDATE_B_UBOOT = 4
+ UPDATE_B_BITSTREAM = 5
+ UPDATE_B_LINUX = 6
+ UPDATE_B_LINUX = 7
+
+
+class ImagePathDefs:
+ imageAuboot = "/mnt/sd0/ploc/updateAuboot.bin"
+ imageAbitsream = "/mnt/sd0/ploc/updateAbitstream.bin"
+ imageAlinux = "/mnt/sd0/ploc/updateAlinux.bin"
+ imageAappsw = "/mnt/sd0/ploc/updateAappsw.bin"
+ imageBuboot = "/mnt/sd0/ploc/updateBuboot.bin"
+ imageBbitsream = "/mnt/sd0/ploc/updateBbitstream.bin"
+ imageBlinux = "/mnt/sd0/ploc/updateBlinux.bin"
+ imageBappsw = "/mnt/sd0/ploc/updateBappsw.bin"
+
+
+def pack_ploc_updater_test_into(
+ object_id: bytearray, tc_queue: TcQueueT, op_code: str
+) -> TcQueueT:
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "Testing PLOC updater with object id: 0x" + object_id.hex(),
+ )
+ )
+
+ if op_code == "0":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Update uboot on partition A")
+ )
+ command = (
+ object_id
+ + struct.pack("!I", UpdaterActionIds.UPDATE_A_UBOOT)
+ + bytearray(ImagePathDefs.imageAuboot, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "1":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Update bitstream on parition A")
+ )
+ command = (
+ object_id
+ + struct.pack("!I", UpdaterActionIds.UPDATE_A_BITSTREAM)
+ + bytearray(ImagePathDefs.imageAbitsream, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "2":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Update linux on partition A")
+ )
+ command = (
+ object_id
+ + struct.pack("!I", UpdaterActionIds.UPDATE_A_LINUX)
+ + bytearray(ImagePathDefs.imageAlinux, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "3":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Update application on partition A")
+ )
+ command = (
+ object_id
+ + struct.pack("!I", UpdaterActionIds.UPDATE_A_APP_SW)
+ + bytearray(ImagePathDefs.imageAappsw, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "4":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Update uboot on partition B")
+ )
+ command = (
+ object_id
+ + struct.pack("!I", UpdaterActionIds.UPDATE_B_UBOOT)
+ + bytearray(ImagePathDefs.imageBuboot, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "5":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Update bitstream on parition B")
+ )
+ command = (
+ object_id
+ + struct.pack("!I", UpdaterActionIds.UPDATE_B_BITSTREAM)
+ + bytearray(ImagePathDefs.imageBbitsream, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "6":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Update linux on partition B")
+ )
+ command = (
+ object_id
+ + struct.pack("!I", UpdaterActionIds.UPDATE_B_LINUX)
+ + bytearray(ImagePathDefs.imageBlinux, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "7":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "PLOC Supervisor: Update application on partition B")
+ )
+ command = (
+ object_id
+ + struct.pack("!I", UpdaterActionIds.UPDATE_B_APP_SW)
+ + bytearray(ImagePathDefs.imageBappsw, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/devs/plpcdu.py b/pus_tc/devs/plpcdu.py
new file mode 100644
index 0000000..7fddabc
--- /dev/null
+++ b/pus_tc/devs/plpcdu.py
@@ -0,0 +1,239 @@
+import enum
+from typing import Optional
+
+from tmtccmd.config import QueueCommands
+from tmtccmd.tc.definitions import TcQueueT
+from tmtccmd.tc.service_200_mode import pack_mode_data, Modes, Subservices
+from tmtccmd.tc.service_20_parameter import (
+ pack_scalar_double_param_app_data,
+ pack_fsfw_load_param_cmd,
+ pack_boolean_parameter_app_data,
+)
+from tmtccmd.logging import get_console_logger
+from spacepackets.ecss.tc import PusTelecommand
+from config.object_ids import PL_PCDU_ID
+
+LOGGER = get_console_logger()
+
+
+class OpCodes:
+ SWITCH_ON = ["0", "on"]
+ SWITCH_OFF = ["1", "off"]
+ NORMAL_SSR = ["2", "nml-ssr"]
+ NORMAL_DRO = ["3", "nml-dro"]
+ NORMAL_X8 = ["4", "nml-x8"]
+ NORMAL_TX = ["5", "nml-tx"]
+ NORMAL_MPA = ["6", "nml-mpa"]
+ NORMAL_HPA = ["7", "nml-hpa"]
+
+ INJECT_SSR_TO_DRO_FAILURE = ["10", "inject-ssr-dro-fault"]
+ INJECT_DRO_TO_X8_FAILURE = ["11", "inject-dro-x8-fault"]
+ INJECT_X8_TO_TX_FAILURE = ["12", "inject-x8-tx-fault"]
+ INJECT_TX_TO_MPA_FAILURE = ["13", "inject-tx-mpa-fault"]
+ INJECT_MPA_TO_HPA_FAILURE = ["14", "inject-mpa-hpa-fault"]
+ INJECT_ALL_ON_FAILURE = ["15", "inject-all-on-fault"]
+
+ # The following commands might become deprecated in the future
+ UPDATE_DRO_TO_X8_WAIT = ["128", "dro-to-x8-wait"]
+ UPDATE_X8_TO_TX_WAIT_TIME = ["129", "x8-to-tx-wait"]
+ UPDATE_TX_TO_MPA_WAIT_TIME = ["130", "tx-to-mpa-wait"]
+ UPDATE_MPA_TO_HPA_WAIT_TIME = ["131", "mpa-to-hpa-wait"]
+
+
+class Info:
+ NORMAL = "PL PCDU ADC modules normal"
+ SWITCH_ON = "Switching PL PCDU on"
+ SWITCH_OFF = "Switching PL PCDU off"
+ NORMAL_SSR = f"{NORMAL}, SSR on"
+ NORMAL_DRO = f"{NORMAL},DRO on"
+ NORMAL_X8 = f"{NORMAL}, X8 on"
+ NORMAL_TX = f"{NORMAL}, TX on"
+ NORMAL_MPA = f"{NORMAL}, MPA on"
+ NORMAL_HPA = f"{NORMAL}, HPA on"
+
+
+class NormalSubmodesMask(enum.IntEnum):
+ SOLID_STATE_RELAYS_ADC_ON = 0
+ DRO_ON = 1
+ X8_ON = 2
+ TX_ON = 3
+ MPA_ON = 4
+ HPA_ON = 5
+
+
+class ParamIds(enum.IntEnum):
+ NEG_V_LOWER_BOUND = 0
+ NEG_V_UPPER_BOUND = 1
+
+ DRO_U_LOWER_BOUND = 2
+ DRO_U_UPPER_BOUND = 3
+ DRO_I_UPPER_BOUND = 4
+
+ X8_U_LOWER_BOUND = 5
+ X8_U_UPPER_BOUND = 6
+ X8_I_UPPER_BOUND = 7
+
+ TX_U_LOWER_BOUND = 8
+ TX_U_UPPER_BOUND = 9
+ TX_I_UPPER_BOUND = 10
+
+ MPA_U_LOWER_BOUND = 11
+ MPA_U_UPPER_BOUND = 12
+ MPA_I_UPPER_BOUND = 13
+
+ HPA_U_LOWER_BOUND = 14
+ HPA_U_UPPER_BOUND = 15
+ HPA_I_UPPER_BOUND = 16
+
+ SSR_TO_DRO_WAIT_TIME = 17
+ DRO_TO_X8_WAIT_TIME = 18
+ X8_TO_TX_WAIT_TIME = 19
+ TX_TO_MPA_WAIT_TIME = 20
+ MPA_TO_HPA_WAIT_TIME = 21
+
+ INJECT_SSR_TO_DRO_FAILURE = 30
+ INJECT_DRO_TO_X8_FAILURE = 31
+ INJECT_X8_TO_TX_FAILURE = 32
+ INJECT_TX_TO_MPA_FAILURE = 33
+ INJECT_MPA_TO_HPA_FAILURE = 34
+ INJECT_ALL_ON_FAILURE = 35
+
+
+def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
+ if op_code in OpCodes.SWITCH_ON:
+ pack_pl_pcdu_mode_cmd(
+ tc_queue=tc_queue, info=Info.SWITCH_ON, mode=Modes.ON, submode=0
+ )
+ if op_code in OpCodes.SWITCH_OFF:
+ pack_pl_pcdu_mode_cmd(
+ tc_queue=tc_queue, info=Info.SWITCH_OFF, mode=Modes.OFF, submode=0
+ )
+ if op_code in OpCodes.NORMAL_SSR:
+ pack_pl_pcdu_mode_cmd(
+ tc_queue=tc_queue,
+ info=Info.NORMAL_SSR,
+ mode=Modes.NORMAL,
+ submode=(1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON),
+ )
+ if op_code in OpCodes.NORMAL_DRO:
+ pack_pl_pcdu_mode_cmd(
+ tc_queue=tc_queue,
+ info=Info.NORMAL_DRO,
+ mode=Modes.NORMAL,
+ submode=(
+ 1 << NormalSubmodesMask.DRO_ON
+ | (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
+ ),
+ )
+ if op_code in OpCodes.NORMAL_X8:
+ pack_pl_pcdu_mode_cmd(
+ tc_queue=tc_queue,
+ info=Info.NORMAL_X8,
+ mode=Modes.NORMAL,
+ submode=(
+ 1 << NormalSubmodesMask.DRO_ON
+ | (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
+ | (1 << NormalSubmodesMask.X8_ON)
+ ),
+ )
+ if op_code in OpCodes.NORMAL_TX:
+ pack_pl_pcdu_mode_cmd(
+ tc_queue=tc_queue,
+ info=Info.NORMAL_TX,
+ mode=Modes.NORMAL,
+ submode=(
+ 1 << NormalSubmodesMask.DRO_ON
+ | (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
+ | (1 << NormalSubmodesMask.X8_ON)
+ | (1 << NormalSubmodesMask.TX_ON)
+ ),
+ )
+ if op_code in OpCodes.NORMAL_MPA:
+ pack_pl_pcdu_mode_cmd(
+ tc_queue=tc_queue,
+ info=Info.NORMAL_MPA,
+ mode=Modes.NORMAL,
+ submode=(
+ 1 << NormalSubmodesMask.DRO_ON
+ | (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
+ | (1 << NormalSubmodesMask.X8_ON)
+ | (1 << NormalSubmodesMask.TX_ON)
+ | (1 << NormalSubmodesMask.MPA_ON)
+ ),
+ )
+ if op_code in OpCodes.NORMAL_HPA:
+ pack_pl_pcdu_mode_cmd(
+ tc_queue=tc_queue,
+ info=Info.NORMAL_HPA,
+ mode=Modes.NORMAL,
+ submode=(
+ 1 << NormalSubmodesMask.DRO_ON
+ | (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
+ | (1 << NormalSubmodesMask.X8_ON)
+ | (1 << NormalSubmodesMask.TX_ON)
+ | (1 << NormalSubmodesMask.MPA_ON)
+ | (1 << NormalSubmodesMask.HPA_ON)
+ ),
+ )
+ if op_code in OpCodes.INJECT_ALL_ON_FAILURE:
+ pack_failure_injection_cmd(
+ tc_queue=tc_queue,
+ param_id=ParamIds.INJECT_ALL_ON_FAILURE,
+ print_str="All On",
+ )
+
+
+def request_wait_time() -> Optional[float]:
+ while True:
+ wait_time = input("Please enter DRO to X8 wait time in seconds, x to cancel: ")
+ if wait_time.lower() == "x":
+ return None
+ try:
+ wait_time = float(wait_time)
+ except ValueError:
+ LOGGER.warning("Invalid input")
+ continue
+ if wait_time <= 0:
+ LOGGER.warning("Invalid input")
+ else:
+ return wait_time
+
+
+def pack_wait_time_cmd(tc_queue: TcQueueT, param_id: int, print_str: str):
+ wait_time = request_wait_time()
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, f"Updating {print_str} wait time to {wait_time}")
+ )
+ if wait_time is None:
+ return
+ param_data = pack_scalar_double_param_app_data(
+ object_id=PL_PCDU_ID,
+ domain_id=0,
+ unique_id=param_id,
+ parameter=wait_time,
+ )
+ cmd = pack_fsfw_load_param_cmd(ssc=0, app_data=param_data)
+ tc_queue.appendleft(cmd.pack_command_tuple())
+
+
+def pack_failure_injection_cmd(tc_queue: TcQueueT, param_id: int, print_str: str):
+ tc_queue.appendleft((QueueCommands.PRINT, f"Inserting {print_str} error"))
+ param_data = pack_boolean_parameter_app_data(
+ object_id=PL_PCDU_ID, domain_id=0, unique_id=param_id, parameter=True
+ )
+ cmd = pack_fsfw_load_param_cmd(ssc=0, app_data=param_data)
+ tc_queue.appendleft(cmd.pack_command_tuple())
+
+
+def pack_pl_pcdu_mode_cmd(tc_queue: TcQueueT, info: str, mode: int, submode: int):
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ info,
+ )
+ )
+ mode_data = pack_mode_data(object_id=PL_PCDU_ID, mode=mode, submode=submode)
+ mode_cmd = PusTelecommand(
+ service=200, subservice=Subservices.COMMAND_MODE_COMMAND, app_data=mode_data
+ )
+ tc_queue.appendleft(mode_cmd.pack_command_tuple())
diff --git a/pus_tc/devs/rad_sensor.py b/pus_tc/devs/rad_sensor.py
new file mode 100644
index 0000000..cd66930
--- /dev/null
+++ b/pus_tc/devs/rad_sensor.py
@@ -0,0 +1,72 @@
+# -*- coding: utf-8 -*-
+"""
+@file rad_sensor.py
+@brief Tests for the radiation sensor handler
+@author J. Meier
+@date 01.07.2021
+"""
+import struct
+
+from tmtccmd.config.definitions import QueueCommands
+
+from tmtccmd.tc.packer import TcQueueT
+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(
+ (
+ QueueCommands.PRINT,
+ "Testing radiation sensor handler with object id: 0x" + object_id.hex(),
+ )
+ )
+
+ if op_code == "0":
+ tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode on"))
+ mode_data = pack_mode_data(object_id, 1, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=41, app_data=mode_data)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "1":
+ tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode normal"))
+ mode_data = pack_mode_data(object_id, 2, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+ if op_code == "2":
+ tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode off"))
+ 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())
diff --git a/pus_tc/reaction_wheels.py b/pus_tc/devs/reaction_wheels.py
similarity index 78%
rename from pus_tc/reaction_wheels.py
rename to pus_tc/devs/reaction_wheels.py
index 0c48491..e23dab0 100644
--- a/pus_tc/reaction_wheels.py
+++ b/pus_tc/devs/reaction_wheels.py
@@ -9,7 +9,7 @@ import struct
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
+from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data
@@ -38,10 +38,14 @@ class RampTime:
MS_1000 = 1000
-def pack_single_rw_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
+def pack_single_rw_test_into(
+ object_id: bytearray, tc_queue: TcQueueT, op_code: str
+) -> TcQueueT:
tc_queue.appendleft(
- (QueueCommands.PRINT,
- "Testing reaction wheel handler with object id: 0x" + object_id.hex())
+ (
+ QueueCommands.PRINT,
+ "Testing reaction wheel handler with object id: 0x" + object_id.hex(),
+ )
)
if op_code == "0" or op_code == "1":
@@ -59,7 +63,9 @@ def pack_single_rw_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "3":
- tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Switch to mode normal"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Reaction Wheel: Switch to mode normal")
+ )
mode_data = pack_mode_data(object_id, 2, 0)
command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
@@ -71,15 +77,19 @@ def pack_single_rw_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "5":
- tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Send get-telemetry-command"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Reaction Wheel: Send get-telemetry-command")
+ )
command = object_id + RwCommandIds.GET_TM
command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
-def pack_set_speed_command(object_id: bytearray, speed: int, ramp_time: int) -> bytearray:
- """ With this function a command is packed to set the speed of a reaction wheel
+def pack_set_speed_command(
+ object_id: bytearray, speed: int, ramp_time: int
+) -> bytearray:
+ """With this function a command is packed to set the speed of a reaction wheel
@param object_id The object id of the reaction wheel handler.
@param speed Valid speeds are [-65000, -1000] and [1000, 65000]. Values are specified in 0.1 * RPM
@param ramp_time The time after which the reaction wheel will reached the commanded speed. Valid times are
@@ -88,6 +98,6 @@ def pack_set_speed_command(object_id: bytearray, speed: int, ramp_time: int) ->
command_id = RwCommandIds.SET_SPEED
command = bytearray()
command = object_id + command_id
- command = command + struct.pack('!i', speed)
- command = command + ramp_time.to_bytes(length=2, byteorder='big')
+ command = command + struct.pack("!i", speed)
+ command = command + ramp_time.to_bytes(length=2, byteorder="big")
return command
diff --git a/pus_tc/solar_array_deployment.py b/pus_tc/devs/solar_array_deployment.py
similarity index 100%
rename from pus_tc/solar_array_deployment.py
rename to pus_tc/devs/solar_array_deployment.py
diff --git a/pus_tc/devs/star_tracker.py b/pus_tc/devs/star_tracker.py
new file mode 100644
index 0000000..47a06b0
--- /dev/null
+++ b/pus_tc/devs/star_tracker.py
@@ -0,0 +1,791 @@
+# -*- coding: utf-8 -*-
+"""
+@file star_tracker.py
+@brief Star tracker commanding
+@author J. Meier
+@date 14.08.2021
+"""
+import struct
+
+from tmtccmd.config.definitions import QueueCommands
+
+from tmtccmd.tc.packer import TcQueueT
+from spacepackets.ecss.tc import PusTelecommand
+from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
+from tmtccmd.logging import get_console_logger
+from utility.input_helper import InputHelper
+
+
+LOGGER = get_console_logger()
+
+
+class StarTrackerActionIds:
+ PING = 0
+ BOOT = 1
+ REQ_VERSION = 2
+ REQ_INTERFACE = 3
+ REQ_TIME = 4
+ UNLOCK = 6
+ SWITCH_TO_BOOTLOADER_PROGRAM = 7
+ REQ_POWER = 11
+ TAKE_IMAGE = 15
+ DOWNLOAD_IMAGE = 9
+ UPLOAD_IMAGE = 10
+ DOWNLOAD_CENTROID = 16
+ UPLOAD_CENTROID = 17
+ SUBSCRIPTION = 18
+ IMAGE_PROCESSOR = 19
+ REQ_SOLUTION = 24
+ REQ_TEMPERATURE = 25
+ REQ_HISTOGRAM = 28
+ REQ_CONTRAST = 29
+ LIMITS = 40
+ MOUNTING = 41
+ CAMERA = 42
+ BLOB = 43
+ CENTROIDING = 44
+ LISA = 45
+ MATCHING = 46
+ TRACKING = 47
+ VALIDATION = 48
+ ALGO = 49
+ CHECKSUM = 50
+ FLASH_READ = 51
+ FLASH_WRITE = 52
+ DOWNLOAD_MATCHED_STAR = 53
+ STOP_STR_HELPER = 55
+ RESET_ERROR = 56
+ CHANGE_DOWNLOAD_IMAGE = 57
+ SET_JSON_FILE_NAME = 58
+ SET_FLASH_READ_FILENAME = 59
+ SET_TIME = 60
+ DOWNLOAD_DBIMAGE = 61
+ DOWNLOAD_BLOBPIXEL = 62
+ DOWNLOAD_FPGA_IMAGE = 63
+ CHANGE_FPGA_DOWNLOAD_FILE = 64
+ UPLOAD_FPGA_IMAGE = 65
+ FPGA_ACTION = 66
+ REQ_CAMERA_PARAMS = 67
+ REQ_LIMITS = 68
+ REQ_LOG_LEVEL = 69
+ REQ_MOUNTING = 70
+ REQ_IMAGE_PROCESSOR = 71
+ REQ_CENTROIDING = 72
+ REQ_LISA = 73
+ REQ_MATCHING = 74
+ REQ_TRACKING = 75
+ REQ_VALIDATION = 76
+ REQ_ALGO = 77
+ REQ_SUBSCRIPTION = 78
+ REQ_LOG_SUBSCRIPTION = 79
+ REQ_DEBUG_CAMERA = 80
+ LOGLEVEL = 81
+ LOG_SUBSCRIPTION = 82
+ DEBUG_CAMERA = 83
+ FIRMWARE_UPDATE = 84
+
+
+class FileDefs:
+ download_path = "/mnt/sd0/startracker"
+ json_file = "/mnt/sd0/startracker/full.json"
+ egse_ground_config = "/home/pi/arcsec/json/ground-config.json"
+ egse_flight_config = "/home/pi/arcsec/json/flight-config.json"
+ egse_solution_upload_img_config = "/home/pi/arcsec/json/upload-image-solution.json"
+ egse_histogram_upload_img_config = (
+ "/home/pi/arcsec/json/upload-image-histogram.json"
+ )
+ q7s_ground_config = "/mnt/sd0/startracker/json/ground-config.json"
+ q7s_flight_config = "/mnt/sd0/startracker/flight-config.json"
+ firmware2_1 = "/home/pi/arcsec/firmware/sagitta-2-1.bin"
+ firmware22_1 = "/home/pi/arcsec/firmware/sagitta-22-1.bin"
+ firmware_origin = "/home/pi/arcsec/firmware/sagitta-origin.bin"
+
+
+json_dict = {
+ "1": ["Q7S flight config", FileDefs.q7s_flight_config],
+ "2": ["Q7S ground config", FileDefs.q7s_ground_config],
+ "3": ["EGSE flight config", FileDefs.egse_flight_config],
+ "4": ["EGSE ground config", FileDefs.egse_ground_config],
+ "5": [
+ "EGSE get solution, upload image config",
+ FileDefs.egse_solution_upload_img_config,
+ ],
+ "6": [
+ "EGSE get histogram, upload image config",
+ FileDefs.egse_solution_upload_img_config,
+ ],
+}
+
+firmware_dict = {
+ "1": ["Firmware Major = 2, Minor = 1", FileDefs.firmware2_1],
+ "2": ["Firmware Major = 22, Minor = 1", FileDefs.firmware22_1],
+ "3": ["Firmware Origin", FileDefs.firmware_origin],
+}
+
+upload_image_dict = {
+ "1": ["q7s gemma", "/mnt/sd0/startracker/gemma.bin"],
+ "2": ["egse gemma", "/home/pi/arcsec/star-images/gemma.bin"],
+ "3": ["q7s polaris", "/mnt/sd0/startracker/polaris.bin"],
+ "4": ["egse polaris", "/home/pi/arcsec/star-images/polaris.bin"],
+}
+
+
+class StartRegion:
+ # Definition according to datasheet (which turned out to be partially faulty)
+ BOOTLOADER = 0
+ STAR_TRACKER_FIRMWARE = 1
+
+
+class PartitionSize:
+ # Size of most recent firmware image
+ STAR_TRACKER_FIRMWARE = 464572
+
+
+class Submode:
+ BOOTLOADER = 1
+ FIRMWARE = 2
+
+
+def pack_star_tracker_commands(
+ object_id: bytearray, tc_queue: TcQueueT, op_code: str
+) -> TcQueueT:
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "Generate command for star tracker with object id: 0x" + object_id.hex(),
+ )
+ )
+
+ if op_code == "0":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Mode On, Submode Bootloader")
+ )
+ command = pack_mode_data(object_id, Modes.ON, Submode.BOOTLOADER)
+ command = PusTelecommand(service=200, subservice=1, ssc=9, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "1":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Mode On, Submode Firmware")
+ )
+ command = pack_mode_data(object_id, Modes.ON, Submode.FIRMWARE)
+ command = PusTelecommand(service=200, subservice=1, ssc=10, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "2":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode Normal"))
+ command = pack_mode_data(object_id, Modes.NORMAL, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=11, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "3":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode Off"))
+ command = pack_mode_data(object_id, Modes.OFF, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=12, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "4":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode Raw"))
+ command = pack_mode_data(object_id, 3, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=13, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "5":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Ping"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.PING)
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "6":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Switch to bootloader program")
+ )
+ command = object_id + struct.pack(
+ "!I", StarTrackerActionIds.SWITCH_TO_BOOTLOADER_PROGRAM
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "7":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Temperature request"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_TEMPERATURE)
+ command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "8":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request version"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_VERSION)
+ command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "9":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request interface"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_INTERFACE)
+ command = PusTelecommand(service=8, subservice=128, ssc=34, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "10":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request power"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_POWER)
+ command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "11":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Set subscription parameters")
+ )
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.SUBSCRIPTION)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "12":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Boot"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.BOOT)
+ command = PusTelecommand(service=8, subservice=128, ssc=37, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "13":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request time"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_TIME)
+ command = PusTelecommand(service=8, subservice=128, ssc=38, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "14":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request solution"))
+ 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 == "15":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Upload image"))
+ image = get_upload_image()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.UPLOAD_IMAGE)
+ + bytearray(image, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "16":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download image"))
+ path = input("Specify storage location (default - /mnt/sd0/startracker): ")
+ if not path:
+ path = FileDefs.download_path
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.DOWNLOAD_IMAGE)
+ + bytearray(path, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=53, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "17":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set limits"))
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.LIMITS)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=42, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "18":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Set tracking parameters")
+ )
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.TRACKING)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=43, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "19":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mounting"))
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.MOUNTING)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "20":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Camera"))
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.CAMERA)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "22":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Centroiding"))
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.CENTROIDING)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=47, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "23":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: LISA"))
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.LISA)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=48, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "24":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Matching"))
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.MATCHING)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=49, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "25":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Validation"))
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.VALIDATION)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=50, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "26":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Algo"))
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.ALGO)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=51, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "27":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Take image"))
+ actionid = int(input("Specify parameter ID (take image - 4): "))
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.TAKE_IMAGE)
+ + struct.pack("!B", actionid)
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=52, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "28":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Stop str helper"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.STOP_STR_HELPER)
+ command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "30":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Set name of download image")
+ )
+ filename = input("Specify download image name: ")
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.CHANGE_DOWNLOAD_IMAGE)
+ + bytearray(filename, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "31":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request histogram"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_HISTOGRAM)
+ command = PusTelecommand(service=8, subservice=128, ssc=55, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "32":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request contrast"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_CONTRAST)
+ command = PusTelecommand(service=8, subservice=128, ssc=56, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "33":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set json filename"))
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.SET_JSON_FILE_NAME)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=57, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "35":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Flash read"))
+ command = pack_read_command(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=59, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "36":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Set flash read filename")
+ )
+ filename = input("Specify filename: ")
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.SET_FLASH_READ_FILENAME)
+ + bytearray(filename, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=60, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "37":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Get checksum"))
+ command = pack_checksum_command(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=61, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "38":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set time"))
+ unix_time = 1640783543
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.SET_TIME)
+ + struct.pack("!Q", unix_time)
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=61, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "39":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download Centroid"))
+ id = 0
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.DOWNLOAD_CENTROID)
+ + struct.pack("!B", id)
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=62, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "41":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Download matched star")
+ )
+ id = 0
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.DOWNLOAD_MATCHED_STAR)
+ + struct.pack("!B", id)
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=64, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "42":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download DB Image"))
+ id = 0
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.DOWNLOAD_DBIMAGE)
+ + struct.pack("!B", id)
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=65, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "43":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download Blob Pixel"))
+ id = 0
+ type = 1 # 0 - normal, 1 - fast
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.DOWNLOAD_BLOBPIXEL)
+ + struct.pack("!B", id)
+ + struct.pack("!B", type)
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=65, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "44":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download FPGA Image"))
+ position = int(input("Start position: "))
+ length = int(input("Size to download: "))
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.DOWNLOAD_FPGA_IMAGE)
+ + struct.pack("!I", position)
+ + struct.pack("!I", length)
+ + bytearray(FileDefs.downloadFpgaImagePath, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=66, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "45":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Change donwload FPGA image file name")
+ )
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.CHANGE_FPGA_DOWNLOAD_FILE)
+ + bytearray(FileDefs.downloadFpgaImageName, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=67, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "46":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Upload FPGA image"))
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.UPLOAD_FPGA_IMAGE)
+ + bytearray(FileDefs.uploadFpgaImageName, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=68, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "47":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: FPGA action"))
+ id = 3
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.FPGA_ACTION)
+ + struct.pack("!B", id)
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=69, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "48":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Unlock"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.UNLOCK)
+ command = PusTelecommand(service=8, subservice=128, ssc=70, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "49":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request camera parameters")
+ )
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_CAMERA_PARAMS)
+ command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "50":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request limits"))
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_LIMITS)
+ command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "51":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Set image processor parameters")
+ )
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.IMAGE_PROCESSOR)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=70, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "52":
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "Star tracker: EGSE load ground config camera parameters",
+ )
+ )
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.CAMERA)
+ + bytearray(FileDefs.egse_ground_config, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "53":
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "Star tracker: EGSE load flight config camera parameters",
+ )
+ )
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.CAMERA)
+ + bytearray(FileDefs.egse_flight_config, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "54":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request log level parameters")
+ )
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_LOG_LEVEL)
+ command = PusTelecommand(service=8, subservice=128, ssc=74, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "55":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request mounting parameters")
+ )
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_MOUNTING)
+ command = PusTelecommand(service=8, subservice=128, ssc=75, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "56":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request image processor parameters")
+ )
+ command = object_id + struct.pack(
+ "!I", StarTrackerActionIds.REQ_IMAGE_PROCESSOR
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=76, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "57":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request centroiding parameters")
+ )
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_CENTROIDING)
+ command = PusTelecommand(service=8, subservice=128, ssc=75, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "58":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request lisa parameters")
+ )
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_LISA)
+ command = PusTelecommand(service=8, subservice=128, ssc=76, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "59":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request matching parameters")
+ )
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_MATCHING)
+ command = PusTelecommand(service=8, subservice=128, ssc=77, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "60":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request tracking parameters")
+ )
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_TRACKING)
+ command = PusTelecommand(service=8, subservice=128, ssc=78, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "61":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request validation parameters")
+ )
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_VALIDATION)
+ command = PusTelecommand(service=8, subservice=128, ssc=79, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "62":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request algo parameters")
+ )
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_ALGO)
+ command = PusTelecommand(service=8, subservice=128, ssc=80, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "63":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request subscription parameters")
+ )
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_SUBSCRIPTION)
+ command = PusTelecommand(service=8, subservice=128, ssc=81, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "64":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request log subscription parameters")
+ )
+ command = object_id + struct.pack(
+ "!I", StarTrackerActionIds.REQ_LOG_SUBSCRIPTION
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=82, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "65":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Request debug camera parameters")
+ )
+ command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_DEBUG_CAMERA)
+ command = PusTelecommand(service=8, subservice=128, ssc=83, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "66":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Set log level parameters")
+ )
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.LOGLEVEL)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=84, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "67":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Set log subscription parameters")
+ )
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.LOG_SUBSCRIPTION)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=85, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "68":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Set debug camera parameters")
+ )
+ json_file = get_config_file()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.DEBUG_CAMERA)
+ + bytearray(json_file, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=86, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "69":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Firmware update"))
+ firmware = get_firmware()
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.FIRMWARE_UPDATE)
+ + bytearray(firmware, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=87, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "70":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Disable timestamp generation")
+ )
+ command = object_id + struct.pack(
+ "!I", StarTrackerActionIds.DISBALE_TIMESTAMP_GENERATION
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=88, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "71":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker: Enable timestamp generation")
+ )
+ command = object_id + struct.pack(
+ "!I", StarTrackerActionIds.ENABLE_TIMESTAMP_GENERATION
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=89, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+
+def pack_read_command(object_id: bytearray) -> bytearray:
+ start_region = StartRegion.STAR_TRACKER_FIRMWARE
+ size = PartitionSize.STAR_TRACKER_FIRMWARE
+ path = input("Specify storage location (default - /mnt/sd0/startracker): ")
+ if not path:
+ path = FileDefs.download_path
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.FLASH_READ)
+ + struct.pack("!B", start_region)
+ + struct.pack("!I", size)
+ + bytearray(path, "utf-8")
+ )
+ return command
+
+
+def pack_checksum_command(object_id: bytearray) -> bytearray:
+ start_region = StartRegion.STAR_TRACKER_FIRMWARE
+ address = 0
+ size = PartitionSize.STAR_TRACKER_FIRMWARE
+ command = (
+ object_id
+ + struct.pack("!I", StarTrackerActionIds.CHECKSUM)
+ + struct.pack("!B", start_region)
+ + struct.pack("!I", address)
+ + struct.pack("!I", size)
+ )
+ return command
+
+
+def get_config_file() -> str:
+ LOGGER.info("Specify json file")
+ input_helper = InputHelper(json_dict)
+ key = input_helper.get_key()
+ json_file = json_dict[key][1]
+ return json_file
+
+
+def get_firmware() -> str:
+ LOGGER.info("Specify firmware file")
+ input_helper = InputHelper(firmware_dict)
+ key = input_helper.get_key()
+ firmware = firmware_dict[key][1]
+ return firmware
+
+
+def get_upload_image() -> str:
+ LOGGER.info("Specify image to upload")
+ input_helper = InputHelper(upload_image_dict)
+ key = input_helper.get_key()
+ image = upload_image_dict[key][1]
+ return image
diff --git a/pus_tc/devs/str_img_helper.py b/pus_tc/devs/str_img_helper.py
new file mode 100644
index 0000000..35c3ff4
--- /dev/null
+++ b/pus_tc/devs/str_img_helper.py
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+"""
+@file str_img_helper.py
+@brief Commanding of the star tracker image helper object which is responsible for uploading
+ and downloading images to/from the star tracker.
+@details Images to uplaod must be previously transferred to the OBC with the CFDP protocol.
+ Also downloaded images will be stored on the filesystem of the OBC and can be transferred via CFDP.
+@author J. Meier
+@date 29.11.2021
+"""
+import struct
+
+from tmtccmd.config.definitions import QueueCommands
+
+from tmtccmd.tc.packer import TcQueueT
+from spacepackets.ecss.tc import PusTelecommand
+
+
+class Commands:
+ UPLOAD_IMAGE = 0
+ DOWNLOAD_IMAGE = 1
+
+
+class ImagePathDefs:
+ uploadFile = "/mnt/sd0/startracker/gemma.bin"
+
+
+def pack_str_img_helper_command(
+ object_id: bytearray, tc_queue: TcQueueT, op_code: str
+) -> TcQueueT:
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "Testing star tracker image helper object id: 0x" + object_id.hex(),
+ )
+ )
+
+ if op_code == "0":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Star tracker image helper: Upload image")
+ )
+ command = (
+ object_id
+ + struct.pack("!I", Commands.UPLOAD_IMAGE)
+ + bytearray(ImagePathDefs.uploadFile, "utf-8")
+ )
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/devs/syrlinks_hk_handler.py b/pus_tc/devs/syrlinks_hk_handler.py
new file mode 100644
index 0000000..382177b
--- /dev/null
+++ b/pus_tc/devs/syrlinks_hk_handler.py
@@ -0,0 +1,153 @@
+# -*- coding: utf-8 -*-
+"""
+@file syrlinks_hk_handler.py
+@brief Syrlinks Hk Handler tests
+@author J. Meier
+@date 13.12.2020
+"""
+
+from tmtccmd.config.definitions import QueueCommands
+from tmtccmd.tc.definitions import TcQueueT
+from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command
+from spacepackets.ecss.tc import PusTelecommand
+from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
+import struct
+
+
+class SetIds:
+ RX_REGISTERS_DATASET = 1
+ TX_REGISTERS_DATASET = 2
+
+
+class CommandIds:
+ READ_RX_STATUS_REGISTERS = 2
+ SET_TX_MODE_STANDBY = 3
+ SET_TX_MODE_MODULATION = 4
+ SET_TX_MODE_CW = 5
+ READ_TX_STATUS = 7
+ READ_TX_WAVEFORM = 8
+ READ_TX_AGC_VALUE_HIGH_BYTE = 9
+ READ_TX_AGC_VALUE_LOW_BYTE = 10
+ WRITE_LCL_CONFIG = 11
+ READ_LCL_CONFIG_REGISTER = 12
+ SET_WAVEFORM_OQPSK = 17
+ SET_WAVEFORM_BPSK = 18
+ SET_SECOND_CONFIG = 19
+ ENABLE_DEBUG = 20
+ DISABLE_DEBUG = 21
+
+
+def pack_syrlinks_command(
+ object_id: bytearray, tc_queue: TcQueueT, op_code: str
+) -> TcQueueT:
+ tc_queue.appendleft(
+ (
+ QueueCommands.PRINT,
+ "Testing Syrlinks with object id: 0x" + object_id.hex(),
+ )
+ )
+
+ if op_code == "0":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Set mode off"))
+ command = pack_mode_data(object_id, Modes.OFF, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=9, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "1":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Set mode on"))
+ command = pack_mode_data(object_id, Modes.ON, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=10, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "2":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Mode Normal"))
+ command = pack_mode_data(object_id, Modes.NORMAL, 0)
+ command = PusTelecommand(service=200, subservice=1, ssc=11, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "3":
+ tc_queue.appendleft((QueueCommands.PRINT, "syrlinks: Set TX mode standby"))
+ command = object_id + CommandIds.SET_TX_MODE_STANDBY
+ command = PusTelecommand(service=8, subservice=128, ssc=10, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "4":
+ tc_queue.appendleft((QueueCommands.PRINT, "syrlinks: Set TX mode modulation"))
+ command = object_id + CommandIds.SET_TX_MODE_MODULATION
+ command = PusTelecommand(service=8, subservice=128, ssc=11, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "5":
+ tc_queue.appendleft((QueueCommands.PRINT, "syrlinks: Set TX mode CW"))
+ command = object_id + CommandIds.SET_TX_MODE_CW
+ command = PusTelecommand(service=8, subservice=128, ssc=12, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "6":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Get RX Registers"))
+ sid = make_sid(object_id, SetIds.RX_REGISTERS_DATASET)
+ command = generate_one_hk_command(sid, 200)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "7":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Get TX Registers"))
+ sid = make_sid(object_id, SetIds.TX_REGISTERS_DATASET)
+ command = generate_one_hk_command(sid, 201)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "8":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Read TX status"))
+ command = object_id + CommandIds.READ_TX_STATUS
+ command = PusTelecommand(service=8, subservice=128, ssc=13, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "9":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Read TX waveform"))
+ command = object_id + CommandIds.READ_TX_WAVEFORM
+ command = PusTelecommand(service=8, subservice=128, ssc=14, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "10":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Syrlinks: Read TX AGC value high byte")
+ )
+ command = object_id + CommandIds.READ_TX_AGC_VALUE_HIGH_BYTE
+ command = PusTelecommand(service=8, subservice=128, ssc=15, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "11":
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Syrlinks: Read TX AGC value low byte")
+ )
+ command = object_id + CommandIds.READ_TX_AGC_VALUE_LOW_BYTE
+ command = PusTelecommand(service=8, subservice=128, ssc=16, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "12":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Write LCL config"))
+ command = object_id + struct.pack("!I", CommandIds.WRITE_LCL_CONFIG)
+ command = PusTelecommand(service=8, subservice=128, ssc=17, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "13":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Read RX status registers"))
+ command = object_id + struct.pack("!I", CommandIds.READ_RX_STATUS_REGISTERS)
+ command = PusTelecommand(service=8, subservice=128, ssc=18, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "14":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Read LCL config register"))
+ command = object_id + struct.pack("!I", CommandIds.READ_LCL_CONFIG_REGISTER)
+ command = PusTelecommand(service=8, subservice=128, ssc=19, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "15":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Set waveform OQPSK"))
+ command = object_id + struct.pack("!I", CommandIds.SET_WAVEFORM_OQPSK)
+ command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "16":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Set waveform BPSK"))
+ command = object_id + struct.pack("!I", CommandIds.SET_WAVEFORM_BPSK)
+ command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "17":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Set second config"))
+ command = object_id + struct.pack("!I", CommandIds.SET_SECOND_CONFIG)
+ command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "18":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Enable debug printout"))
+ command = object_id + struct.pack("!I", CommandIds.ENABLE_DEBUG)
+ command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "19":
+ tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Disable debug printout"))
+ command = object_id + struct.pack("!I", CommandIds.DISABLE_DEBUG)
+ command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/tmp1075.py b/pus_tc/devs/tmp1075.py
similarity index 79%
rename from pus_tc/tmp1075.py
rename to pus_tc/devs/tmp1075.py
index 48b2d65..ffc6524 100644
--- a/pus_tc/tmp1075.py
+++ b/pus_tc/devs/tmp1075.py
@@ -8,7 +8,7 @@
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
+from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data
@@ -18,10 +18,13 @@ class Tmp1075TestProcedure:
@details Setting all to True will run all tests.
Setting all to False will only run the tests set to True.
"""
+
all = False
start_adc_conversion = False
get_temp = False
- set_mode_normal = True # Setting mode to normal starts continuous temperature reading
+ set_mode_normal = (
+ True # Setting mode to normal starts continuous temperature reading
+ )
set_mode_on = False # If mode is MODE_ON, temperature will only be read on command
@@ -30,14 +33,21 @@ class Tmp1075ActionIds:
start_adc_conversion = bytearray([0x0, 0x0, 0x0, 0x02])
-def pack_tmp1075_test_into(object_id: bytearray, op_code: str, tc_queue: TcQueueT) -> TcQueueT:
+def pack_tmp1075_test_into(
+ object_id: bytearray, op_code: str, tc_queue: TcQueueT
+) -> TcQueueT:
tc_queue.appendleft(
- (QueueCommands.PRINT,
- "Testing Tmp1075 Temperature Sensor Handler with object id: 0x" + object_id.hex())
+ (
+ QueueCommands.PRINT,
+ "Testing Tmp1075 Temperature Sensor Handler with object id: 0x"
+ + object_id.hex(),
+ )
)
if Tmp1075TestProcedure.all or Tmp1075TestProcedure.start_adc_conversion:
- tc_queue.appendleft((QueueCommands.PRINT, "TMP1075: Starting new temperature conversion"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "TMP1075: Starting new temperature conversion")
+ )
command = object_id + Tmp1075ActionIds.start_adc_conversion
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/p60dock.py b/pus_tc/p60dock.py
deleted file mode 100644
index 9b1bef8..0000000
--- a/pus_tc/p60dock.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-@file tmtcc_tc_p60dock.py
-@brief P60 Dock tests
-@author J. Meier
-@date 13.12.2020
-"""
-from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
-from gomspace.gomspace_common import *
-
-
-class P60DockTestProcedure:
- """
- @brief Use this class to define the tests to perform for the P60Dock.
- @details Setting all to True will run all tests.
- Setting all to False will only run the tests set to True.
- """
- all = False
- reboot = False
- read_gnd_wdt = False
- gnd_wdt_reset = False
- ping = False
- channel_3_off = False # pdu2
- read_temperature1 = True
- read_channel_3_state = False # pdu2
- read_cur_lu_lim_0 = False
- channel_3_on = False # pdu2
- invalid_table_id_test = False # Test to check if software properly handles invalid table ids
- invalid_address_test = False # Test to check if software properly handles invalid addresses
- invalid_parameter_size_test = False
-
-
-class P60DockConfigTable:
- out_en_0 = TableEntry(bytearray([0x00, 0x68]), TableEntry.uint8_size) # ACU
- out_en_1 = TableEntry(bytearray([0x00, 0x69]), TableEntry.uint8_size) # PDU1
- out_en_2 = TableEntry(bytearray([0x00, 0x6A]), TableEntry.uint8_size)
- out_en_3 = TableEntry(bytearray([0x00, 0x6B]), TableEntry.uint8_size) # PDU2
- # When channel consumes more than cur_lu_lim, channel is turned of immediately
- cur_lu_lim_0 = TableEntry(bytearray([0x00, 0xF8]), TableEntry.uint16_size)
-
-
-class P60DockHkTable:
- temperature1 = TableEntry(bytearray([0x00, 0x44]), TableEntry.uint16_size)
- temperature2 = TableEntry(bytearray([0x00, 0x46]), TableEntry.uint16_size)
- # Ground WDT value (remaining seconds until reboot)
- wdt_gnd_left = TableEntry(bytearray([0x00, 0xA8]), TableEntry.uint32_size)
-
-
-def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
- if P60DockTestProcedure.all or P60DockTestProcedure.reboot:
- tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Reboot"))
- command = pack_reboot_command(object_id)
- command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if P60DockTestProcedure.all or P60DockTestProcedure.read_gnd_wdt:
- tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Reading ground watchdog timer value"))
- command = pack_get_param_command(
- object_id, TableIds.hk, P60DockHkTable.wdt_gnd_left.parameter_address,
- P60DockHkTable.wdt_gnd_left.parameter_size
- )
- command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if P60DockTestProcedure.all or P60DockTestProcedure.gnd_wdt_reset:
- tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Testing ground watchdog reset"))
- command = pack_gnd_wdt_reset_command(object_id)
- command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if P60DockTestProcedure.all or P60DockTestProcedure.ping:
- tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Ping"))
- ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
- command = pack_ping_command(object_id, ping_data)
- command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_off:
- tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Testing setting output channel 3 off"))
- parameter = 0 # set channel off
- command = pack_set_param_command(object_id, P60DockConfigTable.out_en_3.parameter_address,
- P60DockConfigTable.out_en_3.parameter_size, parameter)
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if P60DockTestProcedure.all or P60DockTestProcedure.read_temperature1:
- tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Testing temperature reading"))
- command = pack_get_param_command(
- object_id, TableIds.hk, P60DockHkTable.temperature1.parameter_address,
- P60DockHkTable.temperature1.parameter_size
- )
- command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_on:
- tc_queue.appendleft((QueueCommands.PRINT,
- "P60 Dock: Testing Output Channel 3 state (PDU2)"))
- command = pack_get_param_command(object_id, TableIds.config, P60DockConfigTable.out_en_3.parameter_address,
- P60DockConfigTable.out_en_3.parameter_size)
- command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if P60DockTestProcedure.all or P60DockTestProcedure.read_cur_lu_lim_0:
- tc_queue.appendleft((QueueCommands.PRINT,
- "P60 Dock: Reading current limit value of output channel 0"))
- command = pack_get_param_command(
- object_id, TableIds.config, P60DockConfigTable.cur_lu_lim_0.parameter_address,
- P60DockConfigTable.cur_lu_lim_0.parameter_size
- )
- command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_on:
- tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Testing setting output channel 3 on"))
- parameter = 1 # set channel on
- command = pack_set_param_command(object_id, P60DockConfigTable.out_en_3.parameter_address,
- P60DockConfigTable.out_en_3.parameter_size, parameter)
- command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if P60DockTestProcedure.all or P60DockTestProcedure.invalid_table_id_test:
- tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Testing invalid table id handling"))
- table_id_invalid = 5
- command = pack_get_param_command(
- object_id, table_id_invalid, P60DockHkTable.temperature1.parameter_address,
- P60DockHkTable.temperature1.parameter_size
- )
- command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if P60DockTestProcedure.all or P60DockTestProcedure.invalid_address_test:
- tc_queue.appendleft((QueueCommands.PRINT,
- "P60 Dock: Testing invalid address handling in get param command"))
- invalid_address = bytearray([0x01, 0xF4])
- command = pack_get_param_command(object_id, TableIds.hk, invalid_address,
- P60DockHkTable.temperature1.parameter_size)
- command = PusTelecommand(service=8, subservice=128, ssc=29, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft((QueueCommands.PRINT,
- "P60 Dock: Testing invalid address handling in set param command"))
- invalid_address = bytearray([0x01, 0xF4])
- parameter_size = 2
- parameter = 1
- command = pack_set_param_command(object_id, invalid_address, parameter_size, parameter)
- command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if P60DockTestProcedure.all or P60DockTestProcedure.invalid_parameter_size_test:
- tc_queue.appendleft(
- (QueueCommands.PRINT,
- "P60 Dock: Testing handling of invalid parameter sizes in get-param command")
- )
- invalid_size = 5
- command = pack_get_param_command(
- object_id, TableIds.hk, P60DockHkTable.temperature1.parameter_address, invalid_size
- )
- command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- tc_queue.appendleft(
- (QueueCommands.PRINT,
- "P60 Dock: Testing handling of invalid parameter size in set-param command")
- )
- parameter = 1
- command = pack_set_param_command(
- object_id, P60DockConfigTable.out_en_3.parameter_address, invalid_size, parameter
- )
- command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
-
- return tc_queue
diff --git a/pus_tc/pdu1.py b/pus_tc/pdu1.py
deleted file mode 100644
index fc52e65..0000000
--- a/pus_tc/pdu1.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-@file tmtcc_tc_pdu1.py
-@brief PDU2 tests
-@author J. Meier
-@date 17.12.2020
-"""
-from tmtccmd.config.definitions import QueueCommands
-
-from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
-from gomspace.gomspace_common import *
-from pus_tc.p60dock import P60DockConfigTable
-from gomspace.gomspace_pdu_definitions import *
-
-
-class PDU1TestProcedure:
- """
- @brief Use this class to define the tests to perform for the PDU2.
- @details Setting all to True will run all tests.
- Setting all to False will only run the tests set to True.
- """
- all = False
- reboot = False
- ping = False
- read_temperature = False
- turn_channel_2_on = False # Star Tracker connected to this channel (5V)
- turn_channel_2_off = False
- turn_channel_3_on = False # MTQ connected to this channel (5V)
- turn_channel_3_off = True
-
-
-def pack_pdu1_test_into(
- pdu1_object_id: bytearray, p60dock_object_id: bytearray, tc_queue: TcQueueT
-):
- tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU1"))
-
- if PDU1TestProcedure.all or PDU1TestProcedure.ping:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
- ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
- command = pack_ping_command(pdu1_object_id, ping_data)
- command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU1TestProcedure.all or PDU1TestProcedure.read_temperature:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Testing temperature reading"))
- command = pack_get_param_command(
- pdu1_object_id, TableIds.hk, PDUHkTable.temperature.parameter_address,
- PDUHkTable.temperature.parameter_size
- )
- command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_on:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 2 on (Star Tracker)"))
- command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_2.parameter_address,
- PDUConfigTable.out_en_2.parameter_size, Channel.on)
- command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_off:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 2 off (Star Tracker)"))
- command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_2.parameter_address,
- PDUConfigTable.out_en_2.parameter_size, Channel.off)
- command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_3_on:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 3 on (MTQ)"))
- command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_3.parameter_address,
- PDUConfigTable.out_en_3.parameter_size, Channel.on)
- command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_3_off:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 3 off (MTQ)"))
- command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_3.parameter_address,
- PDUConfigTable.out_en_3.parameter_size, Channel.off)
- command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/pdu2.py b/pus_tc/pdu2.py
deleted file mode 100644
index 2beede5..0000000
--- a/pus_tc/pdu2.py
+++ /dev/null
@@ -1,105 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-@file tmtcc_tc_pdu2.py
-@brief PDU2 tests
-@author J. Meier
-@date 17.12.2020
-"""
-from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
-from gomspace.gomspace_common import *
-from gomspace.gomspace_pdu_definitions import *
-from pus_tc.p60dock import P60DockConfigTable
-
-
-class PDU2TestProcedure:
- """
- @brief Use this class to define the tests to perform for the PDU2.
- @details Setting all to True will run all tests.
- Setting all to False will only run the tests set to True.
- """
- all = False
- reboot = False
- read_gnd_wdt = False
- gnd_wdt_reset = False
- ping = False
- channel_2_off = False # Reaction wheels 5V
- read_temperature = True
- read_channel_2_state = False # Reaction wheels 5V
- read_cur_lu_lim_0 = False # OBC
- channel_2_on = False # Reaction wheels 5V
- invalid_table_id_test = False # Test to check if software properly handles invalid table ids
- invalid_address_test = False # Test to check if software properly handles invalid addresses
- invalid_parameter_size_test = False
- request_hk_table = False
-
-
-def pack_pdu2_test_into(pdu2_object_id: bytearray, p60dock_object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
- tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU2"))
-
- tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Enabling PDU2"))
- command = pack_set_param_command(p60dock_object_id, P60DockConfigTable.out_en_3.parameter_address,
- P60DockConfigTable.out_en_3.parameter_size, Channel.on)
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
-
- if PDU2TestProcedure.all or PDU2TestProcedure.reboot:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reboot"))
- command = pack_reboot_command(pdu2_object_id)
- command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU2TestProcedure.all or PDU2TestProcedure.read_gnd_wdt:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reading ground watchdog timer value"))
- command = pack_get_param_command(pdu2_object_id, TableIds.hk, PDUHkTable.wdt_gnd_left.parameter_address,
- PDUHkTable.wdt_gnd_left.parameter_size)
- command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU2TestProcedure.all or PDU2TestProcedure.gnd_wdt_reset:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing ground watchdog reset"))
- command = pack_gnd_wdt_reset_command(pdu2_object_id)
- command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU2TestProcedure.all or PDU2TestProcedure.ping:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Ping Test"))
- ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
- command = pack_ping_command(pdu2_object_id, ping_data)
- command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU2TestProcedure.all or PDU2TestProcedure.channel_2_on:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing setting output channel 2 on (TCS Heater)"))
- command = pack_set_param_command(pdu2_object_id, PDUConfigTable.out_en_2.parameter_address,
- PDUConfigTable.out_en_2.parameter_size, Channel.on)
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU2TestProcedure.all or PDU2TestProcedure.read_temperature:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing temperature reading"))
- command = pack_get_param_command(pdu2_object_id, TableIds.hk, PDUHkTable.temperature.parameter_address,
- PDUHkTable.temperature.parameter_size)
- command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU2TestProcedure.all or PDU2TestProcedure.read_channel_2_state:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reading output channel 2 state (TCS Heater)"))
- command = pack_get_param_command(pdu2_object_id, TableIds.config, PDUConfigTable.out_en_2.parameter_address,
- PDUConfigTable.out_en_2.parameter_size)
- command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU2TestProcedure.all or PDU2TestProcedure.read_cur_lu_lim_0:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reading current limit value of output channel 0 (OBC)"))
- command = pack_get_param_command(pdu2_object_id, TableIds.config, PDUConfigTable.cur_lu_lim_0.parameter_address,
- PDUConfigTable.cur_lu_lim_0.parameter_size)
- command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU2TestProcedure.all or PDU2TestProcedure.channel_2_off:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing setting output channel 2 off"))
- command = pack_set_param_command(pdu2_object_id, PDUConfigTable.out_en_2.parameter_address,
- PDUConfigTable.out_en_2.parameter_size, Channel.off)
- command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if PDU2TestProcedure.all or PDU2TestProcedure.request_hk_table:
- tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Requesting housekeeping table"))
- command = pack_request_full_hk_table_command(pdu2_object_id)
- command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
-
- return tc_queue
diff --git a/pus_tc/ploc_mpsoc.py b/pus_tc/ploc_mpsoc.py
deleted file mode 100644
index d7a2977..0000000
--- a/pus_tc/ploc_mpsoc.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-@file ploc_mpsoc.py
-@brief Tests for commanding the MPSoC of the PLOC.
- The MPSoC is programmed by the ILH.
-@author J. Meier
-@date 06.03.2021
-"""
-import struct
-
-from tmtccmd.config.definitions import QueueCommands
-
-from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
-
-
-class PlocTestProcedure:
- """
- @brief Use this class to define the tests to perform for the PLOC.
- @details Setting all to True will run all tests.
- Setting all to False will only run the tests set to True.
- """
- all = False
- test_tc_mem_write = False
- test_tc_mem_read = True
-
-
-class PlocActionIds:
- tc_mem_write = bytearray([0x0, 0x0, 0x0, 0x1])
- tc_mem_read = bytearray([0x0, 0x0, 0x0, 0x2])
-
-
-class PlocReplyIds:
- tm_mem_read_report = 6
-
-
-def pack_ploc_mpsoc_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
- tc_queue.appendleft(
- (QueueCommands.PRINT,
- "Testing PLOC MPSoC with object id: 0x" + object_id.hex())
- )
-
- if PlocTestProcedure.all or PlocTestProcedure.test_tc_mem_write:
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC: TC Mem Write Test"))
- memory_address = int(input("PLOC Tc Mem Write: Type memory address: 0x"), 16)
- memory_data = int(input("PLOC Tc Mem Write: Type memory data: 0x"), 16)
- command = generate_write_mem_command(object_id, struct.pack('!I', memory_address), memory_data)
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
-
- if PlocTestProcedure.all or PlocTestProcedure.test_tc_mem_read:
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC: TC Mem Read Test"))
- memory_address = int(input("PLOC Tc Mem Read: Type memory address: 0x"), 16)
- command = object_id + PlocActionIds.tc_mem_read + struct.pack('!I', memory_address)
- command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
-
- return tc_queue
-
-
-def generate_write_mem_command(object_id: bytearray, memory_address: bytearray, memory_data: int) -> bytearray:
- """ This function generates the command to write to a memory address within the PLOC
- @param object_id The object id of the PlocHandler
- @param memory_address The PLOC memory address where to write to.
- @param memory_data The data to write to the memory address specified by the bytearray memory_address.
- """
- command = object_id + PlocActionIds.tc_mem_write + memory_address + struct.pack('!I', memory_data)
- return command
diff --git a/pus_tc/ploc_upater.py b/pus_tc/ploc_upater.py
deleted file mode 100644
index 2d92cfe..0000000
--- a/pus_tc/ploc_upater.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-@file ploc_supervisor.py
-@brief Tests for commanding the supervisor of the PLOC.
- The supervisor is programmed by Thales.
-@author J. Meier
-@date 10.07.2021
-"""
-import struct
-
-from tmtccmd.config.definitions import QueueCommands
-
-from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
-from tmtccmd.utility.logger import get_console_logger
-
-LOGGER = get_console_logger()
-
-latchup_id_dict = {
- "0": "0.85V",
- "1": "1.8V",
- "2": "MISC",
- "3": "3.3V",
- "4": "NVM_4XO",
- "5": "MISSION",
- "6": "SAFECOTS"
-}
-
-
-class UpdaterActionIds:
- UPDATE_NVM0_A = 0
- UPDATE_NVM0_B = 1
- UPDATE_NVM1_A = 2
- UPDATE_NVM1_B = 3
-
-
-class ImagePathDefs:
- imageNvm0A = "/mnt/sd0/ploc/updateNvm0A.bin"
- imageNvm0B = "/mnt/sd0/ploc/updateNvm0B.bin"
- imageNvm1A = "/mnt/sd0/ploc/updateNvm1A.bin"
- imageNvm1B = "/mnt/sd0/ploc/updateNvm1B.bin"
-
-
-def pack_ploc_updater_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
- tc_queue.appendleft(
- (QueueCommands.PRINT,
- "Testing PLOC updater with object id: 0x" + object_id.hex())
- )
-
- if op_code == "0":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update partition A on NVM0"))
- command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_NVM0_A) + \
- bytearray(ImagePathDefs.imageNvm0A, 'utf-8')
- command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if op_code == "1":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update partition B on NVM0"))
- command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_NVM0_B) + \
- bytearray(ImagePathDefs.imageNvm0B, 'utf-8')
- command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if op_code == "2":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update partition A on NVM1"))
- command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_NVM1_A) + \
- bytearray(ImagePathDefs.imageNvm1A, 'utf-8')
- command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
- if op_code == "3":
- tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update partition B on NVM1"))
- command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_NVM1_B) + \
- bytearray(ImagePathDefs.imageNvm1B, 'utf-8')
- command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/rad_sensor.py b/pus_tc/rad_sensor.py
deleted file mode 100644
index a462c13..0000000
--- a/pus_tc/rad_sensor.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-@file rad_sensor.py
-@brief Tests for the radiation sensor handler
-@author J. Meier
-@date 01.07.2021
-"""
-import struct
-from tmtccmd.config.definitions import QueueCommands
-
-from tmtccmd.tc.packer import TcQueueT
-from tmtccmd.ecss.tc import PusTelecommand
-from pus_tc.service_200_mode import pack_mode_data
-
-
-def pack_rad_sensor_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
- tc_queue.appendleft(
- (QueueCommands.PRINT,
- "Testing radiation sensor handler with object id: 0x" + object_id.hex())
- )
-
- if op_code == "0":
- tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode on"))
- mode_data = pack_mode_data(object_id, 1, 0)
- command = PusTelecommand(service=200, subservice=1, ssc=41, app_data=mode_data)
- tc_queue.appendleft(command.pack_command_tuple())
-
- if op_code == "1":
- tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode normal"))
- mode_data = pack_mode_data(object_id, 2, 0)
- command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
- tc_queue.appendleft(command.pack_command_tuple())
-
- if op_code == "2":
- tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode off"))
- 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())
\ No newline at end of file
diff --git a/pus_tc/service_200_mode.py b/pus_tc/service_200_mode.py
index 4bc8cdb..08faad4 100644
--- a/pus_tc/service_200_mode.py
+++ b/pus_tc/service_200_mode.py
@@ -6,7 +6,7 @@
@date 02.05.2020
"""
from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.ecss.tc import PusTelecommand
+from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc.packer import TcQueueT
from tmtccmd.tc.service_200_mode import pack_mode_data
from config.object_ids import TEST_DEVICE_ID
diff --git a/pus_tc/syrlinks_hk_handler.py b/pus_tc/syrlinks_hk_handler.py
deleted file mode 100644
index bbdb0c2..0000000
--- a/pus_tc/syrlinks_hk_handler.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-@file syrlinks_hk_handler.py
-@brief Syrlinks Hk Handler tests
-@author J. Meier
-@date 13.12.2020
-"""
-
-from tmtccmd.config.definitions import QueueCommands
-from tmtccmd.tc.definitions import TcQueueT
-from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command
-
-
-class SetIds:
- RX_REGISTERS_DATASET = 1
- TX_REGISTERS_DATASET = 2
-
-
-def pack_syrlinks_hk_handler_test_into(object_id: bytearray, tc_queue: TcQueueT):
- tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Get RX Registers"))
- sid = make_sid(object_id, SetIds.RX_REGISTERS_DATASET)
- command = generate_one_hk_command(sid, 200)
- tc_queue.appendleft(command.pack_command_tuple())
-
- tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Get TX Registers"))
- sid = make_sid(object_id, SetIds.TX_REGISTERS_DATASET)
- command = generate_one_hk_command(sid, 201)
- tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/system/__init__.py b/pus_tc/system/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/pus_tc/system/acs.py b/pus_tc/system/acs.py
new file mode 100644
index 0000000..109a8e7
--- /dev/null
+++ b/pus_tc/system/acs.py
@@ -0,0 +1,123 @@
+import enum
+from tmtccmd.tc.definitions import TcQueueT
+from tmtccmd.tc.service_200_mode import Modes
+from config.object_ids import ACS_BOARD_ASS_ID, SUS_BOARD_ASS_ID
+
+from .common import command_assembly
+
+
+class AcsOpCodes:
+ ACS_ASS_A_SIDE = ["0", "acs-a"]
+ ACS_ASS_B_SIDE = ["1", "acs-b"]
+ ACS_ASS_DUAL_MODE = ["2", "acs-d"]
+ ACS_ASS_OFF = ["3", "acs-off"]
+ ACS_ASS_A_ON = ["4", "acs-ao"]
+ ACS_ASS_B_ON = ["5", "acs-bo"]
+ ACS_ASS_DUAL_ON = ["6", "acs-do"]
+
+
+class SusOpCodes:
+ SUS_ASS_NOM_SIDE = ["0", "sus-nom"]
+ SUS_ASS_RED_SIDE = ["1", "sus-red"]
+ SUS_ASS_DUAL_MODE = ["2", "sus-d"]
+ SUS_ASS_OFF = ["3", "sus-off"]
+
+
+class DualSideSubmodes(enum.IntEnum):
+ A_SIDE = 0
+ B_SIDE = 1
+ DUAL_SIDE = 2
+
+
+def pack_acs_command(tc_queue: TcQueueT, op_code: str):
+ if op_code in AcsOpCodes.ACS_ASS_A_SIDE:
+ command_assembly(
+ object_id=ACS_BOARD_ASS_ID,
+ mode=Modes.NORMAL,
+ submode=DualSideSubmodes.A_SIDE,
+ tc_queue=tc_queue,
+ info="Switching to ACS board assembly A side",
+ )
+ if op_code in AcsOpCodes.ACS_ASS_B_SIDE:
+ command_assembly(
+ object_id=ACS_BOARD_ASS_ID,
+ mode=Modes.NORMAL,
+ submode=DualSideSubmodes.B_SIDE,
+ tc_queue=tc_queue,
+ info="Switching to ACS board assembly B side",
+ )
+ if op_code in AcsOpCodes.ACS_ASS_DUAL_MODE:
+ command_assembly(
+ object_id=ACS_BOARD_ASS_ID,
+ mode=Modes.NORMAL,
+ submode=DualSideSubmodes.DUAL_SIDE,
+ tc_queue=tc_queue,
+ info="Switching to ACS board assembly dual mode",
+ )
+ if op_code in AcsOpCodes.ACS_ASS_A_ON:
+ command_assembly(
+ object_id=ACS_BOARD_ASS_ID,
+ mode=Modes.ON,
+ submode=DualSideSubmodes.A_SIDE,
+ tc_queue=tc_queue,
+ info="Switching ACS board assembly A side on",
+ )
+ if op_code in AcsOpCodes.ACS_ASS_B_ON:
+ command_assembly(
+ object_id=ACS_BOARD_ASS_ID,
+ mode=Modes.ON,
+ submode=DualSideSubmodes.B_SIDE,
+ tc_queue=tc_queue,
+ info="Switching ACS board assembly B side on",
+ )
+ if op_code in AcsOpCodes.ACS_ASS_DUAL_ON:
+ command_assembly(
+ object_id=ACS_BOARD_ASS_ID,
+ mode=Modes.ON,
+ submode=DualSideSubmodes.B_SIDE,
+ tc_queue=tc_queue,
+ info="Switching ACS board assembly dual side on",
+ )
+ if op_code in AcsOpCodes.ACS_ASS_OFF:
+ command_assembly(
+ object_id=ACS_BOARD_ASS_ID,
+ mode=Modes.OFF,
+ submode=0,
+ tc_queue=tc_queue,
+ info="Switching to ACS board assembly off",
+ )
+
+
+def pack_sus_cmds(tc_queue: TcQueueT, op_code: str):
+ if op_code in SusOpCodes.SUS_ASS_NOM_SIDE:
+ command_assembly(
+ object_id=SUS_BOARD_ASS_ID,
+ mode=Modes.NORMAL,
+ submode=DualSideSubmodes.A_SIDE,
+ tc_queue=tc_queue,
+ info="Switching to SUS board to nominal side",
+ )
+ if op_code in SusOpCodes.SUS_ASS_RED_SIDE:
+ command_assembly(
+ object_id=SUS_BOARD_ASS_ID,
+ mode=Modes.NORMAL,
+ submode=DualSideSubmodes.B_SIDE,
+ tc_queue=tc_queue,
+ info="Switching to SUS board to redundant side",
+ )
+ if op_code in SusOpCodes.SUS_ASS_OFF:
+ command_assembly(
+ object_id=SUS_BOARD_ASS_ID,
+ mode=Modes.OFF,
+ submode=0,
+ tc_queue=tc_queue,
+ info="Switching SUS board off",
+ )
+ if op_code in SusOpCodes.SUS_ASS_DUAL_MODE:
+ command_assembly(
+ object_id=SUS_BOARD_ASS_ID,
+ mode=Modes.NORMAL,
+ submode=DualSideSubmodes.DUAL_SIDE,
+ tc_queue=tc_queue,
+ info="Switching to SUS board to dual side",
+ )
diff --git a/pus_tc/system/common.py b/pus_tc/system/common.py
new file mode 100644
index 0000000..a37412a
--- /dev/null
+++ b/pus_tc/system/common.py
@@ -0,0 +1,18 @@
+from tmtccmd.tc.definitions import TcQueueT, QueueCommands
+from spacepackets.ecss.tc import PusTelecommand
+from tmtccmd.tc.service_200_mode import pack_mode_data, Modes, Subservices
+
+
+def command_assembly(
+ object_id: bytes, mode: Modes, submode: int, tc_queue: TcQueueT, info: str
+):
+ tc_queue.appendleft((QueueCommands.PRINT, info))
+ mode_data = pack_mode_data(
+ object_id=object_id,
+ mode=mode,
+ submode=submode,
+ )
+ cmd = PusTelecommand(
+ service=200, subservice=Subservices.COMMAND_MODE_COMMAND, app_data=mode_data
+ )
+ tc_queue.appendleft(cmd.pack_command_tuple())
diff --git a/pus_tc/system/core.py b/pus_tc/system/core.py
new file mode 100644
index 0000000..132ab8a
--- /dev/null
+++ b/pus_tc/system/core.py
@@ -0,0 +1,199 @@
+import enum
+
+from tmtccmd.config.definitions import QueueCommands
+from tmtccmd.tc.definitions import TcQueueT
+from tmtccmd.tc.service_8_functional_cmd import generate_action_command
+from tmtccmd.logging import get_console_logger
+from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command
+from config.object_ids import CORE_CONTROLLER_ID
+
+LOGGER = get_console_logger()
+
+
+class ActionIds(enum.IntEnum):
+ LIST_DIR_INTO_FILE = 0
+ SWITCH_REBOOT_FILE_HANDLING = 5
+ RESET_ALL_REBOOT_COUNTERS = 6
+ RESET_REBOOT_COUNTER_00 = 7
+ RESET_REBOOT_COUNTER_01 = 8
+ RESET_REBOOT_COUNTER_10 = 9
+ RESET_REBOOT_COUNTER_11 = 10
+ SET_MAX_REBOOT_CNT = 11
+ REBOOT = 32
+
+
+class SetIds(enum.IntEnum):
+ HK = 5
+
+
+class OpCodes:
+ REBOOT = ["0", "reboot"]
+ REBOOT_SELF = ["1", "reboot_self"]
+ REBOOT_0_0 = ["2", "reboot_0_0"]
+ REBOOT_0_1 = ["3", "reboot_0_1"]
+ REBOOT_1_0 = ["4", "reboot_1_0"]
+ REBOOT_1_1 = ["5", "reboot_1_1"]
+ ENABLE_REBOOT_FILE_HANDLING = ["6", "rbh-off"]
+ DISABLE_REBOOT_FILE_HANDLING = ["7", "rbh-on"]
+ RESET_ALL_REBOOT_COUNTERS = ["8", "rbh-reset-a"]
+ RESET_REBOOT_COUNTER_00 = ["9", "rbh-reset-00"]
+ RESET_REBOOT_COUNTER_01 = ["10", "rbh-reset-01"]
+ RESET_REBOOT_COUNTER_10 = ["11", "rbh-reset-10"]
+ RESET_REBOOT_COUNTER_11 = ["12", "rbh-reset-11"]
+ SET_MAX_REBOOT_CNT = ["13", "rbh-max-cnt"]
+ GET_HK = ["14", "get-hk"]
+
+
+class Chip(enum.IntEnum):
+ CHIP_0 = 0
+ CHIP_1 = 1
+ NONE = 2
+
+
+class Copy(enum.IntEnum):
+ COPY_0_NOM = 0
+ COPY_1_GOLD = 1
+ NONE = 2
+
+
+def pack_core_commands(tc_queue: TcQueueT, op_code: str):
+ if op_code in OpCodes.REBOOT:
+ reboot_self, chip_select, copy_select = determine_reboot_params()
+ perform_reboot_cmd(
+ tc_queue=tc_queue,
+ reboot_self=reboot_self,
+ chip=chip_select,
+ copy=copy_select,
+ )
+ elif op_code in OpCodes.REBOOT_SELF:
+ perform_reboot_cmd(tc_queue=tc_queue, reboot_self=True)
+ elif op_code in OpCodes.REBOOT_0_0:
+ perform_reboot_cmd(
+ tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_0, copy=Copy.COPY_0_NOM
+ )
+ elif op_code in OpCodes.REBOOT_0_1:
+ perform_reboot_cmd(
+ tc_queue=tc_queue,
+ reboot_self=False,
+ chip=Chip.CHIP_0,
+ copy=Copy.COPY_1_GOLD,
+ )
+ elif op_code in OpCodes.REBOOT_1_0:
+ perform_reboot_cmd(
+ tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_1, copy=Copy.COPY_0_NOM
+ )
+ elif op_code in OpCodes.REBOOT_1_1:
+ perform_reboot_cmd(
+ tc_queue=tc_queue,
+ reboot_self=False,
+ chip=Chip.CHIP_1,
+ copy=Copy.COPY_1_GOLD,
+ )
+ elif op_code in OpCodes.DISABLE_REBOOT_FILE_HANDLING:
+ tc_queue.appendleft((QueueCommands.PRINT, "Disabling reboot file handling"))
+ app_data = bytearray([0])
+ generate_action_command(
+ object_id=CORE_CONTROLLER_ID,
+ action_id=ActionIds.SWITCH_REBOOT_FILE_HANDLING,
+ app_data=app_data,
+ )
+ elif op_code in OpCodes.ENABLE_REBOOT_FILE_HANDLING:
+ tc_queue.appendleft((QueueCommands.PRINT, "Enabling reboot file handling"))
+ app_data = bytearray([1])
+ generate_action_command(
+ object_id=CORE_CONTROLLER_ID,
+ action_id=ActionIds.SWITCH_REBOOT_FILE_HANDLING,
+ app_data=app_data,
+ )
+ elif op_code in OpCodes.RESET_ALL_REBOOT_COUNTERS:
+ tc_queue.appendleft((QueueCommands.PRINT, "Resetting all reboot counters"))
+ generate_action_command(
+ object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_ALL_REBOOT_COUNTERS
+ )
+ elif op_code in OpCodes.RESET_REBOOT_COUNTER_00:
+ tc_queue.appendleft((QueueCommands.PRINT, "Resetting reboot counter 0 0"))
+ generate_action_command(
+ object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_00
+ )
+ elif op_code in OpCodes.RESET_REBOOT_COUNTER_01:
+ tc_queue.appendleft((QueueCommands.PRINT, "Resetting reboot counter 0 1"))
+ generate_action_command(
+ object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_01
+ )
+ elif op_code in OpCodes.RESET_REBOOT_COUNTER_10:
+ tc_queue.appendleft((QueueCommands.PRINT, "Resetting reboot counter 1 0"))
+ generate_action_command(
+ object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_10
+ )
+ elif op_code in OpCodes.RESET_REBOOT_COUNTER_11:
+ tc_queue.appendleft((QueueCommands.PRINT, "Resetting reboot counter 1 1"))
+ generate_action_command(
+ object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_11
+ )
+ elif op_code in OpCodes.GET_HK:
+ tc_queue.appendleft((QueueCommands.PRINT, "Requesting housekeeping set"))
+ sid = make_sid(object_id=CORE_CONTROLLER_ID, set_id=SetIds.HK)
+ command = generate_one_hk_command(sid, 201)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+
+def determine_reboot_params() -> (bool, Chip, Copy):
+ chip_select = -1
+ copy_select = -1
+ reboot_self = input("Reboot self? [y/n]: ")
+ if reboot_self in ["y", "yes", "1"]:
+ LOGGER.info("Rebooting currently running image")
+ return True, chip_select, copy_select
+ LOGGER.info("Rebooting image specified by chip and copy")
+ while True:
+ chip_select = input("Chip select [0/1]: ")
+ if chip_select in ["0", "1"]:
+ if chip_select == "0":
+ chip_select = Chip.CHIP_0
+ else:
+ chip_select = Chip.CHIP_1
+ break
+ else:
+ LOGGER.warning("Invalid chip select value. Try again")
+ while True:
+ copy_select = input("Copy select [0/1]: ")
+ if copy_select in ["0", "1"]:
+ if copy_select == "0":
+ copy_select = Copy.COPY_0_NOM
+ else:
+ copy_select = Copy.COPY_1_GOLD
+ break
+ else:
+ LOGGER.warning("Invalid copy select value. Try again")
+ return False, chip_select, copy_select
+
+
+def perform_reboot_cmd(
+ tc_queue: TcQueueT,
+ reboot_self: bool,
+ chip: Chip = Chip.NONE,
+ copy: Copy = Copy.NONE,
+):
+ tc_data = bytearray()
+ if reboot_self:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "Packing reboot command for current image")
+ )
+ tc_data.append(True)
+ else:
+ tc_data.append(False)
+ tc_data.append(chip)
+ tc_data.append(copy)
+ tc_queue.append(
+ (
+ QueueCommands.PRINT,
+ f"Packing reboot command for chip {chip} and copy {copy}",
+ )
+ )
+ action_cmd = generate_action_command(
+ object_id=CORE_CONTROLLER_ID,
+ action_id=ActionIds.REBOOT,
+ app_data=tc_data,
+ ssc=0,
+ )
+ tc_queue.appendleft(action_cmd.pack_command_tuple())
diff --git a/pus_tc/system/tcs.py b/pus_tc/system/tcs.py
new file mode 100644
index 0000000..fda1a76
--- /dev/null
+++ b/pus_tc/system/tcs.py
@@ -0,0 +1,34 @@
+from tmtccmd.tc.definitions import TcQueueT, QueueCommands
+from tmtccmd.tc.service_200_mode import Modes
+
+from .common import command_assembly
+from config.object_ids import TCS_BOARD_ASS_ID
+
+
+class OpCodes:
+ TCS_BOARD_ASS_NORMAL = ["0", "tcs-normal"]
+ TCS_BOARD_ASS_OFF = ["1", "tcs-off"]
+
+
+class Info:
+ TCS_BOARD_ASS_NORMAL = "Switching TCS board assembly on"
+ TCS_BOARD_ASS_OFF = "Switching TCS board assembly off"
+
+
+def pack_tcs_sys_commands(tc_queue: TcQueueT, op_code: str):
+ if op_code in OpCodes.TCS_BOARD_ASS_NORMAL:
+ command_assembly(
+ object_id=TCS_BOARD_ASS_ID,
+ mode=Modes.NORMAL,
+ submode=0,
+ tc_queue=tc_queue,
+ info=Info.TCS_BOARD_ASS_NORMAL,
+ )
+ if op_code in OpCodes.TCS_BOARD_ASS_OFF:
+ command_assembly(
+ object_id=TCS_BOARD_ASS_ID,
+ mode=Modes.OFF,
+ submode=0,
+ tc_queue=tc_queue,
+ info=Info.TCS_BOARD_ASS_OFF,
+ )
diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py
index 322c1b5..c53c6bb 100644
--- a/pus_tc/tc_packer_hook.py
+++ b/pus_tc/tc_packer_hook.py
@@ -1,105 +1,235 @@
+"""Hook function which packs telecommands based on service and operation code string
"""
-@brief This file transfers control of TC packing to the user
-@details Template configuration file. Copy this folder to the TMTC commander root and adapt
- it to your needs.
-"""
-
+import logging
import os
from collections import deque
from typing import Union
+from spacepackets.ecss import PusTelecommand
+from tmtccmd.com_if.com_interface_base import CommunicationInterface
from tmtccmd.config.definitions import CoreServiceList
-from tmtccmd.utility.logger import get_console_logger
+from tmtccmd.logging import get_console_logger
+from tmtccmd.logging.pus import log_raw_pus_tc
from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.tc.service_5_event import pack_generic_service5_test_into
-from tmtccmd.tc.service_17_test import pack_service17_ping_command
+from tmtccmd.pus.service_17_test import pack_service_17_ping_command
+from tmtccmd.logging import get_current_time_string
from pus_tc.service_200_mode import pack_service200_test_into
-from pus_tc.p60dock import pack_p60dock_test_into
-from pus_tc.pdu2 import pack_pdu2_test_into
-from pus_tc.pdu1 import pack_pdu1_test_into
-from pus_tc.acu import pack_acu_test_into
-from pus_tc.imtq import pack_imtq_test_into
-from pus_tc.tmp1075 import pack_tmp1075_test_into
-from pus_tc.ploc_mpsoc import pack_ploc_mpsoc_test_into
-from pus_tc.ploc_supervisor import pack_ploc_supv_test_into
-from pus_tc.heater import pack_heater_test_into
-from pus_tc.reaction_wheels import pack_single_rw_test_into
-from pus_tc.rad_sensor import pack_rad_sensor_test_into
-from pus_tc.ploc_upater import pack_ploc_updater_test_into
-from pus_tc.core import pack_core_commands
+from pus_tc.devs.p60dock import pack_p60dock_test_into
+from pus_tc.devs.pdu2 import pack_pdu2_commands
+from pus_tc.devs.pdu1 import pack_pdu1_commands
+from pus_tc.devs.bpx_batt import pack_bpx_commands
+from pus_tc.devs.acu import pack_acu_test_into
+from pus_tc.devs.solar_array_deployment import pack_solar_array_deployment_test_into
+from pus_tc.devs.imtq import pack_imtq_test_into
+from pus_tc.devs.tmp1075 import pack_tmp1075_test_into
+from pus_tc.devs.ploc_mpsoc import pack_ploc_mpsoc_commands
+from pus_tc.devs.ploc_supervisor import pack_ploc_supv_commands
+from pus_tc.devs.heater import pack_heater_test_into
+from pus_tc.devs.reaction_wheels import pack_single_rw_test_into
+from pus_tc.devs.rad_sensor import pack_rad_sensor_test_into
+from pus_tc.devs.ploc_upater import pack_ploc_updater_test_into
+from pus_tc.devs.ploc_memory_dumper import pack_ploc_memory_dumper_cmd
+from pus_tc.devs.ccsds_handler import pack_ccsds_handler_test
+from pus_tc.system.core import pack_core_commands
+from pus_tc.devs.star_tracker import pack_star_tracker_commands
+from pus_tc.devs.syrlinks_hk_handler import pack_syrlinks_command
+from pus_tc.devs.gps import pack_gps_command
+from pus_tc.system.acs import pack_acs_command, pack_sus_cmds
+from pus_tc.devs.plpcdu import pack_pl_pcdu_commands
+from pus_tc.devs.str_img_helper import pack_str_img_helper_command
+from pus_tc.system.tcs import pack_tcs_sys_commands
from config.definitions import CustomServiceList
-from config.object_ids import P60_DOCK_HANDLER, PDU_1_HANDLER_ID, PDU_2_HANDLER_ID, ACU_HANDLER_ID, \
- TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, PLOC_MPSOC_ID, RW1_ID, RW2_ID, RW3_ID, RW4_ID, \
- RAD_SENSOR_ID, PLOC_SUPV_ID, PLOC_UPDATER_ID
+from config.object_ids import (
+ P60_DOCK_HANDLER,
+ PDU_1_HANDLER_ID,
+ PDU_2_HANDLER_ID,
+ ACU_HANDLER_ID,
+ TMP_1075_1_HANDLER_ID,
+ TMP_1075_2_HANDLER_ID,
+ HEATER_ID,
+ IMTQ_HANDLER_ID,
+ PLOC_MPSOC_ID,
+ RW1_ID,
+ RW2_ID,
+ RW3_ID,
+ RW4_ID,
+ RAD_SENSOR_ID,
+ PLOC_SUPV_ID,
+ PLOC_UPDATER_ID,
+ STAR_TRACKER_ID,
+ PLOC_MEMORY_DUMPER_ID,
+ GPS_HANDLER_0_ID,
+ GPS_HANDLER_1_ID,
+ CCSDS_HANDLER_ID,
+ PDEC_HANDLER_ID,
+ STR_IMG_HELPER_ID,
+ SYRLINKS_HANDLER_ID,
+ SOLAR_ARRAY_DEPLOYMENT_ID,
+)
LOGGER = get_console_logger()
-def pack_service_queue_user(service: Union[str, int], op_code: str, service_queue: TcQueueT):
+def pre_tc_send_cb(
+ packet: bytes,
+ com_if: CommunicationInterface,
+ pus_info: Union[PusTelecommand, any],
+ file_logger: logging.Logger,
+):
+ log_raw_pus_tc(
+ packet=packet, srv_subservice=(pus_info.service, pus_info.subservice)
+ )
+ tc_info_string = f"Sent {pus_info}"
+ LOGGER.info(tc_info_string)
+ file_logger.info(f"{get_current_time_string(True)}: {tc_info_string}")
+ com_if.send(data=packet)
+
+
+def pack_service_queue_user(
+ service: Union[str, int], op_code: str, service_queue: TcQueueT
+):
if service == CoreServiceList.SERVICE_5.value:
return pack_generic_service5_test_into(tc_queue=service_queue)
if service == CoreServiceList.SERVICE_17.value:
- return service_queue.appendleft(pack_service17_ping_command(ssc=1700).pack_command_tuple())
+ return service_queue.appendleft(
+ pack_service_17_ping_command(ssc=1700).pack_command_tuple()
+ )
if service == CoreServiceList.SERVICE_200.value:
return pack_service200_test_into(tc_queue=service_queue)
if service == CustomServiceList.P60DOCK.value:
object_id = P60_DOCK_HANDLER
- return pack_p60dock_test_into(object_id=object_id, tc_queue=service_queue)
+ return pack_p60dock_test_into(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
if service == CustomServiceList.PDU1.value:
- pdu1_object_id = PDU_1_HANDLER_ID
- p60dock_object_id = P60_DOCK_HANDLER
- return pack_pdu1_test_into(
- pdu1_object_id=pdu1_object_id, p60dock_object_id=p60dock_object_id, tc_queue=service_queue
+ object_id = PDU_1_HANDLER_ID
+ return pack_pdu1_commands(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
)
if service == CustomServiceList.PDU2.value:
- pdu2_object_id = PDU_2_HANDLER_ID
- p60dock_object_id = P60_DOCK_HANDLER
- return pack_pdu2_test_into(
- pdu2_object_id=pdu2_object_id, p60dock_object_id=p60dock_object_id, tc_queue=service_queue
+ object_id = PDU_2_HANDLER_ID
+ return pack_pdu2_commands(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
)
if service == CustomServiceList.ACU.value:
object_id = ACU_HANDLER_ID
- return pack_acu_test_into(object_id=object_id, tc_queue=service_queue)
+ return pack_acu_test_into(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
+ if service == CustomServiceList.BPX_BATTERY.value:
+ return pack_bpx_commands(tc_queue=service_queue, op_code=op_code)
if service == CustomServiceList.TMP1075_1.value:
object_id = TMP_1075_1_HANDLER_ID
- return pack_tmp1075_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ return pack_tmp1075_test_into(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
if service == CustomServiceList.TMP1075_2.value:
object_id = TMP_1075_2_HANDLER_ID
- return pack_tmp1075_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ return pack_tmp1075_test_into(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
if service == CustomServiceList.HEATER.value:
object_id = HEATER_ID
return pack_heater_test_into(object_id=object_id, tc_queue=service_queue)
if service == CustomServiceList.IMTQ.value:
object_id = IMTQ_HANDLER_ID
- return pack_imtq_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
- if service == CustomServiceList.PLOC.value:
+ return pack_imtq_test_into(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
+ if service == CustomServiceList.PLOC_MPSOC.value:
object_id = PLOC_MPSOC_ID
- return pack_ploc_mpsoc_test_into(object_id=object_id, tc_queue=service_queue)
+ return pack_ploc_mpsoc_commands(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
if service == CustomServiceList.REACTION_WHEEL_1.value:
object_id = RW1_ID
- return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ return pack_single_rw_test_into(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
if service == CustomServiceList.REACTION_WHEEL_2.value:
object_id = RW2_ID
- return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ return pack_single_rw_test_into(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
if service == CustomServiceList.REACTION_WHEEL_3.value:
object_id = RW3_ID
- return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ return pack_single_rw_test_into(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
if service == CustomServiceList.REACTION_WHEEL_4.value:
object_id = RW4_ID
- return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ return pack_single_rw_test_into(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
if service == CustomServiceList.RAD_SENSOR.value:
object_id = RAD_SENSOR_ID
- return pack_rad_sensor_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ return pack_rad_sensor_test_into(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
if service == CustomServiceList.PLOC_SUPV.value:
object_id = PLOC_SUPV_ID
- return pack_ploc_supv_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ return pack_ploc_supv_commands(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
if service == CustomServiceList.PLOC_UPDATER.value:
object_id = PLOC_UPDATER_ID
- return pack_ploc_updater_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ return pack_ploc_updater_test_into(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
+ if service == CustomServiceList.STAR_TRACKER.value:
+ object_id = STAR_TRACKER_ID
+ return pack_star_tracker_commands(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
+ if service == CustomServiceList.STR_IMG_HELPER.value:
+ object_id = STR_IMG_HELPER_ID
+ return pack_str_img_helper_command(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
if service == CustomServiceList.CORE.value:
return pack_core_commands(tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.PLOC_MEMORY_DUMPER.value:
+ object_id = PLOC_MEMORY_DUMPER_ID
+ return pack_ploc_memory_dumper_cmd(
+ object_id=object_id, tc_queue=service_queue, op_code=op_code
+ )
+ if service == CustomServiceList.ACS.value:
+ return pack_acs_command(tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.GPS_0.value:
+ return pack_gps_command(
+ object_id=GPS_HANDLER_0_ID, tc_queue=service_queue, op_code=op_code
+ )
+ if service == CustomServiceList.GPS_1.value:
+ return pack_gps_command(
+ object_id=GPS_HANDLER_1_ID, tc_queue=service_queue, op_code=op_code
+ )
+ if service == CustomServiceList.CCSDS_HANDLER.value:
+ return pack_ccsds_handler_test(
+ object_id=CCSDS_HANDLER_ID, tc_queue=service_queue, op_code=op_code
+ )
+ if service == CustomServiceList.PDEC_HANDLER.value:
+ return pack_ccsds_handler_test(
+ object_id=PDEC_HANDLER_ID, tc_queue=service_queue, op_code=op_code
+ )
+ if service == CustomServiceList.SYRLINKS.value:
+ return pack_syrlinks_command(
+ object_id=SYRLINKS_HANDLER_ID, tc_queue=service_queue, op_code=op_code
+ )
+ if service == CustomServiceList.SA_DEPLYOMENT.value:
+ return pack_solar_array_deployment_test_into(
+ object_id=SOLAR_ARRAY_DEPLOYMENT_ID, tc_queue=service_queue
+ )
+ if service == CustomServiceList.SUS_ASS.value:
+ return pack_sus_cmds(tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.PL_PCDU.value:
+ return pack_pl_pcdu_commands(tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.ACS_ASS.value:
+ return pack_acs_command(tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.TCS_ASS.value:
+ return pack_tcs_sys_commands(tc_queue=service_queue, op_code=op_code)
LOGGER.warning("Invalid Service !")
@@ -108,5 +238,5 @@ def create_total_tc_queue_user() -> TcQueueT:
os.mkdir("log")
tc_queue = deque()
pack_generic_service5_test_into(tc_queue)
- tc_queue.appendleft(pack_service17_ping_command(ssc=1700).pack_command_tuple())
+ tc_queue.appendleft(pack_service_17_ping_command(ssc=1700).pack_command_tuple())
return tc_queue
diff --git a/pus_tm/action_reply_handler.py b/pus_tm/action_reply_handler.py
new file mode 100644
index 0000000..cee50e1
--- /dev/null
+++ b/pus_tm/action_reply_handler.py
@@ -0,0 +1,107 @@
+import struct
+from config.object_ids import *
+from pus_tc.devs.imtq import ImtqActionIds
+from pus_tc.devs.ploc_mpsoc import PlocReplyIds
+from pus_tc.devs.ploc_supervisor import SupvActionIds
+from pus_tc.devs.star_tracker import StarTrackerActionIds
+from tmtccmd.logging import get_console_logger
+from tmtccmd.config.definitions import DataReplyUnpacked
+from tmtccmd.tm import Service8FsfwTm
+from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+
+LOGGER = get_console_logger()
+
+
+def handle_action_reply(
+ raw_tm: bytes, printer: FsfwTmTcPrinter, obj_id_dict: ObjectIdDictT
+):
+ """Core Action reply handler
+ :return:
+ """
+ tm_packet = Service8FsfwTm.unpack(raw_telemetry=raw_tm)
+ printer.handle_long_tm_print(packet_if=tm_packet, info_if=tm_packet)
+ object_id = obj_id_dict.get(tm_packet.source_object_id)
+ custom_data = tm_packet.custom_data
+ action_id = tm_packet.action_id
+ generic_print_str = printer.generic_action_packet_tm_print(
+ packet=tm_packet, obj_id=object_id
+ )
+ print(generic_print_str)
+ printer.file_logger.info(generic_print_str)
+ if object_id == IMTQ_HANDLER_ID:
+ return handle_imtq_replies(action_id, printer, custom_data)
+ elif object_id == PLOC_MPSOC_ID:
+ return handle_ploc_replies(action_id, printer, custom_data)
+ elif object_id == PLOC_SUPV_ID:
+ return handle_supervisor_replies(action_id, printer, custom_data)
+ elif object_id == STAR_TRACKER_ID:
+ return handle_startracker_replies(action_id, printer, custom_data)
+
+
+def handle_imtq_replies(
+ action_id: int, printer: FsfwTmTcPrinter, custom_data: bytearray
+):
+ if action_id == struct.unpack("!I", ImtqActionIds.get_commanded_dipole)[0]:
+ header_list = [
+ "Commanded X-Dipole",
+ "Commanded Y-Dipole",
+ "Commanded Z-Dipole",
+ ]
+ [x_dipole, y_dipole, z_dipole] = struct.unpack("!HHH", custom_data[0:6])
+ content_list = [x_dipole, y_dipole, z_dipole]
+ print(header_list)
+ print(content_list)
+ printer.file_logger.info(header_list)
+ printer.file_logger.info(content_list)
+
+
+def handle_ploc_replies(
+ action_id: int, printer: FsfwTmTcPrinter, custom_data: bytearray
+):
+ if action_id == PlocReplyIds.tm_mem_read_report:
+ header_list = [
+ "PLOC Memory Address",
+ "PLOC Mem Len",
+ "PLOC Read Memory Data",
+ ]
+ content_list = [
+ "0x" + custom_data[:4].hex(),
+ struct.unpack("!H", custom_data[4:6])[0],
+ "0x" + custom_data[6:10].hex(),
+ ]
+ print(header_list)
+ print(content_list)
+ printer.file_logger.info(header_list)
+ printer.file_logger.info(content_list)
+
+
+def handle_supervisor_replies(
+ action_id: int, printer: FsfwTmTcPrinter, custom_data: bytearray
+):
+ reply = DataReplyUnpacked()
+ if action_id == SupvActionIds.DUMP_MRAM:
+ header_list = ["MRAM Dump"]
+ content_list = [custom_data[: len(custom_data)]]
+ print(header_list)
+ print(content_list)
+ printer.file_logger.info(header_list)
+ printer.file_logger.info(content_list)
+
+
+def handle_startracker_replies(
+ action_id: int, printer: FsfwTmTcPrinter, custom_data: bytearray
+):
+ if action_id == StarTrackerActionIds.CHECKSUM:
+ if len(custom_data) != 5:
+ LOGGER.warning(
+ "Star tracker reply has invalid length {0}".format(len(custom_data))
+ )
+ return
+ header_list = ["Checksum", "Checksum valid"]
+ print(custom_data[4])
+ checksum_valid_flag = custom_data[4] >> 8
+ content_list = ["0x" + custom_data[:4].hex(), checksum_valid_flag]
+ print(header_list)
+ print(content_list)
+ printer.file_logger.info(header_list)
+ printer.file_logger.info(content_list)
diff --git a/pus_tm/event_handler.py b/pus_tm/event_handler.py
new file mode 100644
index 0000000..9d0426d
--- /dev/null
+++ b/pus_tm/event_handler.py
@@ -0,0 +1,61 @@
+import logging
+import os.path
+from datetime import datetime
+from config.object_ids import get_object_ids
+
+from tmtccmd.tm import Service5Tm
+from tmtccmd.logging import get_console_logger
+from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.fsfw import parse_fsfw_events_csv, EventDictT, EventInfo
+
+
+LOGGER = get_console_logger()
+DEFAULT_EVENTS_CSV_PATH = "config/events.csv"
+__EVENT_DICT = None
+
+
+def get_event_dict() -> EventDictT:
+ global __EVENT_DICT
+ if __EVENT_DICT is None:
+ if os.path.exists(DEFAULT_EVENTS_CSV_PATH):
+ __EVENT_DICT = parse_fsfw_events_csv(DEFAULT_EVENTS_CSV_PATH)
+ else:
+ LOGGER.warning(f"No Event CSV file found at {DEFAULT_EVENTS_CSV_PATH}")
+ __EVENT_DICT = dict()
+ return __EVENT_DICT
+
+
+def handle_event_packet(
+ raw_tm: bytes, printer: FsfwTmTcPrinter, file_logger: logging.Logger
+) -> str:
+ tm = Service5Tm.unpack(raw_telemetry=raw_tm)
+ printer.handle_long_tm_print(packet_if=tm, info_if=tm)
+ additional_event_info = ""
+ event_dict = get_event_dict()
+ info = event_dict.get(tm.event_id)
+ if info is None:
+ LOGGER.warning(f"Event ID {tm.event_id} has no information")
+ info = EventInfo()
+ info.name = "Unknown event"
+ obj_ids = get_object_ids()
+ obj_id_obj = obj_ids.get(tm.reporter_id.as_bytes)
+ if obj_id_obj is None:
+ LOGGER.warning(f"Object ID 0x{tm.reporter_id.as_string} has no name")
+ obj_name = tm.reporter_id.as_string
+ else:
+ obj_name = obj_id_obj.name
+ generic_event_string = (
+ f"Object {obj_name} generated Event {tm.event_id} | {info.name}"
+ )
+ if info.info != "":
+ additional_event_info = (
+ f"Additional info: {info.info} | P1: {tm.param_1} | P2: {tm.param_2}"
+ )
+ file_logger.info(
+ f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}: {generic_event_string}"
+ )
+ LOGGER.info(generic_event_string)
+ if additional_event_info != "":
+ file_logger.info(additional_event_info)
+ print(additional_event_info)
+ return generic_event_string + " | " + additional_event_info
diff --git a/pus_tm/factory_hook.py b/pus_tm/factory_hook.py
index 559b212..b5a318a 100644
--- a/pus_tm/factory_hook.py
+++ b/pus_tm/factory_hook.py
@@ -1,42 +1,80 @@
+"""Core EIVE TM handler module
"""
-@brief This file transfers control of TM parsing to the user
-@details Template configuration file. Copy this folder to the TMTC commander root and adapt
- it to your needs.
-"""
-from tmtccmd.tm.service_8_functional_cmd import Service8TM
-from tmtccmd.ecss.tm import PusTelemetry
-from tmtccmd.utility.logger import get_console_logger
+from spacepackets.ecss.tm import PusTelemetry
+from tmtccmd.logging import get_console_logger
+from tmtccmd.logging.pus import (
+ log_raw_pus_tm,
+ log_raw_unknown_packet,
+ PacketTypes,
+ create_tmtc_logger,
+)
-from tmtccmd.tm.service_1_verification import Service1TM
-from tmtccmd.tm.service_3_housekeeping import Service3TM
-from tmtccmd.tm.service_5_event import Service5TM
-from tmtccmd.tm.service_17_test import Service17TM
-from tmtccmd.utility.tmtc_printer import TmTcPrinter
+from tmtccmd.pus.service_17_test import Service17TMExtended
+from tmtccmd.tm.service_20_fsfw_parameters import Service20FsfwTm
+from tmtccmd.tm.service_200_fsfw_mode import Service200FsfwTm
+from tmtccmd.utility.tmtc_printer import PrintFormats, FsfwTmTcPrinter
from config.definitions import PUS_APID
+from config.object_ids import get_object_ids
+
+from .event_handler import handle_event_packet
+from .verification_handler import handle_service_1_packet
+from .hk_handling import handle_hk_packet
+from .action_reply_handler import handle_action_reply
LOGGER = get_console_logger()
-def ccsds_tm_handler(apid: int, raw_tm_packet: bytearray, tmtc_printer: TmTcPrinter) -> None:
+FSFW_PRINTER = FsfwTmTcPrinter(file_logger=create_tmtc_logger())
+
+
+def ccsds_tm_handler(apid: int, raw_tm_packet: bytes, _user_args: any) -> None:
if apid == PUS_APID:
- pus_factory_hook(raw_tm_packet=raw_tm_packet, tmtc_printer=tmtc_printer)
+ pus_factory_hook(raw_tm_packet=raw_tm_packet)
-def pus_factory_hook(raw_tm_packet: bytearray, tmtc_printer: TmTcPrinter):
+def pus_factory_hook(raw_tm_packet: bytes):
+ if len(raw_tm_packet) < 8:
+ LOGGER.warning("Detected packet shorter than 8 bytes!")
+ return
service_type = raw_tm_packet[7]
- tm_packet = None
- if service_type == 1:
- tm_packet = Service1TM(raw_tm_packet)
- if service_type == 3:
- tm_packet = Service3TM(raw_tm_packet)
- if service_type == 5:
- tm_packet = Service5TM(raw_tm_packet)
- if service_type == 8:
- tm_packet = Service8TM(raw_tm_packet)
- if service_type == 17:
- tm_packet = Service17TM(raw_tm_packet)
- if tm_packet is None:
- LOGGER.info(f'The service {service_type} is not implemented in Telemetry Factory')
- tm_packet = PusTelemetry(raw_tm_packet)
- tmtc_printer.print_telemetry(packet=tm_packet)
+ subservice_type = raw_tm_packet[8]
+ file_logger = FSFW_PRINTER.file_logger
+ obj_id_dict = get_object_ids()
+ try:
+ if service_type == 1:
+ handle_service_1_packet(printer=FSFW_PRINTER, raw_tm=raw_tm_packet)
+ elif service_type == 3:
+ handle_hk_packet(
+ printer=FSFW_PRINTER, raw_tm=raw_tm_packet, obj_id_dict=obj_id_dict
+ )
+ elif service_type == 5:
+ handle_event_packet(
+ raw_tm=raw_tm_packet, printer=FSFW_PRINTER, file_logger=file_logger
+ )
+ elif service_type == 8:
+ handle_action_reply(
+ raw_tm=raw_tm_packet, printer=FSFW_PRINTER, obj_id_dict=obj_id_dict
+ )
+ elif service_type == 17:
+ tm_packet = Service17TMExtended.unpack(raw_telemetry=raw_tm_packet)
+ FSFW_PRINTER.handle_long_tm_print(packet_if=tm_packet, info_if=tm_packet)
+ elif service_type == 20:
+ tm_packet = Service20FsfwTm.unpack(raw_telemetry=raw_tm_packet)
+ FSFW_PRINTER.handle_long_tm_print(packet_if=tm_packet, info_if=tm_packet)
+ elif service_type == 200:
+ tm_packet = Service200FsfwTm.unpack(raw_telemetry=raw_tm_packet)
+ FSFW_PRINTER.handle_long_tm_print(packet_if=tm_packet, info_if=tm_packet)
+ else:
+ LOGGER.info(
+ f"The service {service_type} is not implemented in Telemetry Factory"
+ )
+ tm_packet = PusTelemetry.unpack(raw_telemetry=raw_tm_packet)
+ tm_packet.print_source_data(PrintFormats.HEX)
+ log_raw_pus_tm(
+ packet=raw_tm_packet, srv_subservice=(service_type, subservice_type)
+ )
+ except ValueError:
+ # TODO: Log faulty packet
+ LOGGER.warning("Invalid packet format detected")
+ log_raw_unknown_packet(packet=raw_tm_packet, packet_type=PacketTypes.TM)
diff --git a/pus_tm/hk_handling.py b/pus_tm/hk_handling.py
index f81a042..7fb2103 100644
--- a/pus_tm/hk_handling.py
+++ b/pus_tm/hk_handling.py
@@ -1,157 +1,563 @@
-"""
-@brief This file transfers control of housekeeping handling (PUS service 3) to the
- developer
-@details Template configuration file. Copy this folder to the TMTC commander root and adapt
- it to your needs.
-"""
+"""HK Handling for EIVE OBSW"""
import struct
-from typing import Tuple
+import os
+import datetime
+
+from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from tmtccmd.config.definitions import HkReplyUnpacked
+from tmtccmd.tm.service_3_fsfw_housekeeping import (
+ Service3Base,
+ HkContentType,
+ Service3FsfwTm,
+)
+from tmtccmd.logging import get_console_logger
+from pus_tc.devs.bpx_batt import BpxSetIds
+from pus_tc.devs.syrlinks_hk_handler import SetIds
+from pus_tc.devs.imtq import ImtqSetIds
+from tmtccmd.pus.obj_id import ObjectId, ObjectIdDictT
+from config.object_ids import (
+ SYRLINKS_HANDLER_ID,
+ IMTQ_HANDLER_ID,
+ GPS_HANDLER_0_ID,
+ GPS_HANDLER_1_ID,
+ BPX_HANDLER_ID,
+ CORE_CONTROLLER_ID,
+ P60_DOCK_HANDLER,
+ PL_PCDU_ID
+)
-from tmtccmd.tm.service_3_housekeeping import Service3Base
-from tmtccmd.utility.logger import get_console_logger
-from pus_tc.syrlinks_hk_handler import SetIds
-from pus_tc.imtq import ImtqSetIds
-from config.object_ids import SYRLINKS_HANDLER, IMTQ_HANDLER_ID
LOGGER = get_console_logger()
-def handle_user_hk_packet(object_id: bytes, set_id: int, hk_data: bytearray,
- service3_packet: Service3Base) -> Tuple[list, list, bytearray, int]:
- """
- This function is called when a Service 3 Housekeeping packet is received.
+def handle_hk_packet(
+ raw_tm: bytes,
+ obj_id_dict: ObjectIdDictT,
+ printer: FsfwTmTcPrinter,
+):
+ tm_packet = Service3FsfwTm.unpack(raw_telemetry=raw_tm, custom_hk_handling=False)
+ named_obj_id = obj_id_dict.get(tm_packet.object_id.as_bytes)
+ if named_obj_id is None:
+ named_obj_id = tm_packet.object_id
+ if tm_packet.subservice == 25 or tm_packet.subservice == 26:
+ hk_data = tm_packet.tm_data[8:]
+ printer.generic_hk_tm_print(
+ content_type=HkContentType.HK,
+ object_id=named_obj_id,
+ set_id=tm_packet.set_id,
+ hk_data=hk_data,
+ )
+ handle_regular_hk_print(
+ printer=printer,
+ object_id=named_obj_id,
+ hk_packet=tm_packet,
+ hk_data=hk_data,
+ )
+ if tm_packet.subservice == 10 or tm_packet.subservice == 12:
+ LOGGER.warning("HK definitions printout not implemented yet")
- Please note that the object IDs should be compared by value because direct comparison of
- enumerations does not work in Python. For example use:
- if object_id.value == ObjectIds.TEST_OBJECT.value
-
- to test equality based on the object ID list.
-
- @param object_id:
- @param set_id:
- @param hk_data:
- @param service3_packet:
- @return: Expects a tuple, consisting of two lists, a bytearray and an integer
- The first list contains the header columns, the second list the list with
- the corresponding values. The bytearray is the validity buffer, which is usually appended
- at the end of the housekeeping packet. The last value is the number of parameters.
- """
- if object_id == SYRLINKS_HANDLER:
+def handle_regular_hk_print(
+ printer: FsfwTmTcPrinter,
+ object_id: ObjectId,
+ hk_packet: Service3Base,
+ hk_data: bytes,
+):
+ object_id = object_id.as_bytes
+ set_id = hk_packet.set_id
+ """This function is called when a Service 3 Housekeeping packet is received."""
+ if object_id == SYRLINKS_HANDLER_ID:
if set_id == SetIds.RX_REGISTERS_DATASET:
- return handle_syrlinks_rx_registers_dataset(hk_data)
+ return handle_syrlinks_rx_registers_dataset(printer, hk_data)
elif set_id == SetIds.TX_REGISTERS_DATASET:
- return handle_syrlinks_tx_registers_dataset(hk_data)
+ return handle_syrlinks_tx_registers_dataset(printer, hk_data)
else:
- LOGGER.info("Serive 3 TM: Syrlinks handler reply with unknown set id")
- return [], [], bytearray(), 0
+ LOGGER.info("Service 3 TM: Syrlinks handler reply with unknown set id")
elif object_id == IMTQ_HANDLER_ID:
- if (set_id >= ImtqSetIds.POSITIVE_X_TEST) and (set_id <= ImtqSetIds.NEGATIVE_Z_TEST):
- return handle_self_test_data(hk_data)
+ if (set_id >= ImtqSetIds.POSITIVE_X_TEST) and (
+ set_id <= ImtqSetIds.NEGATIVE_Z_TEST
+ ):
+ return handle_self_test_data(printer, hk_data)
else:
- LOGGER.info("Serive 3 TM: Syrlinks handler reply with unknown set id")
- return [], [], bytearray(), 0
+ LOGGER.info("Service 3 TM: Syrlinks handler reply with unknown set id")
+ elif object_id == GPS_HANDLER_0_ID or object_id == GPS_HANDLER_1_ID:
+ handle_gps_data(printer=printer, hk_data=hk_data)
+ elif object_id == BPX_HANDLER_ID:
+ handle_bpx_hk_data(hk_data=hk_data, set_id=set_id, printer=printer)
+ elif object_id == CORE_CONTROLLER_ID:
+ return handle_core_hk_data(printer=printer, hk_data=hk_data)
+ elif object_id == P60_DOCK_HANDLER:
+ handle_p60_hk_data(printer=printer, hk_data=hk_data)
+ elif object_id == PL_PCDU_ID:
+ log_to_both(printer, "Received PL PCDU HK data")
else:
LOGGER.info("Service 3 TM: Parsing for this SID has not been implemented.")
- return [], [], bytearray(), 0
+ return HkReplyUnpacked()
-def handle_syrlinks_rx_registers_dataset(hk_data: bytearray) -> Tuple[list, list, bytearray, int]:
- hk_header = []
- hk_content = []
- validity_buffer = bytearray()
- hk_header = ["RX Status", "RX Sensitivity", "RX Frequency Shift", "RX IQ Power", "RX AGC Value", "RX Demod Eb",
- "RX Demod N0", "RX Datarate"]
+def handle_syrlinks_rx_registers_dataset(printer: FsfwTmTcPrinter, hk_data: bytes):
+ reply = HkReplyUnpacked()
+ header_list = [
+ "RX Status",
+ "RX Sensitivity",
+ "RX Frequency Shift",
+ "RX IQ Power",
+ "RX AGC Value",
+ "RX Demod Eb",
+ "RX Demod N0",
+ "RX Datarate",
+ ]
rx_status = hk_data[0]
- rx_sensitivity = struct.unpack('!I', hk_data[1:5])
- rx_frequency_shift = struct.unpack('!I', hk_data[5:9])
- rx_iq_power = struct.unpack('!H', hk_data[9:11])
- rx_agc_value = struct.unpack('!H', hk_data[11:13])
- rx_demod_eb = struct.unpack('!I', hk_data[13:17])
- rx_demod_n0 = struct.unpack('!I', hk_data[17:21])
+ rx_sensitivity = struct.unpack("!I", hk_data[1:5])
+ rx_frequency_shift = struct.unpack("!I", hk_data[5:9])
+ rx_iq_power = struct.unpack("!H", hk_data[9:11])
+ rx_agc_value = struct.unpack("!H", hk_data[11:13])
+ rx_demod_eb = struct.unpack("!I", hk_data[13:17])
+ rx_demod_n0 = struct.unpack("!I", hk_data[17:21])
rx_data_rate = hk_data[21]
- hk_content = [rx_status, rx_sensitivity, rx_frequency_shift, rx_iq_power, rx_agc_value, rx_demod_eb, rx_demod_n0,
- rx_data_rate]
- return hk_header, hk_content, validity_buffer, 8
+ content_list = [
+ rx_status,
+ rx_sensitivity,
+ rx_frequency_shift,
+ rx_iq_power,
+ rx_agc_value,
+ rx_demod_eb,
+ rx_demod_n0,
+ rx_data_rate,
+ ]
+ validity_buffer = hk_data[22:]
+ log_to_both(printer, str(header_list))
+ log_to_both(printer, str(content_list))
+ printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=8)
-def handle_syrlinks_tx_registers_dataset(hk_data: bytearray) -> Tuple[list, list, bytearray, int]:
- hk_header = []
- hk_content = []
- validity_buffer = bytearray()
- hk_header = ["TX Status", "TX Waveform", "TX AGC value"]
+def handle_syrlinks_tx_registers_dataset(
+ printer: FsfwTmTcPrinter,
+ hk_data: bytes,
+):
+ reply = HkReplyUnpacked()
+ header_list = ["TX Status", "TX Waveform", "TX AGC value"]
tx_status = hk_data[0]
tx_waveform = hk_data[1]
- tx_agc_value = struct.unpack('!H', hk_data[2:4])
- hk_content = [tx_status, tx_waveform, tx_agc_value]
- return hk_header, hk_content, validity_buffer, 3
+ tx_agc_value = struct.unpack("!H", hk_data[2:4])
+ content_list = [tx_status, tx_waveform, tx_agc_value]
+ validity_buffer = hk_data[4:]
+ log_to_both(printer, str(header_list))
+ log_to_both(printer, str(content_list))
+ printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=3)
-def handle_self_test_data(hk_data: bytearray) -> Tuple[list, list, bytearray, int]:
- hk_header = []
- hk_content = []
- validity_buffer = bytearray()
- hk_header = ["Init Err", "Init Raw Mag X [nT]", "Init Raw Mag Y [nT]", "Init Raw Mag Z [nT]", "Init Cal Mag X [nT]",
- "Init Cal Mag Y [nT]", "Init Cal Mag Z [nT]", "Init Coil X Current [mA]", "Init Coil Y Current [mA]",
- "Init Coil Z Current [mA]", "Init Coil X Temperature [°C]", "Init Coil Y Temperature [°C]",
- "Init Coil Z Temperature [°C]", "Err", "Raw Mag X [nT]", "Raw Mag Y [nT]", "Raw Mag Z [nT]",
- "Cal Mag X [nT]", "Cal Mag Y [nT]", "Cal Mag Z [nT]", "Coil X Current [mA]", "Coil Y Current [mA]",
- "Coil Z Current [mA]", "Coil X Temperature [°C]", "Coil Y Temperature [°C]", "Coil Z Temperature [°C]",
- "Fina Err", "Fina Raw Mag X [nT]", "Fina Raw Mag Y [nT]", "Fina Raw Mag Z [nT]", "Fina Cal Mag X [nT]",
- "Fina Cal Mag Y [nT]", "Fina Cal Mag Z [nT]", "Fina Coil X Current [mA]", "Fina Coil Y Current [mA]",
- "Fina Coil Z Current [mA]", "Fina Coil X Temperature [°C]", "Fina Coil Y Temperature [°C]",
- "Fina Coil Z Temperature [°C]"]
+def handle_self_test_data(printer: FsfwTmTcPrinter, hk_data: bytes):
+ header_list = [
+ "Init Err",
+ "Init Raw Mag X [nT]",
+ "Init Raw Mag Y [nT]",
+ "Init Raw Mag Z [nT]",
+ "Init Cal Mag X [nT]",
+ "Init Cal Mag Y [nT]",
+ "Init Cal Mag Z [nT]",
+ "Init Coil X Current [mA]",
+ "Init Coil Y Current [mA]",
+ "Init Coil Z Current [mA]",
+ "Init Coil X Temperature [°C]",
+ "Init Coil Y Temperature [°C]",
+ "Init Coil Z Temperature [°C]",
+ "Err",
+ "Raw Mag X [nT]",
+ "Raw Mag Y [nT]",
+ "Raw Mag Z [nT]",
+ "Cal Mag X [nT]",
+ "Cal Mag Y [nT]",
+ "Cal Mag Z [nT]",
+ "Coil X Current [mA]",
+ "Coil Y Current [mA]",
+ "Coil Z Current [mA]",
+ "Coil X Temperature [°C]",
+ "Coil Y Temperature [°C]",
+ "Coil Z Temperature [°C]",
+ "Fina Err",
+ "Fina Raw Mag X [nT]",
+ "Fina Raw Mag Y [nT]",
+ "Fina Raw Mag Z [nT]",
+ "Fina Cal Mag X [nT]",
+ "Fina Cal Mag Y [nT]",
+ "Fina Cal Mag Z [nT]",
+ "Fina Coil X Current [mA]",
+ "Fina Coil Y Current [mA]",
+ "Fina Coil Z Current [mA]",
+ "Fina Coil X Temperature [°C]",
+ "Fina Coil Y Temperature [°C]",
+ "Fina Coil Z Temperature [°C]",
+ ]
# INIT step (no coil actuation)
init_err = hk_data[0]
- init_raw_mag_x = struct.unpack('!f', hk_data[1:5])[0]
- init_raw_mag_y = struct.unpack('!f', hk_data[5:9])[0]
- init_raw_mag_z = struct.unpack('!f', hk_data[9:13])[0]
- init_cal_mag_x = struct.unpack('!f', hk_data[13:17])[0]
- init_cal_mag_y = struct.unpack('!f', hk_data[17:21])[0]
- init_cal_mag_z = struct.unpack('!f', hk_data[21:25])[0]
- init_coil_x_current = struct.unpack('!f', hk_data[25:29])[0]
- init_coil_y_current = struct.unpack('!f', hk_data[29:33])[0]
- init_coil_z_current = struct.unpack('!f', hk_data[33:37])[0]
- init_coil_x_temperature = struct.unpack('!H', hk_data[37:39])[0]
- init_coil_y_temperature = struct.unpack('!H', hk_data[39:41])[0]
- init_coil_z_temperature = struct.unpack('!H', hk_data[41:43])[0]
+ init_raw_mag_x = struct.unpack("!f", hk_data[1:5])[0]
+ init_raw_mag_y = struct.unpack("!f", hk_data[5:9])[0]
+ init_raw_mag_z = struct.unpack("!f", hk_data[9:13])[0]
+ init_cal_mag_x = struct.unpack("!f", hk_data[13:17])[0]
+ init_cal_mag_y = struct.unpack("!f", hk_data[17:21])[0]
+ init_cal_mag_z = struct.unpack("!f", hk_data[21:25])[0]
+ init_coil_x_current = struct.unpack("!f", hk_data[25:29])[0]
+ init_coil_y_current = struct.unpack("!f", hk_data[29:33])[0]
+ init_coil_z_current = struct.unpack("!f", hk_data[33:37])[0]
+ init_coil_x_temperature = struct.unpack("!H", hk_data[37:39])[0]
+ init_coil_y_temperature = struct.unpack("!H", hk_data[39:41])[0]
+ init_coil_z_temperature = struct.unpack("!H", hk_data[41:43])[0]
# Actuation step
err = hk_data[43]
- raw_mag_x = struct.unpack('!f', hk_data[44:48])[0]
- raw_mag_y = struct.unpack('!f', hk_data[48:52])[0]
- raw_mag_z = struct.unpack('!f', hk_data[52:56])[0]
- cal_mag_x = struct.unpack('!f', hk_data[56:60])[0]
- cal_mag_y = struct.unpack('!f', hk_data[60:64])[0]
- cal_mag_z = struct.unpack('!f', hk_data[64:68])[0]
- coil_x_current = struct.unpack('!f', hk_data[68:72])[0]
- coil_y_current = struct.unpack('!f', hk_data[72:76])[0]
- coil_z_current = struct.unpack('!f', hk_data[76:80])[0]
- coil_x_temperature = struct.unpack('!H', hk_data[80:82])[0]
- coil_y_temperature = struct.unpack('!H', hk_data[82:84])[0]
- coil_z_temperature = struct.unpack('!H', hk_data[84:86])[0]
+ raw_mag_x = struct.unpack("!f", hk_data[44:48])[0]
+ raw_mag_y = struct.unpack("!f", hk_data[48:52])[0]
+ raw_mag_z = struct.unpack("!f", hk_data[52:56])[0]
+ cal_mag_x = struct.unpack("!f", hk_data[56:60])[0]
+ cal_mag_y = struct.unpack("!f", hk_data[60:64])[0]
+ cal_mag_z = struct.unpack("!f", hk_data[64:68])[0]
+ coil_x_current = struct.unpack("!f", hk_data[68:72])[0]
+ coil_y_current = struct.unpack("!f", hk_data[72:76])[0]
+ coil_z_current = struct.unpack("!f", hk_data[76:80])[0]
+ coil_x_temperature = struct.unpack("!H", hk_data[80:82])[0]
+ coil_y_temperature = struct.unpack("!H", hk_data[82:84])[0]
+ coil_z_temperature = struct.unpack("!H", hk_data[84:86])[0]
# FINA step (no coil actuation)
fina_err = hk_data[86]
- fina_raw_mag_x = struct.unpack('!f', hk_data[87:91])[0]
- fina_raw_mag_y = struct.unpack('!f', hk_data[91:95])[0]
- fina_raw_mag_z = struct.unpack('!f', hk_data[95:99])[0]
- fina_cal_mag_x = struct.unpack('!f', hk_data[99:103])[0]
- fina_cal_mag_y = struct.unpack('!f', hk_data[103:107])[0]
- fina_cal_mag_z = struct.unpack('!f', hk_data[107:111])[0]
- fina_coil_x_current = struct.unpack('!f', hk_data[111:115])[0]
- fina_coil_y_current = struct.unpack('!f', hk_data[115:119])[0]
- fina_coil_z_current = struct.unpack('!f', hk_data[119:123])[0]
- fina_coil_x_temperature = struct.unpack('!H', hk_data[123:125])[0]
- fina_coil_y_temperature = struct.unpack('!H', hk_data[125:127])[0]
- fina_coil_z_temperature = struct.unpack('!H', hk_data[127:129])[0]
+ fina_raw_mag_x = struct.unpack("!f", hk_data[87:91])[0]
+ fina_raw_mag_y = struct.unpack("!f", hk_data[91:95])[0]
+ fina_raw_mag_z = struct.unpack("!f", hk_data[95:99])[0]
+ fina_cal_mag_x = struct.unpack("!f", hk_data[99:103])[0]
+ fina_cal_mag_y = struct.unpack("!f", hk_data[103:107])[0]
+ fina_cal_mag_z = struct.unpack("!f", hk_data[107:111])[0]
+ fina_coil_x_current = struct.unpack("!f", hk_data[111:115])[0]
+ fina_coil_y_current = struct.unpack("!f", hk_data[115:119])[0]
+ fina_coil_z_current = struct.unpack("!f", hk_data[119:123])[0]
+ fina_coil_x_temperature = struct.unpack("!H", hk_data[123:125])[0]
+ fina_coil_y_temperature = struct.unpack("!H", hk_data[125:127])[0]
+ fina_coil_z_temperature = struct.unpack("!H", hk_data[127:129])[0]
- hk_content = [init_err, init_raw_mag_x, init_raw_mag_y, init_raw_mag_z, init_cal_mag_x, init_cal_mag_y,
- init_cal_mag_z, init_coil_x_current, init_coil_y_current, init_coil_z_current,
- init_coil_x_temperature, init_coil_y_temperature, init_coil_z_temperature, err, raw_mag_x,
- init_raw_mag_y, raw_mag_z, cal_mag_x, cal_mag_y, cal_mag_z, coil_x_current, coil_y_current,
- coil_z_current, coil_x_temperature, coil_y_temperature, coil_z_temperature, fina_err, fina_raw_mag_x,
- fina_raw_mag_y, fina_raw_mag_z, fina_cal_mag_x, fina_cal_mag_y, fina_cal_mag_z, fina_coil_x_current,
- fina_coil_y_current, fina_coil_z_current, fina_coil_x_temperature, fina_coil_y_temperature,
- fina_coil_z_temperature]
+ validity_buffer = hk_data[129:]
+ content_list = [
+ init_err,
+ init_raw_mag_x,
+ init_raw_mag_y,
+ init_raw_mag_z,
+ init_cal_mag_x,
+ init_cal_mag_y,
+ init_cal_mag_z,
+ init_coil_x_current,
+ init_coil_y_current,
+ init_coil_z_current,
+ init_coil_x_temperature,
+ init_coil_y_temperature,
+ init_coil_z_temperature,
+ err,
+ raw_mag_x,
+ init_raw_mag_y,
+ raw_mag_z,
+ cal_mag_x,
+ cal_mag_y,
+ cal_mag_z,
+ coil_x_current,
+ coil_y_current,
+ coil_z_current,
+ coil_x_temperature,
+ coil_y_temperature,
+ coil_z_temperature,
+ fina_err,
+ fina_raw_mag_x,
+ fina_raw_mag_y,
+ fina_raw_mag_z,
+ fina_cal_mag_x,
+ fina_cal_mag_y,
+ fina_cal_mag_z,
+ fina_coil_x_current,
+ fina_coil_y_current,
+ fina_coil_z_current,
+ fina_coil_x_temperature,
+ fina_coil_y_temperature,
+ fina_coil_z_temperature,
+ ]
+ num_of_vars = len(header_list)
+ log_to_both(printer, str(header_list))
+ log_to_both(printer, str(content_list))
+ printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=num_of_vars)
- return hk_header, hk_content, validity_buffer, len(hk_header)
+
+def handle_gps_data(printer: FsfwTmTcPrinter, hk_data: bytes):
+ LOGGER.info(f"Received GPS data, HK data length {len(hk_data)}")
+ reply = HkReplyUnpacked()
+ var_index = 0
+ header_list = [
+ "Latitude",
+ "Longitude",
+ "Altitude",
+ "Fix Mode",
+ "Sats in Use",
+ "Date",
+ "Unix Seconds",
+ ]
+ latitude = struct.unpack("!d", hk_data[0:8])[0]
+ longitude = struct.unpack("!d", hk_data[8:16])[0]
+ altitude = struct.unpack("!d", hk_data[16:24])[0]
+ fix_mode = hk_data[24]
+ sat_in_use = hk_data[25]
+ year = struct.unpack("!H", hk_data[26:28])[0]
+ month = hk_data[28]
+ day = hk_data[29]
+ hours = hk_data[30]
+ minutes = hk_data[31]
+ seconds = hk_data[32]
+ date_string = f"{day}.{month}.{year} {hours}:{minutes}:{seconds}"
+ unix_seconds = struct.unpack("!I", hk_data[33:37])[0]
+ content_list = [
+ latitude,
+ longitude,
+ altitude,
+ fix_mode,
+ sat_in_use,
+ date_string,
+ unix_seconds,
+ ]
+ var_index += 13
+ reply.num_of_vars = var_index
+ if not os.path.isfile("gps_log.txt"):
+ with open("gps_log.txt", "w") as gps_file:
+ gps_file.write(
+ "Time, Latitude [deg], Longitude [deg], Altitude [m], Fix Mode, Sats in Use, "
+ "Date, Unix Seconds\n"
+ )
+ with open("gps_log.txt", "a") as gps_file:
+ gps_file.write(
+ f"{datetime.datetime.now()}, {latitude}, {longitude}, {altitude}, "
+ f"{fix_mode}, {sat_in_use}, {date_string}, {unix_seconds}\n"
+ )
+ validity_buffer = hk_data[37:39]
+ log_to_both(printer, str(header_list))
+ log_to_both(printer, str(content_list))
+ printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=10)
+
+
+def handle_bpx_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
+ if set_id == BpxSetIds.GET_HK_SET:
+ fmt_str = "!HHHHhhhhIB"
+ inc_len = struct.calcsize(fmt_str)
+ (
+ charge_current,
+ discharge_current,
+ heater_current,
+ batt_voltage,
+ batt_temp_1,
+ batt_temp_2,
+ batt_temp_3,
+ batt_temp_4,
+ reboot_cntr,
+ boot_cause,
+ ) = struct.unpack(fmt_str, hk_data[0:inc_len])
+ header_list = [
+ "Charge Current",
+ "Discharge Current",
+ "Heater Current",
+ "Battery Voltage",
+ "Batt Temp 1",
+ "Batt Temp 2",
+ "Batt Temp 3",
+ "Batt Temp 4",
+ "Reboot Counter",
+ "Boot Cause",
+ ]
+ content_list = [
+ charge_current,
+ discharge_current,
+ heater_current,
+ batt_voltage,
+ batt_temp_1,
+ batt_temp_2,
+ batt_temp_3,
+ batt_temp_4,
+ reboot_cntr,
+ boot_cause,
+ ]
+ validity_buffer = hk_data[inc_len:]
+ log_to_both(printer, str(header_list))
+ log_to_both(printer, str(content_list))
+ printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=10)
+ elif set_id == BpxSetIds.GET_CFG_SET:
+ battheat_mode = hk_data[0]
+ battheat_low = struct.unpack("!b", hk_data[1:2])[0]
+ battheat_high = struct.unpack("!b", hk_data[2:3])[0]
+ header_list = [
+ "Battery Heater Mode",
+ "Battery Heater Low Limit",
+ "Battery Heater High Limit",
+ ]
+ content_list = [battheat_mode, battheat_low, battheat_high]
+ validity_buffer = hk_data[3:]
+ log_to_both(printer, str(header_list))
+ log_to_both(printer, str(content_list))
+ printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=10)
+
+
+def handle_core_hk_data(printer: FsfwTmTcPrinter, hk_data: bytes):
+
+ fmt_str = "!fffH"
+ inc_len = struct.calcsize(fmt_str)
+ (temperature, ps_voltage, pl_voltage, tx_agc_value) = struct.unpack(
+ fmt_str, hk_data[0 : 0 + inc_len]
+ )
+ printout = (
+ f"Chip Temperature [°C] {temperature} | PS Voltage [mV] {ps_voltage} | "
+ f"PL Voltage [mV] {pl_voltage} | TX AGC {tx_agc_value}"
+ )
+ log_to_both(printer, printout)
+ printer.print_validity_buffer(validity_buffer=hk_data[inc_len:], num_vars=4)
+
+
+P60_INDEX_LIST = [
+ "ACU VCC",
+ "PDU1 VCC",
+ "X3 IDLE VCC",
+ "PDU2 VCC",
+ "ACU VBAT",
+ "PDU1 VBAT",
+ "X3 IDLE VBAT",
+ "PDU2 VBAT",
+ "STACK VBAT",
+ "STACK 3V3",
+ "STACK 5V",
+ "GS3V3",
+ "GS5V",
+]
+
+WDT_LIST = ["GND", "I2C", "CAN", "CSP0", "CSP1"]
+
+
+def handle_p60_hk_data(printer: FsfwTmTcPrinter, hk_data: bytes):
+ current_idx = 0
+ current_list = []
+ for idx in range(13):
+ current_list.append(
+ struct.unpack("!h", hk_data[current_idx : current_idx + 2])[0]
+ )
+ current_idx += 2
+ voltage_list = []
+ for idx in range(13):
+ voltage_list.append(
+ struct.unpack("!H", hk_data[current_idx : current_idx + 2])[0]
+ )
+ current_idx += 2
+ out_enb_list = []
+ for idx in range(13):
+ out_enb_list.append(hk_data[current_idx])
+ current_idx += 1
+ header_str = f"{'Name'.ljust(24)} | OutEnb | U [mV] | I [mA]"
+ print(header_str)
+ printer.file_logger.info(header_str)
+ for idx in range(13):
+ out_enb = f"{out_enb_list[idx]}".ljust(6)
+ content_line = (
+ f"{P60_INDEX_LIST[idx].ljust(24)} | {out_enb} | "
+ f"{voltage_list[idx]:05} | {current_list[idx]:04}"
+ )
+ print(content_line)
+ printer.file_logger.info(content_line)
+ fmt_str = "!hhIIIhBBB"
+ inc_len = struct.calcsize(fmt_str)
+ (
+ temp0,
+ temp1,
+ boot_cause,
+ boot_count,
+ uptime,
+ reset_cause,
+ batt_mode,
+ heater_on,
+ conv_5v_on,
+ ) = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
+ current_idx += inc_len
+ util_info = (
+ f"Batt Mode {batt_mode} | Boot Count {boot_count} | Heater On {heater_on}"
+ )
+ util_info2 = (
+ f"Reset Cause {reset_cause} | Boot Cause {boot_cause} | Uptime {uptime} | "
+ f"Conv 5V on {conv_5v_on}"
+ )
+ print(util_info)
+ print(util_info2)
+ printer.file_logger.info(util_info)
+ printer.file_logger.info(util_info2)
+ latchup_list = []
+ for idx in range(0, 13):
+ latchup_list.append(
+ struct.unpack("!H", hk_data[current_idx : current_idx + 2])[0]
+ )
+ current_idx += 2
+ fmt_str = "!HhhHhh"
+ inc_len = struct.calcsize(fmt_str)
+ (
+ dock_vbat,
+ dock_vcc_current,
+ batt_current,
+ batt_voltage,
+ batt_temp_0,
+ batt_temp_1,
+ ) = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
+ current_idx += inc_len
+ device_types = []
+ device_statuses = []
+ for idx in range(8):
+ device_types.append(hk_data[current_idx])
+ current_idx += 1
+ for idx in range(8):
+ device_statuses.append(hk_data[current_idx])
+ current_idx += 1
+ dearm_status = hk_data[current_idx]
+ current_idx += 1
+ wdt_reboots_list = []
+ for idx in range(5):
+ wdt_reboots_list.append(
+ struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
+ )
+ current_idx += 4
+ time_pings_left_list = []
+ for idx in range(3):
+ time_pings_left_list.append(
+ struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
+ )
+ current_idx += 4
+ for idx in range(2):
+ time_pings_left_list.append(hk_data[current_idx])
+ current_idx += 1
+ batt_charge_current = struct.unpack("!h", hk_data[current_idx : current_idx + 2])[0]
+ current_idx += 2
+ batt_discharge_current = struct.unpack(
+ "!h", hk_data[current_idx : current_idx + 2]
+ )[0]
+ current_idx += 2
+ ant6_depl_status = struct.unpack("!b", hk_data[current_idx : current_idx + 1])[0]
+ current_idx += 1
+ ar6_depl_status = struct.unpack("!b", hk_data[current_idx : current_idx + 1])[0]
+ current_idx += 1
+ wdt_info = "WDT Type | Reboots | Time or Pings left (CSP only)"
+ log_to_both(printer, wdt_info)
+ for idx in range(len(wdt_reboots_list)):
+ log_to_both(
+ printer,
+ f"{WDT_LIST[idx].ljust(5)} | "
+ f"{wdt_reboots_list[idx]:010} | {time_pings_left_list[idx]:010}",
+ )
+ temps = (
+ f"In C: Temp 0 {temp0 / 10.0} | Temp 1 {temp1 / 10.0} | "
+ f"Batt Temp 0 {batt_temp_0 / 10.0} | Batt Temp 1 {batt_temp_1 / 10.0}"
+ )
+ batt_info = (
+ f"Batt: Current {batt_current} | Volt {batt_voltage} | "
+ f"Charge Current {batt_charge_current} | Discharge Current {batt_discharge_current}"
+ )
+ log_to_both(printer, temps)
+ log_to_both(printer, batt_info)
+ misc_info = f"Dearm {dearm_status} | ANT6 Depl {ant6_depl_status} | AR6 Deply {ar6_depl_status}"
+ log_to_both(printer, misc_info)
+ printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=36)
+
+
+def log_to_both(printer: FsfwTmTcPrinter, string: str):
+ print(string)
+ printer.file_logger.info(string)
diff --git a/pus_tm/service_8_hook.py b/pus_tm/service_8_hook.py
deleted file mode 100644
index 358be86..0000000
--- a/pus_tm/service_8_hook.py
+++ /dev/null
@@ -1,70 +0,0 @@
-import struct
-from typing import Tuple
-from config.object_ids import *
-from pus_tc.imtq import ImtqActionIds
-from pus_tc.ploc_mpsoc import PlocReplyIds
-from pus_tc.ploc_supervisor import SupvActionIds
-
-
-def user_analyze_service_8_data(
- object_id: bytes, action_id: int, custom_data: bytearray) -> Tuple[list, list]:
- """
- This function is called by the TMTC core if a Service 8 data reply (subservice 130)
- is received. The user can return a tuple of two lists, where the first list
- is a list of header strings to print and the second list is a list of values to print.
- The TMTC core will take care of printing both lists and logging them.
-
- @param object_id:
- @param action_id:
- @param custom_data:
- @return:
- """
- if object_id == PDU_2_HANDLER_ID:
- header_list = ['PDU2 Service 8 Reply']
-
- data_string = str()
- for index in range(len(custom_data)):
- data_string += str(hex(custom_data[index])) + " , "
- data_string = data_string.rstrip()
- data_string = data_string.rstrip(',')
- data_string = data_string.rstrip()
- content_list = [data_string]
- elif object_id == IMTQ_HANDLER_ID:
- return handle_imtq_replies(action_id, custom_data)
- elif object_id == PLOC_MPSOC_ID:
- return handle_ploc_replies(action_id, custom_data)
- elif object_id == PLOC_SUPV_ID:
- return handle_supervisor_replies(action_id, custom_data)
- else:
- header_list = []
- content_list = []
- return header_list, content_list
-
-
-def handle_imtq_replies(action_id: int, custom_data: bytearray) -> Tuple[list, list]:
- header_list = []
- content_list = []
- if action_id == struct.unpack('!I', ImtqActionIds.get_commanded_dipole)[0]:
- header_list = ['Commanded X-Dipole', 'Commanded Y-Dipole', 'Commanded Z-Dipole']
- x_dipole = struct.unpack('!H', custom_data[:2])
- y_dipole = struct.unpack('!H', custom_data[2:4])
- z_dipole = struct.unpack('!H', custom_data[4:6])
- content_list = [x_dipole[0], y_dipole[0], z_dipole[0]]
-
-
-def handle_ploc_replies(action_id: int, custom_data: bytearray) -> Tuple[list, list]:
- header_list = []
- content_list = []
- if action_id == PlocReplyIds.tm_mem_read_report:
- header_list = ['PLOC Memory Address', 'PLOC Mem Len', 'PLOC Read Memory Data']
- content_list = [custom_data[:4], custom_data[4:6], custom_data[6:10]]
- return header_list, content_list
-
-
-def handle_supervisor_replies(action_id: int, custom_data: bytearray) -> Tuple[list, list]:
- header_list = []
- content_list = []
- if action_id == SupvActionIds.DUMP_MRAM:
- header_list = ['MRAM Dump']
- content_list = [custom_data[:len(custom_data)]]
- return header_list, content_list
diff --git a/pus_tm/verification_handler.py b/pus_tm/verification_handler.py
new file mode 100644
index 0000000..2047f1d
--- /dev/null
+++ b/pus_tm/verification_handler.py
@@ -0,0 +1,30 @@
+import logging
+from datetime import datetime
+from typing import cast
+
+from tmtccmd.pus.service_1_verification import Service1TMExtended
+from tmtccmd.logging import get_console_logger
+from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
+from config.retvals import get_retval_dict
+
+LOGGER = get_console_logger()
+
+
+def handle_service_1_packet(printer: FsfwTmTcPrinter, raw_tm: bytes):
+ tm_packet = Service1TMExtended.unpack(raw_telemetry=raw_tm)
+ printer.handle_long_tm_print(packet_if=tm_packet, info_if=tm_packet)
+ srv1_packet = cast(Service1TMExtended, tm_packet)
+ retval_dict = get_retval_dict()
+ if srv1_packet.has_tc_error_code:
+ retval_info = retval_dict.get(srv1_packet.error_code)
+ if retval_info is None:
+ LOGGER.info(
+ f"No returnvalue information found for error code {srv1_packet.error_code}"
+ )
+ else:
+ retval_string = (
+ f"Error Code information for code {srv1_packet.error_code}| "
+ f"Name: {retval_info.name} | Info: {retval_info.info}"
+ )
+ LOGGER.info(retval_string)
+ printer.file_logger.info(retval_string)
diff --git a/requirements.txt b/requirements.txt
index 64b5f85..7b75c9d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1 +1 @@
-tmtccmd>=1.0.0
+tmtccmd>=2.0.1
diff --git a/spacepackets b/spacepackets
new file mode 160000
index 0000000..0501a26
--- /dev/null
+++ b/spacepackets
@@ -0,0 +1 @@
+Subproject commit 0501a26b6f347cf48e0875658ac4eaca8cc7d819
diff --git a/tmtc_client_cli.py b/tmtc_client_cli.py
deleted file mode 100755
index d3f5b15..0000000
--- a/tmtc_client_cli.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/python3
-"""
-@brief TMTC Commander entry point for command line mode.
-@details
-This client was developed by KSat for the SOURCE project to test the on-board software but
-has evolved into a more generic tool for satellite developers to perform TMTC (Telemetry and Telecommand)
-handling and testing via different communication interfaces. Currently, only the PUS standard is
-implemented as a packet standard.
-
-Run this file with the -h flag to display options.
-
-@license
-Copyright 2020 KSat e.V. Stuttgart
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-@author R. Mueller
-"""
-import sys
-
-from config.hook_implementations import EiveHookObject
-from config.version import __version__
-from config.definitions import PUS_APID
-from pus_tm.factory_hook import ccsds_tm_handler
-try:
- from tmtccmd.runner import initialize_tmtc_commander, run_tmtc_commander, add_ccsds_handler
- from tmtccmd.ccsds.handler import CcsdsTmHandler
-except ImportError as error:
- run_tmtc_commander = None
- initialize_tmtc_commander = None
- print(error)
- print("Python tmtccmd submodule could not be imported")
- print("Install with \"cd tmtccmd && python3 -m pip install -e .\" for interactive installation")
- sys.exit(0)
-
-
-def main():
- hook_obj = EiveHookObject()
- print(f"-- eive tmtc version {__version__}")
- initialize_tmtc_commander(hook_object=hook_obj)
- ccsds_handler = CcsdsTmHandler()
- ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50)
- add_ccsds_handler(ccsds_handler)
- run_tmtc_commander(False)
-
-
-if __name__ == "__main__":
- main()
diff --git a/tmtccli.py b/tmtccli.py
new file mode 100755
index 0000000..0ae3990
--- /dev/null
+++ b/tmtccli.py
@@ -0,0 +1,94 @@
+#!/usr/bin/python3
+"""
+@brief TMTC Commander entry point for command line mode.
+@details
+This client was developed by KSat for the SOURCE project to test the on-board software but
+has evolved into a more generic tool for satellite developers to perform TMTC (Telemetry and Telecommand)
+handling and testing via different communication interfaces. Currently, only the PUS standard is
+implemented as a packet standard.
+
+Run this file with the -h flag to display options.
+
+@license
+Copyright 2020 KSat e.V. Stuttgart
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+@author R. Mueller
+"""
+import sys
+import traceback
+
+try:
+ import tmtccmd.runner as tmtccmd
+ from tmtccmd.config import default_json_path, SetupArgs
+ from tmtccmd.config.args import (
+ create_default_args_parser,
+ add_default_tmtccmd_args,
+ parse_default_input_arguments,
+ )
+ from tmtccmd.ccsds.handler import CcsdsTmHandler, ApidHandler
+ from tmtccmd.logging import init_console_logger
+ from tmtccmd.logging.pus import create_tmtc_logger
+except ImportError as error:
+ run_tmtc_commander = None
+ initialize_tmtc_commander = None
+ tb = traceback.format_exc()
+ print(tb)
+ print("Python tmtccmd submodule could not be imported")
+ sys.exit(1)
+
+try:
+ import spacepackets
+except ImportError as error:
+ print(error)
+ print("Python spacepackets module could not be imported")
+ print(
+ 'Install with "cd spacepackets && python3 -m pip intall -e ." for interative installation'
+ )
+ sys.exit(1)
+
+from config.hook_implementations import EiveHookObject
+from config.version import __version__
+from config.definitions import PUS_APID
+from pus_tc.tc_packer_hook import pre_tc_send_cb
+from pus_tm.factory_hook import ccsds_tm_handler
+
+
+def main():
+ print(f"-- eive tmtc version {__version__} --")
+ print(f"-- spacepackets version {spacepackets.__version__} --")
+ tmtccmd.init_printout(False)
+ tmtc_file_logger = create_tmtc_logger()
+ hook_obj = EiveHookObject(json_cfg_path=default_json_path())
+ arg_parser = create_default_args_parser()
+ add_default_tmtccmd_args(arg_parser)
+ args = parse_default_input_arguments(arg_parser, hook_obj)
+ setup_args = SetupArgs(
+ hook_obj=hook_obj, use_gui=False, apid=PUS_APID, cli_args=args
+ )
+ apid_handler = ApidHandler(cb=ccsds_tm_handler, queue_len=50, user_args=None)
+ ccsds_handler = CcsdsTmHandler()
+ ccsds_handler.add_tm_handler(apid=PUS_APID, handler=apid_handler)
+ tmtccmd.setup(setup_args=setup_args)
+ tmtccmd.add_ccsds_handler(ccsds_handler)
+ tmtc_backend = tmtccmd.create_default_tmtc_backend(
+ setup_args=setup_args,
+ tm_handler=ccsds_handler,
+ )
+ tmtc_backend.usr_send_wrapper = (pre_tc_send_cb, tmtc_file_logger)
+ tmtccmd.run(tmtc_backend=tmtc_backend)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/tmtccmd b/tmtccmd
index 9497851..48b6b83 160000
--- a/tmtccmd
+++ b/tmtccmd
@@ -1 +1 @@
-Subproject commit 94978512deb6c91a6a1456ae3a1182bf679f063a
+Subproject commit 48b6b8396eb3ea5ec4527ccb96f5909a29cd95f6
diff --git a/tmtc_client_gui.py b/tmtcgui.py
similarity index 77%
rename from tmtc_client_gui.py
rename to tmtcgui.py
index ddcfa07..16759bc 100755
--- a/tmtc_client_gui.py
+++ b/tmtcgui.py
@@ -32,26 +32,37 @@ from config.hook_implementations import EiveHookObject
from config.version import __version__
from config.definitions import PUS_APID
from pus_tm.factory_hook import ccsds_tm_handler
+
try:
- from tmtccmd.runner import initialize_tmtc_commander, run_tmtc_commander, add_ccsds_handler
+ from tmtccmd.runner import (
+ init_tmtccmd,
+ run_tmtccmd,
+ add_ccsds_handler,
+ )
from tmtccmd.ccsds.handler import CcsdsTmHandler
+ import spacepackets
except ImportError as error:
run_tmtc_commander = None
initialize_tmtc_commander = None
print(error)
print("Python tmtccmd submodule could not be imported")
- print("Install with \"cd tmtccmd && python3 -m pip install -e .\" for interactive installation")
+ print(
+ 'Install with "cd tmtccmd && python3 -m pip install -e ." for interactive installation'
+ )
sys.exit(0)
def main():
hook_obj = EiveHookObject()
print(f"-- eive tmtc version {__version__}")
- initialize_tmtc_commander(hook_object=hook_obj)
+ print(f"-- spacepackets version {spacepackets.__version__} --")
+ init_tmtccmd(hook_object=hook_obj)
ccsds_handler = CcsdsTmHandler()
- ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50)
+ ccsds_handler.add_tm_handler(
+ apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50
+ )
add_ccsds_handler(ccsds_handler)
- run_tmtc_commander(use_gui=True)
+ run_tmtccmd(use_gui=True)
if __name__ == "__main__":
diff --git a/utility/args_parser.py b/utility/args_parser.py
index d4b11ad..17e5a03 100644
--- a/utility/args_parser.py
+++ b/utility/args_parser.py
@@ -1,11 +1,12 @@
-
-
-def parse_input_arguments_user(print_known_args: bool = False, print_unknown_args: bool = False):
+def parse_input_arguments_user(
+ print_known_args: bool = False, print_unknown_args: bool = False
+):
"""
This function by default will build the default argument parser. A custom CLI parser can be
built in this function if required.
"""
from tmtccmd.config.args import parse_default_input_arguments
+
parse_default_input_arguments(
print_known_args=print_known_args, print_unknown_args=print_unknown_args
)
diff --git a/utility/input_helper.py b/utility/input_helper.py
new file mode 100644
index 0000000..5c00856
--- /dev/null
+++ b/utility/input_helper.py
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+"""
+@file input_helper.py
+@brief This class can be used to get user input. A dictionary must be provided which describes the input options.
+@author J. Meier
+@date 13.02.2021
+"""
+
+from tmtccmd.logging import get_console_logger
+
+LOGGER = get_console_logger()
+
+
+class InputHelper:
+ def __init__(self, menu: dict):
+ """
+ @brief Constructor
+ @param menu The menu describing the input options
+ """
+ self.menu = menu
+
+ def get_key(self) -> str:
+ """
+ @brief Asks the user for input and returns the chosen key
+ """
+ key = self.menu_handler()
+ while key not in self.menu:
+ LOGGER.info("Invalid key specified, try again.")
+ key = self.menu_handler()
+ return key
+
+ def menu_handler(self) -> str:
+ key_column_width = 10
+ description_column_width = 50
+ separator_width = key_column_width + description_column_width + 3
+ separator_string = separator_width * "-"
+ key_string = "Key".ljust(key_column_width)
+ description_string = "Description".ljust(description_column_width)
+ LOGGER.info(f"{key_string} | {description_string}")
+ LOGGER.info(separator_string)
+ for key in self.menu:
+ key_string = key.ljust(key_column_width)
+ description_string = self.menu[key][0].ljust(description_column_width)
+ LOGGER.info(f"{key_string} | {description_string}")
+ key = input("Specify key: ")
+ return key