From 14b558b7f7621ebe0673a0bcff77105fe84f7c9e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 17 Aug 2023 16:42:53 +0200 Subject: [PATCH] prepare file downlink --- eive_tmtc/pus_tc/tc_handler.py | 22 ++++++++++++++++++---- pyproject.toml | 4 ++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/eive_tmtc/pus_tc/tc_handler.py b/eive_tmtc/pus_tc/tc_handler.py index 596e5ec..f34f965 100644 --- a/eive_tmtc/pus_tc/tc_handler.py +++ b/eive_tmtc/pus_tc/tc_handler.py @@ -1,7 +1,11 @@ import logging from typing import cast -from eive_tmtc.config.definitions import CFDP_REMOTE_ENTITY_ID, PUS_APID +from eive_tmtc.config.definitions import ( + CFDP_REMOTE_ENTITY_ID, + PUS_APID, + CFDP_LOCAL_ENTITY_ID, +) from eive_tmtc.pus_tc.procedure_packer import handle_default_procedure from tmtcc import CfdpInCcsdsWrapper from tmtccmd import TcHandlerBase, ProcedureWrapper @@ -16,6 +20,10 @@ from tmtccmd.tc import ( SendCbParams, TcQueueEntryType, ) +from tmtccmd.config import ( + cfdp_put_req_params_to_procedure, + cfdp_req_to_put_req_proxy_get_req, +) from spacepackets.ecss import PusVerificator from tmtccmd.util import FileSeqCountProvider from spacepackets.cfdp import PduHolder, DirectiveType @@ -36,7 +44,6 @@ class TcHandler(TcHandlerBase): ): super().__init__() self.cfdp_handler_started = False - self.cfdp_dest_id = CFDP_REMOTE_ENTITY_ID self.seq_count_provider = seq_count_provider self.pus_verificator = pus_verificator self.high_level_file_logger = high_level_file_logger @@ -104,8 +111,15 @@ class TcHandler(TcHandlerBase): not self.cfdp_in_ccsds_wrapper.handler.put_request_pending() and not self.cfdp_handler_started ): - put_req = cfdp_procedure.request_wrapper.to_put_request() - put_req.cfg.destination_id = self.cfdp_dest_id + put_req_cfg_wrapper = cfdp_procedure.request_wrapper.to_put_request() + if put_req_cfg_wrapper.cfg.proxy_op: + put_req = cfdp_req_to_put_req_proxy_get_req( + put_req_cfg_wrapper.cfg, + CFDP_REMOTE_ENTITY_ID, + CFDP_LOCAL_ENTITY_ID, + ) + else: + put_req = cfdp_put_req_params_to_procedure(put_req_cfg_wrapper.cfg) _LOGGER.info( f"CFDP: Starting file put request with parameters:\n{put_req}" ) diff --git a/pyproject.toml b/pyproject.toml index e3d3429..a82d4c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,9 +29,9 @@ classifiers = [ "Topic :: Scientific/Engineering" ] dependencies = [ - "tmtccmd ~= 5.0", + # "tmtccmd ~= 5.0", "python-dateutil ~= 2.8", - # "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@1b110d321ef85#egg=tmtccmd" + "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@#egg=cfdp-proxy-op-support" ] [project.urls]