diff --git a/.gitignore b/.gitignore index cc672c2..0e1a63e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,7 @@ __pycache__ +/.idea +/venv + log /gps_log.txt - -.idea/* -!.idea/runConfigurations - -*.json - -/venv +/config/*.json diff --git a/.idea/runConfigurations/ACU.xml b/.run/ACU.run.xml similarity index 100% rename from .idea/runConfigurations/ACU.xml rename to .run/ACU.run.xml diff --git a/.idea/runConfigurations/BPX.xml b/.run/BPX.run.xml similarity index 100% rename from .idea/runConfigurations/BPX.xml rename to .run/BPX.run.xml diff --git a/.idea/runConfigurations/BPX_Request_HK.xml b/.run/BPX_Request_HK.run.xml similarity index 100% rename from .idea/runConfigurations/BPX_Request_HK.xml rename to .run/BPX_Request_HK.run.xml diff --git a/.idea/runConfigurations/BPX_Reset_Reboot_Counter.xml b/.run/BPX_Reset_Reboot_Counter.run.xml similarity index 100% rename from .idea/runConfigurations/BPX_Reset_Reboot_Counter.xml rename to .run/BPX_Reset_Reboot_Counter.run.xml diff --git a/.idea/runConfigurations/GPS_0.xml b/.run/GPS_0.run.xml similarity index 100% rename from .idea/runConfigurations/GPS_0.xml rename to .run/GPS_0.run.xml diff --git a/.idea/runConfigurations/GPS_1.xml b/.run/GPS_1.run.xml similarity index 100% rename from .idea/runConfigurations/GPS_1.xml rename to .run/GPS_1.run.xml diff --git a/.idea/runConfigurations/Heater_Test.xml b/.run/Heater_Test.run.xml similarity index 100% rename from .idea/runConfigurations/Heater_Test.xml rename to .run/Heater_Test.run.xml diff --git a/.idea/runConfigurations/IMTQ_Get_Commanded_Dipole.xml b/.run/IMTQ_Get_Commanded_Dipole.run.xml similarity index 100% rename from .idea/runConfigurations/IMTQ_Get_Commanded_Dipole.xml rename to .run/IMTQ_Get_Commanded_Dipole.run.xml diff --git a/.idea/runConfigurations/IMTQ_Neg_X_Test.xml b/.run/IMTQ_Neg_X_Test.run.xml similarity index 100% rename from .idea/runConfigurations/IMTQ_Neg_X_Test.xml rename to .run/IMTQ_Neg_X_Test.run.xml diff --git a/.idea/runConfigurations/IMTQ_Neg_Y_Test.xml b/.run/IMTQ_Neg_Y_Test.run.xml similarity index 100% rename from .idea/runConfigurations/IMTQ_Neg_Y_Test.xml rename to .run/IMTQ_Neg_Y_Test.run.xml diff --git a/.idea/runConfigurations/IMTQ_Neg_Z_Test.xml b/.run/IMTQ_Neg_Z_Test.run.xml similarity index 100% rename from .idea/runConfigurations/IMTQ_Neg_Z_Test.xml rename to .run/IMTQ_Neg_Z_Test.run.xml diff --git a/.idea/runConfigurations/IMTQ_Pos_X_Test.xml b/.run/IMTQ_Pos_X_Test.run.xml similarity index 100% rename from .idea/runConfigurations/IMTQ_Pos_X_Test.xml rename to .run/IMTQ_Pos_X_Test.run.xml diff --git a/.idea/runConfigurations/IMTQ_Pos_Y_Test.xml b/.run/IMTQ_Pos_Y_Test.run.xml similarity index 100% rename from .idea/runConfigurations/IMTQ_Pos_Y_Test.xml rename to .run/IMTQ_Pos_Y_Test.run.xml diff --git a/.idea/runConfigurations/IMTQ_Pos_Z_Test.xml b/.run/IMTQ_Pos_Z_Test.run.xml similarity index 100% rename from .idea/runConfigurations/IMTQ_Pos_Z_Test.xml rename to .run/IMTQ_Pos_Z_Test.run.xml diff --git a/.idea/runConfigurations/IMTQ_Test_UDP.xml b/.run/IMTQ_Test_UDP.run.xml similarity index 100% rename from .idea/runConfigurations/IMTQ_Test_UDP.xml rename to .run/IMTQ_Test_UDP.run.xml diff --git a/.idea/runConfigurations/P60_Dock_Commanding.xml b/.run/P60_Dock_Commanding.run.xml similarity index 100% rename from .idea/runConfigurations/P60_Dock_Commanding.xml rename to .run/P60_Dock_Commanding.run.xml diff --git a/.idea/runConfigurations/PDU1_Commanding.xml b/.run/PDU1_Commanding.run.xml similarity index 100% rename from .idea/runConfigurations/PDU1_Commanding.xml rename to .run/PDU1_Commanding.run.xml diff --git a/.idea/runConfigurations/PDU2_Commanding.xml b/.run/PDU2_Commanding.run.xml similarity index 100% rename from .idea/runConfigurations/PDU2_Commanding.xml rename to .run/PDU2_Commanding.run.xml diff --git a/.idea/runConfigurations/PLOC_MPSoC.xml b/.run/PLOC_MPSoC.run.xml similarity index 100% rename from .idea/runConfigurations/PLOC_MPSoC.xml rename to .run/PLOC_MPSoC.run.xml diff --git a/.idea/runConfigurations/PLOC_SUPV.xml b/.run/PLOC_SUPV.run.xml similarity index 100% rename from .idea/runConfigurations/PLOC_SUPV.xml rename to .run/PLOC_SUPV.run.xml diff --git a/.idea/runConfigurations/Ping_Command.xml b/.run/Ping_Command.run.xml similarity index 100% rename from .idea/runConfigurations/Ping_Command.xml rename to .run/Ping_Command.run.xml diff --git a/.idea/runConfigurations/RW1_Test.xml b/.run/RW1_Test.run.xml similarity index 100% rename from .idea/runConfigurations/RW1_Test.xml rename to .run/RW1_Test.run.xml diff --git a/.idea/runConfigurations/RW2_Test_.xml b/.run/RW2_Test_.run.xml similarity index 100% rename from .idea/runConfigurations/RW2_Test_.xml rename to .run/RW2_Test_.run.xml diff --git a/.idea/runConfigurations/RW3_Test_.xml b/.run/RW3_Test_.run.xml similarity index 100% rename from .idea/runConfigurations/RW3_Test_.xml rename to .run/RW3_Test_.run.xml diff --git a/.idea/runConfigurations/RW4_Test_.xml b/.run/RW4_Test_.run.xml similarity index 100% rename from .idea/runConfigurations/RW4_Test_.xml rename to .run/RW4_Test_.run.xml diff --git a/.idea/runConfigurations/Reboot_0_0.xml b/.run/Reboot_0_0.run.xml similarity index 100% rename from .idea/runConfigurations/Reboot_0_0.xml rename to .run/Reboot_0_0.run.xml diff --git a/.idea/runConfigurations/Reboot_0_1.xml b/.run/Reboot_0_1.run.xml similarity index 100% rename from .idea/runConfigurations/Reboot_0_1.xml rename to .run/Reboot_0_1.run.xml diff --git a/.idea/runConfigurations/Reboot_1_0.xml b/.run/Reboot_1_0.run.xml similarity index 100% rename from .idea/runConfigurations/Reboot_1_0.xml rename to .run/Reboot_1_0.run.xml diff --git a/.idea/runConfigurations/Reboot_1_1.xml b/.run/Reboot_1_1.run.xml similarity index 100% rename from .idea/runConfigurations/Reboot_1_1.xml rename to .run/Reboot_1_1.run.xml diff --git a/.idea/runConfigurations/Reboot_Prompt.xml b/.run/Reboot_Prompt.run.xml similarity index 100% rename from .idea/runConfigurations/Reboot_Prompt.xml rename to .run/Reboot_Prompt.run.xml diff --git a/.idea/runConfigurations/Reboot_Self.xml b/.run/Reboot_Self.run.xml similarity index 100% rename from .idea/runConfigurations/Reboot_Self.xml rename to .run/Reboot_Self.run.xml diff --git a/.idea/runConfigurations/S_A_Deployment_Test.xml b/.run/S_A_Deployment_Test.run.xml similarity index 100% rename from .idea/runConfigurations/S_A_Deployment_Test.xml rename to .run/S_A_Deployment_Test.run.xml diff --git a/.idea/runConfigurations/Star_Tracker.xml b/.run/Star_Tracker.run.xml similarity index 100% rename from .idea/runConfigurations/Star_Tracker.xml rename to .run/Star_Tracker.run.xml diff --git a/.idea/runConfigurations/Syrlinks.xml b/.run/Syrlinks.run.xml similarity index 100% rename from .idea/runConfigurations/Syrlinks.xml rename to .run/Syrlinks.run.xml diff --git a/.idea/runConfigurations/Syrlinks_Test_UDP.xml b/.run/Syrlinks_Test_UDP.run.xml similarity index 100% rename from .idea/runConfigurations/Syrlinks_Test_UDP.xml rename to .run/Syrlinks_Test_UDP.run.xml diff --git a/.idea/runConfigurations/TMP1075_1_Dock_Test_UDP.xml b/.run/TMP1075_1_Dock_Test_UDP.run.xml similarity index 100% rename from .idea/runConfigurations/TMP1075_1_Dock_Test_UDP.xml rename to .run/TMP1075_1_Dock_Test_UDP.run.xml diff --git a/.idea/runConfigurations/TMP1075_2_Dock_Test_UDP.xml b/.run/TMP1075_2_Dock_Test_UDP.run.xml similarity index 100% rename from .idea/runConfigurations/TMP1075_2_Dock_Test_UDP.xml rename to .run/TMP1075_2_Dock_Test_UDP.run.xml diff --git a/.idea/runConfigurations/Unittests_in_spacepackets.xml b/.run/Unittests_in_spacepackets.run.xml similarity index 100% rename from .idea/runConfigurations/Unittests_in_spacepackets.xml rename to .run/Unittests_in_spacepackets.run.xml diff --git a/.idea/runConfigurations/Unittests_in_tmtccmd.xml b/.run/Unittests_in_tmtccmd.run.xml similarity index 100% rename from .idea/runConfigurations/Unittests_in_tmtccmd.xml rename to .run/Unittests_in_tmtccmd.run.xml diff --git a/.idea/runConfigurations/_IMTQ_Command_Dipole.xml b/.run/_IMTQ_Command_Dipole.run.xml similarity index 100% rename from .idea/runConfigurations/_IMTQ_Command_Dipole.xml rename to .run/_IMTQ_Command_Dipole.run.xml diff --git a/.idea/runConfigurations/ccsds_handler.xml b/.run/ccsds_handler.run.xml similarity index 100% rename from .idea/runConfigurations/ccsds_handler.xml rename to .run/ccsds_handler.run.xml diff --git a/.idea/runConfigurations/pdec_handler.xml b/.run/pdec_handler.run.xml similarity index 100% rename from .idea/runConfigurations/pdec_handler.xml rename to .run/pdec_handler.run.xml diff --git a/.idea/runConfigurations/tmtcc_Service_17.xml b/.run/tmtcc_Service_17.run.xml similarity index 100% rename from .idea/runConfigurations/tmtcc_Service_17.xml rename to .run/tmtcc_Service_17.run.xml diff --git a/.idea/runConfigurations/tmtcc_Service_2.xml b/.run/tmtcc_Service_2.run.xml similarity index 100% rename from .idea/runConfigurations/tmtcc_Service_2.xml rename to .run/tmtcc_Service_2.run.xml diff --git a/.idea/runConfigurations/tmtcc_Service_200.xml b/.run/tmtcc_Service_200.run.xml similarity index 100% rename from .idea/runConfigurations/tmtcc_Service_200.xml rename to .run/tmtcc_Service_200.run.xml diff --git a/.idea/runConfigurations/tmtcc_Service_3.xml b/.run/tmtcc_Service_3.run.xml similarity index 100% rename from .idea/runConfigurations/tmtcc_Service_3.xml rename to .run/tmtcc_Service_3.run.xml diff --git a/.idea/runConfigurations/tmtcc_Service_8.xml b/.run/tmtcc_Service_8.run.xml similarity index 100% rename from .idea/runConfigurations/tmtcc_Service_8.xml rename to .run/tmtcc_Service_8.run.xml diff --git a/.idea/runConfigurations/tmtccli.xml b/.run/tmtccli.run.xml similarity index 100% rename from .idea/runConfigurations/tmtccli.xml rename to .run/tmtccli.run.xml diff --git a/.idea/runConfigurations/tmtccli_example.xml b/.run/tmtccli_example.run.xml similarity index 100% rename from .idea/runConfigurations/tmtccli_example.xml rename to .run/tmtccli_example.run.xml diff --git a/.idea/runConfigurations/tmtcclient_Help.xml b/.run/tmtcclient_Help.run.xml similarity index 100% rename from .idea/runConfigurations/tmtcclient_Help.xml rename to .run/tmtcclient_Help.run.xml diff --git a/.idea/runConfigurations/tmtccmd_Listener_Mode.xml b/.run/tmtccmd_Listener_Mode.run.xml similarity index 100% rename from .idea/runConfigurations/tmtccmd_Listener_Mode.xml rename to .run/tmtccmd_Listener_Mode.run.xml diff --git a/.idea/runConfigurations/tmtcgui.xml b/.run/tmtcgui.run.xml similarity index 100% rename from .idea/runConfigurations/tmtcgui.xml rename to .run/tmtcgui.run.xml diff --git a/.idea/runConfigurations/tmtcgui_example.xml b/.run/tmtcgui_example.run.xml similarity index 100% rename from .idea/runConfigurations/tmtcgui_example.xml rename to .run/tmtcgui_example.run.xml diff --git a/config/events.csv b/config/events.csv index c32eaa6..00bcd51 100644 --- a/config/events.csv +++ b/config/events.csv @@ -111,7 +111,7 @@ 12002;0x2ee2;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux\devices\ploc\PlocSupervisorHandler.h 12003;0x2ee3;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;linux\devices\ploc\PlocSupervisorHandler.h 12004;0x2ee4;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux\devices\ploc\PlocSupervisorHandler.h -12005;0x2ee5;SUPV_HELPER_EXECUTING;LOW;Supervisor helper currently executing a command;linux\devices\ploc\PlocSupervisorHandler.h +12005;0x2ee5;SUPV_MPSOC_SHUWDOWN_BUILD_FAILED;LOW;Failed to build the command to shutdown the MPSoC;linux\devices\ploc\PlocSupervisorHandler.h 12100;0x2f44;SANITIZATION_FAILED;LOW;;bsp_q7s\memory\SdCardManager.h 12101;0x2f45;MOUNTED_SD_CARD;INFO;;bsp_q7s\memory\SdCardManager.h 12300;0x300c;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 @@ -187,7 +187,7 @@ 13609;0x3529;SUPV_MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocSupvHelper.h 13610;0x352a;SUPV_MISSING_EXE;LOW;Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h 13611;0x352b;SUPV_ACK_FAILURE_REPORT;LOW;Supervisor received acknowledgment failure report P1: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h -13612;0x352c;SUPV_EXE_FAILURE_REPORT;LOW;Supervisor received execution failure report P1: Internal state of supervisor;linux\devices\ploc\PlocSupvHelper.h +13612;0x352c;SUPV_EXE_FAILURE_REPORT;LOW;Execution report failure P1:;linux\devices\ploc\PlocSupvHelper.h 13613;0x352d;SUPV_ACK_INVALID_APID;LOW;Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h 13614;0x352e;SUPV_EXE_INVALID_APID;LOW;Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h 13615;0x352f;ACK_RECEPTION_FAILURE;LOW;Failed to receive acknowledgment report P1: Return value P2: Apid of command for which the reception of the acknowledgment report failed;linux\devices\ploc\PlocSupvHelper.h diff --git a/config/object_ids.py b/config/object_ids.py index a70adb6..c1b4236 100644 --- a/config/object_ids.py +++ b/config/object_ids.py @@ -55,7 +55,7 @@ IMTQ_HANDLER_ID = bytes([0x44, 0x14, 0x00, 0x14]) 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]) +PDEC_HANDLER_ID = bytes([0x50, 0x00, 0x07, 0x00]) # Payload Object IDs STAR_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1]) diff --git a/pus_tc/devs/syrlinks_hk_handler.py b/pus_tc/devs/syrlinks_hk_handler.py index 382177b..b5f3099 100644 --- a/pus_tc/devs/syrlinks_hk_handler.py +++ b/pus_tc/devs/syrlinks_hk_handler.py @@ -64,17 +64,17 @@ def pack_syrlinks_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 = object_id + struct.pack('!I', 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 = object_id + struct.pack('!I', 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 = object_id + struct.pack('!I', 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": @@ -89,26 +89,26 @@ def pack_syrlinks_command( 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 = object_id + struct.pack('!I', 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 = object_id + struct.pack('!I', 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 = object_id + struct.pack('!I', 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 = object_id + struct.pack('!I', 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": diff --git a/tmtccli.py b/tmtccli.py index 0ae3990..c80e4ac 100755 --- a/tmtccli.py +++ b/tmtccli.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 """ @brief TMTC Commander entry point for command line mode. @details