From f6a3f792203bc1f00b10c9760b99a8e83ae2535c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 15 Dec 2021 09:55:43 +0100 Subject: [PATCH 1/4] update submodules --- spacepackets | 2 +- tmtccmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spacepackets b/spacepackets index 3265d5b..464274a 160000 --- a/spacepackets +++ b/spacepackets @@ -1 +1 @@ -Subproject commit 3265d5b780fb5a551962eb9126df3d7d5e70fbeb +Subproject commit 464274a91ce31a28e3493a05089fcdbe0bdf285b diff --git a/tmtccmd b/tmtccmd index 71213f6..bfa459c 160000 --- a/tmtccmd +++ b/tmtccmd @@ -1 +1 @@ -Subproject commit 71213f68e2947afda9551539a97c540e14d1e7b6 +Subproject commit bfa459ccc3c7189a77374a68f0217d448525b34b From eca5bba1d8df6576a19547d356e676b0fb164d87 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 15 Dec 2021 11:19:19 +0100 Subject: [PATCH 2/4] added try except block --- pus_tm/factory_hook.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/pus_tm/factory_hook.py b/pus_tm/factory_hook.py index 646744f..865b5f3 100644 --- a/pus_tm/factory_hook.py +++ b/pus_tm/factory_hook.py @@ -26,17 +26,21 @@ def ccsds_tm_handler(apid: int, raw_tm_packet: bytearray, tmtc_printer: TmTcPrin def pus_factory_hook(raw_tm_packet: bytearray, tmtc_printer: TmTcPrinter): service_type = raw_tm_packet[7] tm_packet = None - if service_type == 1: - tm_packet = Service1TMExtended.unpack(raw_telemetry=raw_tm_packet) - if service_type == 3: - tm_packet = Service3TM.unpack(raw_telemetry=raw_tm_packet, custom_hk_handling=False) - if service_type == 5: - tm_packet = Service5TM.unpack(raw_telemetry=raw_tm_packet) - if service_type == 8: - tm_packet = Service8TM.unpack(raw_telemetry=raw_tm_packet) - if service_type == 17: - tm_packet = Service17TMExtended.unpack(raw_telemetry=raw_tm_packet) - if tm_packet is None: - LOGGER.info(f'The service {service_type} is not implemented in Telemetry Factory') - tm_packet = PusTelemetry.unpack(raw_telemetry=raw_tm_packet) - tmtc_printer.print_telemetry(packet_if=tm_packet, info_if=tm_packet, print_raw_tm=False) + try: + if service_type == 1: + tm_packet = Service1TMExtended.unpack(raw_telemetry=raw_tm_packet) + if service_type == 3: + tm_packet = Service3TM.unpack(raw_telemetry=raw_tm_packet, custom_hk_handling=False) + if service_type == 5: + tm_packet = Service5TM.unpack(raw_telemetry=raw_tm_packet) + if service_type == 8: + tm_packet = Service8TM.unpack(raw_telemetry=raw_tm_packet) + if service_type == 17: + tm_packet = Service17TMExtended.unpack(raw_telemetry=raw_tm_packet) + if tm_packet is None: + LOGGER.info(f'The service {service_type} is not implemented in Telemetry Factory') + tm_packet = PusTelemetry.unpack(raw_telemetry=raw_tm_packet) + tmtc_printer.print_telemetry(packet_if=tm_packet, info_if=tm_packet, print_raw_tm=False) + except ValueError: + # TODO: Log faulty packet + LOGGER.warning("Invalid packet format detected") From 4e2d561b96c4849287afa8a9e0639285048957cd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 16 Dec 2021 14:31:35 +0100 Subject: [PATCH 3/4] simpler name for scripts --- .idea/runConfigurations/ACU_Test.xml | 2 +- .idea/runConfigurations/GPS_0.xml | 2 +- .idea/runConfigurations/GPS_1.xml | 2 +- .idea/runConfigurations/Heater_Test.xml | 2 +- .idea/runConfigurations/IMTQ_Get_Commanded_Dipole.xml | 2 +- .idea/runConfigurations/IMTQ_Neg_X_Test.xml | 2 +- .idea/runConfigurations/IMTQ_Neg_Y_Test.xml | 2 +- .idea/runConfigurations/IMTQ_Neg_Z_Test.xml | 2 +- .idea/runConfigurations/IMTQ_Pos_X_Test.xml | 2 +- .idea/runConfigurations/IMTQ_Pos_Y_Test.xml | 2 +- .idea/runConfigurations/IMTQ_Pos_Z_Test.xml | 2 +- .idea/runConfigurations/IMTQ_Test_UDP.xml | 2 +- .idea/runConfigurations/P60_Dock_Commanding.xml | 2 +- .idea/runConfigurations/PDU1_Commanding.xml | 2 +- .idea/runConfigurations/PDU2_Commanding.xml | 2 +- .idea/runConfigurations/PLOC_SUPV_Test.xml | 2 +- .idea/runConfigurations/PLOC_Test_UDP_Flatsat.xml | 2 +- .idea/runConfigurations/PLOC_Test_UDP_Local.xml | 2 +- .idea/runConfigurations/Ping_Command.xml | 2 +- .idea/runConfigurations/RW1_Test.xml | 2 +- .idea/runConfigurations/RW2_Test_.xml | 2 +- .idea/runConfigurations/RW3_Test_.xml | 2 +- .idea/runConfigurations/RW4_Test_.xml | 2 +- .idea/runConfigurations/Reboot_0_0.xml | 2 +- .idea/runConfigurations/Reboot_0_1.xml | 2 +- .idea/runConfigurations/Reboot_1_0.xml | 2 +- .idea/runConfigurations/Reboot_1_1.xml | 2 +- .idea/runConfigurations/Reboot_Prompt.xml | 2 +- .idea/runConfigurations/Reboot_Self.xml | 2 +- .idea/runConfigurations/S_A_Deployment_Test_UDP.xml | 2 +- .idea/runConfigurations/Syrlinks_Test_UDP.xml | 2 +- .idea/runConfigurations/TMP1075_1_Dock_Test_UDP.xml | 2 +- .idea/runConfigurations/TMP1075_2_Dock_Test_UDP.xml | 2 +- .idea/runConfigurations/_IMTQ_Command_Dipole.xml | 2 +- .idea/runConfigurations/tmtcc_Service_2.xml | 2 +- .idea/runConfigurations/tmtcc_Service_200.xml | 2 +- .idea/runConfigurations/tmtcc_Service_3.xml | 2 +- .idea/runConfigurations/tmtcc_Service_8.xml | 2 +- .idea/runConfigurations/tmtcclient_CLI.xml | 2 +- .idea/runConfigurations/tmtcclient_GUI.xml | 2 +- .idea/runConfigurations/tmtcclient_Help.xml | 2 +- .idea/runConfigurations/tmtccmd_Listener_Mode.xml | 2 +- requirements.txt | 2 +- tmtc_client_cli.py => tmtccli.py | 0 tmtc_client_gui.py => tmtcgui.py | 0 45 files changed, 43 insertions(+), 43 deletions(-) rename tmtc_client_cli.py => tmtccli.py (100%) rename tmtc_client_gui.py => tmtcgui.py (100%) diff --git a/.idea/runConfigurations/ACU_Test.xml b/.idea/runConfigurations/ACU_Test.xml index 490fabd..e54e10c 100644 --- a/.idea/runConfigurations/ACU_Test.xml +++ b/.idea/runConfigurations/ACU_Test.xml @@ -12,7 +12,7 @@