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
1 changed files with 13 additions and 3 deletions

View File

@ -10,6 +10,8 @@ from spacepackets.cfdp import (
ConditionCode,
PduHolder,
DirectiveType,
PduFactory,
PduType,
)
from spacepackets.cfdp.pdu import MetadataPdu, FileDataPdu
from tmtccmd.cfdp import (
@ -157,9 +159,17 @@ class CfdpInCcsdsWrapper(SpecificApidHandlerBase):
ccsds_header_raw = packet[0:6]
sp_header = SpacePacketHeader.unpack(ccsds_header_raw)
pdu = packet[6:]
sp = SpacePacket(sp_header, sec_header=None, user_data=pdu)
print(f"Received TM: {packet.hex(sep=',')}")
self.handler.pass_packet(sp)
pdu_base = PduFactory.from_raw(pdu)
if pdu_base.pdu_type == PduType.FILE_DATA:
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):