integrate basic cfdp proc support

This commit is contained in:
Robin Müller 2022-09-09 14:46:41 +02:00
parent af8dccb56b
commit 64ade84d51
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -213,6 +213,7 @@ class TcHandler(TcHandlerBase):
self,
pus_apid: int,
seq_count_provider: FileSeqCountProvider,
cfdp_handler: CfdpCcsdsWrapper,
pus_verificator: PusVerificator,
file_logger: logging.Logger,
raw_logger: RawTmtcTimedLogWrapper,
@ -228,41 +229,41 @@ class TcHandler(TcHandlerBase):
seq_cnt_provider=seq_count_provider,
pus_verificator=pus_verificator,
)
self.cfdp_handler = cfdp_handler
def feed_cb(self, info: ProcedureHelper, wrapper: FeedWrapper):
self.queue_helper.queue_wrapper = wrapper.queue_wrapper
if info.proc_type == TcProcedureType.DEFAULT:
self.handle_default_procedure(info)
elif info.proc_type == TcProcedureType.CFDP:
self.handle_cfdp_procedure(info)
def handle_default_procedure(self, info: ProcedureHelper):
def_proc = info.to_def_procedure()
service = def_proc.service
op_code = def_proc.op_code
if service == CoreServiceList.SERVICE_2.value:
return pack_service_2_commands_into(
op_code=op_code, q=self.queue_helper
)
return pack_service_2_commands_into(op_code=op_code, q=self.queue_helper)
if service == CoreServiceList.SERVICE_3.value:
return pack_service_3_commands_into(
op_code=op_code, q=self.queue_helper
)
return pack_service_3_commands_into(op_code=op_code, q=self.queue_helper)
if service == CoreServiceList.SERVICE_5.value:
return pack_generic_service_5_test_into(q=self.queue_helper)
if service == CoreServiceList.SERVICE_8.value:
return pack_service_8_commands_into(
op_code=op_code, q=self.queue_helper
)
return pack_service_8_commands_into(op_code=op_code, q=self.queue_helper)
if service == CoreServiceList.SERVICE_11.value:
return pack_service_11_commands(op_code=op_code, q=self.queue_helper)
if service == CoreServiceList.SERVICE_17.value:
return pack_service_17_commands(op_code=op_code, q=self.queue_helper)
if service == CoreServiceList.SERVICE_20.value:
return pack_service20_commands_into(
q=self.queue_helper, op_code=op_code
)
return pack_service20_commands_into(q=self.queue_helper, op_code=op_code)
if service == CoreServiceList.SERVICE_200.value:
return pack_service_200_commands_into(
q=self.queue_helper, op_code=op_code
)
return pack_service_200_commands_into(q=self.queue_helper, op_code=op_code)
LOGGER.warning("Invalid Service !")
def handle_cfdp_procedure(self, info: ProcedureHelper):
info.to_def_procedure()
pass
def send_cb(self, params: SendCbParams):
if params.entry.is_tc:
if params.entry.entry_type == TcQueueEntryType.PUS_TC: