basic printout for received PDU TMs

This commit is contained in:
Robin Müller 2022-10-19 11:49:44 +02:00
parent 34203461fa
commit 9abfba1e0e
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -10,6 +10,8 @@ from spacepackets.cfdp import (
ConditionCode, ConditionCode,
PduHolder, PduHolder,
DirectiveType, DirectiveType,
PduFactory,
PduType,
) )
from spacepackets.cfdp.pdu import MetadataPdu, FileDataPdu from spacepackets.cfdp.pdu import MetadataPdu, FileDataPdu
from tmtccmd.cfdp import ( from tmtccmd.cfdp import (
@ -157,9 +159,17 @@ class CfdpInCcsdsWrapper(SpecificApidHandlerBase):
ccsds_header_raw = packet[0:6] ccsds_header_raw = packet[0:6]
sp_header = SpacePacketHeader.unpack(ccsds_header_raw) sp_header = SpacePacketHeader.unpack(ccsds_header_raw)
pdu = packet[6:] pdu = packet[6:]
sp = SpacePacket(sp_header, sec_header=None, user_data=pdu) pdu_base = PduFactory.from_raw(pdu)
print(f"Received TM: {packet.hex(sep=',')}") if pdu_base.pdu_type == PduType.FILE_DATA:
self.handler.pass_packet(sp) LOGGER.info("Received File Data PDU TM")
else:
if pdu_base.directive_type == DirectiveType.FINISHED_PDU:
LOGGER.info(f"Received Finished PDU TM")
else:
LOGGER.info(
f"Received File Directive PDU with type {pdu_base.directive_type!r} TM"
)
self.handler.pass_pdu_packet(pdu_base)
class PusHandler(SpecificApidHandlerBase): class PusHandler(SpecificApidHandlerBase):