fix in service 8 reply handling

This commit is contained in:
Jakob Meier 2022-04-30 09:26:19 +02:00
parent d41a59834c
commit f263c2b9fe
2 changed files with 6 additions and 8 deletions

View File

@ -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)

View File

@ -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)