From f263c2b9fe0d3134103c7450bab850499d714a72 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 30 Apr 2022 09:26:19 +0200 Subject: [PATCH] fix in service 8 reply handling --- pus_tc/devs/ploc_supervisor.py | 4 +--- pus_tm/action_reply_handler.py | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pus_tc/devs/ploc_supervisor.py b/pus_tc/devs/ploc_supervisor.py index 1382528..c0f870e 100644 --- a/pus_tc/devs/ploc_supervisor.py +++ b/pus_tc/devs/ploc_supervisor.py @@ -357,7 +357,7 @@ def pack_ploc_supv_commands( tc_queue.appendleft( (QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear mirror entries") ) - command = command = object_id + struct.pack( + command = object_id + struct.pack( "!I", SupvActionIds.FACTORY_RESET_CLEAR_MIRROR ) command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command) @@ -486,7 +486,6 @@ def pack_sel_boot_image_cmd( @param bp1 Partition pin 1 @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) @@ -505,7 +504,6 @@ def pack_update_available_cmd(object_id: bytearray) -> bytearray: image_size = 222 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) diff --git a/pus_tm/action_reply_handler.py b/pus_tm/action_reply_handler.py index cee50e1..08fae82 100644 --- a/pus_tm/action_reply_handler.py +++ b/pus_tm/action_reply_handler.py @@ -20,7 +20,7 @@ def handle_action_reply( """ 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) + object_id = obj_id_dict.get(tm_packet.source_object_id_as_bytes) custom_data = tm_packet.custom_data action_id = tm_packet.action_id generic_print_str = printer.generic_action_packet_tm_print( @@ -28,13 +28,13 @@ def handle_action_reply( ) print(generic_print_str) printer.file_logger.info(generic_print_str) - if object_id == IMTQ_HANDLER_ID: + if object_id.as_bytes == IMTQ_HANDLER_ID: return handle_imtq_replies(action_id, printer, custom_data) - elif object_id == PLOC_MPSOC_ID: + elif object_id.as_bytes == PLOC_MPSOC_ID: return handle_ploc_replies(action_id, printer, custom_data) - elif object_id == PLOC_SUPV_ID: + elif object_id.as_bytes == PLOC_SUPV_ID: return handle_supervisor_replies(action_id, printer, custom_data) - elif object_id == STAR_TRACKER_ID: + elif object_id.as_bytes == STAR_TRACKER_ID: return handle_startracker_replies(action_id, printer, custom_data)