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