minor improvements

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

View File

@ -4,6 +4,7 @@ from pathlib import Path
from typing import cast
from spacepackets import SpacePacket, SpacePacketHeader
from spacepackets.ccsds import SPACE_PACKET_HEADER_SIZE
from spacepackets.cfdp import (
TransmissionMode,
ChecksumType,
@ -156,9 +157,9 @@ class CfdpInCcsdsWrapper(SpecificApidHandlerBase):
self.handler = cfdp_in_ccsds_handler
def handle_tm(self, packet: bytes, _user_args: any):
ccsds_header_raw = packet[0:6]
sp_header = SpacePacketHeader.unpack(ccsds_header_raw)
pdu = packet[6:]
# Ignore the space packet header. Its only purpose is to use the same protocol and
# have a seaprate APID for space packets. If this function is called, the APID is correct.
pdu = packet[SPACE_PACKET_HEADER_SIZE:]
pdu_base = PduFactory.from_raw(pdu)
if pdu_base.pdu_type == PduType.FILE_DATA:
LOGGER.info("Received File Data PDU TM")