print some more info for PUS1 verif failures

This commit is contained in:
Robin Müller 2022-08-18 16:19:09 +02:00
parent 1f5baabf31
commit aef9af3096
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
4 changed files with 17 additions and 9 deletions

2
deps/spacepackets vendored

@ -1 +1 @@
Subproject commit 13a54713ae283faf0b272dc6c1373ed459efb9b6
Subproject commit 6d35a8684550207df055cdefbf1e633429f591fd

2
deps/tmtccmd vendored

@ -1 +1 @@
Subproject commit 022f7729b841006f8573e16f573051cc763786df
Subproject commit b02ab670fa16b78fe521fc23255bb43b505fc427

View File

@ -11,7 +11,7 @@ from tmtccmd.tm.pus_17_test import Service17TmExtended
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from .event_handler import handle_event_packet
from .verification_handler import handle_service_1_packet
from .verification_handler import handle_service_1_fsfw_packet
from .hk_handling import handle_hk_packet
from .action_reply_handler import handle_action_reply
@ -38,7 +38,7 @@ def pus_factory_hook(
obj_id_dict = get_object_ids()
dedicated_handler = True
if service == 1:
handle_service_1_packet(wrapper=verif_wrapper, raw_tm=packet)
handle_service_1_fsfw_packet(wrapper=verif_wrapper, raw_tm=packet)
elif service == 3:
handle_hk_packet(printer=printer, raw_tm=packet, obj_id_dict=obj_id_dict)
elif service == 5:

View File

@ -1,18 +1,20 @@
from spacepackets.ecss.pus_1_verification import UnpackParams
from spacepackets.ecss.pus_1_verification import UnpackParams, Service1Tm
from tmtccmd.logging import get_console_logger
from tmtccmd.pus import VerificationWrapper
from tmtccmd.tm.pus_1_verification import Service1TmExtended
from tmtccmd.tm.pus_1_verification import Service1TmExtended, Service1FsfwWrapper
from config.retvals import get_retval_dict
LOGGER = get_console_logger()
def handle_service_1_packet(wrapper: VerificationWrapper, raw_tm: bytes):
def handle_service_1_fsfw_packet(wrapper: VerificationWrapper, raw_tm: bytes):
if wrapper.console_logger is None or wrapper.file_logger is None:
raise ValueError(
"Console logger or file logger not valid. Please set a valid one"
)
tm_packet = Service1TmExtended.unpack(data=raw_tm, params=UnpackParams(1, 1))
# Error code with length 2 is FSFW specific
tm_packet = Service1Tm.unpack(data=raw_tm, params=UnpackParams(1, 2))
fsfw_wrapper = Service1FsfwWrapper(tm_packet)
res = wrapper.verificator.add_tm(tm_packet)
if res is None:
LOGGER.info(
@ -34,8 +36,14 @@ def handle_service_1_packet(wrapper: VerificationWrapper, raw_tm: bytes):
)
else:
retval_string = (
f"Error Code information for code {tm_packet.error_code} | "
f"Error Code information for code {tm_packet.error_code.val:#06x} | "
f"Name: {retval_info.name} | Info: {retval_info.info}"
)
error_param_1_str = f"Error Parameter 1: hex {fsfw_wrapper.error_param_1:#010x} dec{fsfw_wrapper.error_param_1} "
error_param_2_str = f"Error Parameter 2: hex {fsfw_wrapper.error_param_2:#010x} dec {fsfw_wrapper.error_param_2}"
wrapper.console_logger.info(retval_string)
wrapper.file_logger.info(retval_string)
wrapper.console_logger.info(error_param_1_str)
wrapper.file_logger.info(error_param_1_str)
wrapper.console_logger.info(error_param_2_str)
wrapper.file_logger.info(error_param_2_str)