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