integrate basic cfdp proc support
This commit is contained in:
parent
af8dccb56b
commit
64ade84d51
61
common.py
61
common.py
@ -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,40 +229,40 @@ 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:
|
||||
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
|
||||
)
|
||||
if service == CoreServiceList.SERVICE_3.value:
|
||||
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
|
||||
)
|
||||
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
|
||||
)
|
||||
if service == CoreServiceList.SERVICE_200.value:
|
||||
return pack_service_200_commands_into(
|
||||
q=self.queue_helper, op_code=op_code
|
||||
)
|
||||
LOGGER.warning("Invalid Service !")
|
||||
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)
|
||||
if service == CoreServiceList.SERVICE_3.value:
|
||||
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)
|
||||
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)
|
||||
if service == CoreServiceList.SERVICE_200.value:
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user