send wrapped CFDP packets and clean up printout

This commit is contained in:
Robin Müller 2022-09-13 13:54:47 +02:00
parent a3d1808457
commit 6ee3fa67dc
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -22,11 +22,10 @@ from tmtccmd.cfdp import (
IndicationCfg, IndicationCfg,
TransactionId, TransactionId,
) )
from spacepackets.util import UnsignedByteField
from tmtccmd.cfdp.defs import CfdpRequestType, CfdpStates from tmtccmd.cfdp.defs import CfdpRequestType, CfdpStates
from tmtccmd.cfdp.handler import SourceHandler, DestHandler from tmtccmd.cfdp.handler import SourceHandler, DestHandler
from tmtccmd.cfdp.mib import DefaultFaultHandlerBase from tmtccmd.cfdp.mib import DefaultFaultHandlerBase
from tmtccmd.cfdp.request import PutRequest, PutRequestCfg from tmtccmd.cfdp.request import PutRequest
from tmtccmd.cfdp.user import ( from tmtccmd.cfdp.user import (
FileSegmentRecvdParams, FileSegmentRecvdParams,
MetadataRecvParams, MetadataRecvParams,
@ -432,25 +431,26 @@ class TcHandler(TcHandlerBase):
pdu_holder, pdu_holder,
packet, packet,
) = self.cfdp_in_ccsds_wrapper.pull_next_source_packet() ) = self.cfdp_in_ccsds_wrapper.pull_next_source_packet()
print(pdu_holder) # print(pdu_holder)
self.cfdp_in_ccsds_wrapper.confirm_source_packet_sent() self.cfdp_in_ccsds_wrapper.confirm_source_packet_sent()
self.queue_helper.add_ccsds_tc(packet) self.queue_helper.add_ccsds_tc(packet)
self.queue_helper.add_log_cmd("CFDP Source: Sending Metadata PDU")
( (
pdu_holder, pdu_holder,
packet, packet,
) = self.cfdp_in_ccsds_wrapper.pull_next_source_packet() ) = self.cfdp_in_ccsds_wrapper.pull_next_source_packet()
print(pdu_holder) # print(pdu_holder)
self.cfdp_in_ccsds_wrapper.confirm_source_packet_sent() self.cfdp_in_ccsds_wrapper.confirm_source_packet_sent()
self.queue_helper.add_ccsds_tc(packet) self.queue_helper.add_ccsds_tc(packet)
# for sp in self.cfdp_in_ccsds_wrapper: self.queue_helper.add_log_cmd("CFDP Source: Sending File Data PDU")
# print(sp)
# self.queue_helper.add_ccsds_tc(sp)
pass
def send_cb(self, params: SendCbParams): def send_cb(self, params: SendCbParams):
if params.entry.is_tc: if params.entry.is_tc:
if params.entry.entry_type == TcQueueEntryType.PUS_TC: if params.entry.entry_type == TcQueueEntryType.PUS_TC:
self.handle_tc_send_cb(params) self.handle_tc_send_cb(params)
elif params.entry.entry_type == TcQueueEntryType.CCSDS_TC:
cfdp_packet_in_ccsds = params.entry.to_space_packet_entry()
params.com_if.send(cfdp_packet_in_ccsds.space_packet.pack())
elif params.entry.entry_type == TcQueueEntryType.LOG: elif params.entry.entry_type == TcQueueEntryType.LOG:
log_entry = params.entry.to_log_entry() log_entry = params.entry.to_log_entry()
LOGGER.info(log_entry.log_str) LOGGER.info(log_entry.log_str)