implement packet passing

This commit is contained in:
2022-09-09 14:14:04 +02:00
parent 4cb00a2bb3
commit e769d38d2c
2 changed files with 7 additions and 4 deletions

View File

@ -7,7 +7,8 @@ from typing import Sequence, Optional
from spacepackets import SpacePacket, SpacePacketHeader, PacketTypes
from spacepackets.cfdp import ConditionCode, TransmissionModes, PduType, DirectiveType
from spacepackets.cfdp.pdu import AbstractFileDirectiveBase, PduHolder
from spacepackets.cfdp.pdu import AbstractFileDirectiveBase, PduHolder, PduFactory
from spacepackets.cfdp.pdu.helper import GenericPduPacket
from spacepackets.ecss import PusVerificator
import tmtccmd
@ -79,7 +80,9 @@ class CfdpCcsdsWrapper:
def pass_packet(self, packet: SpacePacket):
# Unwrap the user data and pass it to the handler
pass
pdu_raw = packet.user_data
pdu_base = PduFactory.from_raw(pdu_raw)
self.handler.pass_packet(pdu_base)
class CfdpHandler(CfdpUserBase):
@ -125,7 +128,7 @@ class CfdpHandler(CfdpUserBase):
def confirm_dest_packet_sent(self):
self.dest_handler.confirm_packet_sent_advance_fsm()
def pass_packet(self, packet: AbstractFileDirectiveBase):
def pass_packet(self, packet: GenericPduPacket):
"""This function routes the packets based on PDU type and directive type if applicable.
The routing is based on section 4.5 of the CFDP standard whcih specifies the PDU forwarding