This commit is contained in:
Robin Müller 2022-10-27 15:21:56 +02:00
parent 4420bf3df9
commit 10cca44fbe
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -97,7 +97,6 @@ from pus_tc.procedure_packer import handle_default_procedure
LOGGER = get_console_logger()
# Put rotating file logger parameters here for quick changes
ROTATING_TIMED_LOGGER_INTERVAL_WHEN = TimedLogWhen.PER_MINUTE
ROTATING_TIMED_LOGGER_INTERVAL = 30
@ -226,6 +225,7 @@ class TcHandler(TcHandlerBase):
pus_verificator=pus_verificator,
)
self.cfdp_in_ccsds_wrapper = cfdp_in_ccsds_wrapper
# self.cfdp_counter = 0
def cfdp_done(self) -> bool:
return not self.cfdp_in_ccsds_wrapper.handler.put_request_pending()
@ -259,6 +259,13 @@ class TcHandler(TcHandlerBase):
elif entry_helper.entry_type == TcQueueEntryType.CCSDS_TC:
cfdp_packet_in_ccsds = entry_helper.to_space_packet_entry()
send_params.com_if.send(cfdp_packet_in_ccsds.space_packet.pack())
# TODO: Log raw CFDP packets similarly to how PUS packets are logged.
# - Log full raw format including space packet wrapper
# - Log context information: Transaction ID, and PDU type and directive
# print(f"sending packet: [{cfdp_packet_in_ccsds.space_packet.pack()}]")
# with open(f"cfdp_packet_{self.cfdp_counter}", "wb") as of:
# of.write(cfdp_packet_in_ccsds.space_packet.pack())
# self.cfdp_counter += 1
elif entry_helper.entry_type == TcQueueEntryType.LOG:
log_entry = entry_helper.to_log_entry()
LOGGER.info(log_entry.log_str)