hmm this is tricky from an architecture standpoint

This commit is contained in:
Robin Müller 2022-09-08 15:49:18 +02:00
parent 91711bd928
commit 75e0ef60ce
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 10 additions and 13 deletions

View File

@ -11,8 +11,8 @@ using namespace cfdp;
CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg)
: SystemObject(fsfwParams.objectId),
UserBase(fsfwParams.vfs),
destHandler(DestHandlerParams(cfdpCfg.cfg, *this, *this, cfdpCfg.packetInfoList,
cfdpCfg.lostSegmentsList),
destHandler(DestHandlerParams(cfdpCfg.cfg, *this, cfdpCfg.remoteCfgProvider,
cfdpCfg.packetInfoList, cfdpCfg.lostSegmentsList),
FsfwParams(fsfwParams.packetDest, nullptr, this, fsfwParams.tcStore,
fsfwParams.tmStore)) {
// TODO: Make queue params configurable, or better yet, expect it to be passed externally
@ -75,10 +75,6 @@ void CfdpHandler::abandonedIndication(const cfdp::TransactionId& id, cfdp::Condi
size_t progress) {}
void CfdpHandler::eofRecvIndication(const cfdp::TransactionId& id) {}
bool CfdpHandler::getRemoteCfg(const cfdp::EntityId& remoteId, cfdp::RemoteEntityCfg** cfg) {
return false;
}
ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) {
auto accessorPair = tcStore->getData(msg.getStorageId());
PduHeaderReader reader(accessorPair.second.data(), accessorPair.second.size());
@ -134,7 +130,7 @@ ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) {
// the source handler, for a Finished PDU, it is passed to the destination handler.
FileDirectives ackedDirective;
if (not AckPduReader::checkAckedDirectiveField(pduDataField[1], ackedDirective)) {
// TODO: appropriate error
return INVALID_ACK_DIRECTIVE_FIELDS;
}
if (ackedDirective == FileDirectives::EOF_DIRECTIVE) {
passToSourceHandler();

View File

@ -22,17 +22,21 @@ struct FsfwHandlerParams {
struct CfdpHandlerCfg {
CfdpHandlerCfg(cfdp::LocalEntityCfg cfg, cfdp::PacketInfoListBase& packetInfo,
cfdp::LostSegmentsListBase& lostSegmentsList)
: cfg(std::move(cfg)), packetInfoList(packetInfo), lostSegmentsList(lostSegmentsList) {}
cfdp::LostSegmentsListBase& lostSegmentsList,
cfdp::RemoteConfigTableIF& remoteCfgProvider)
: cfg(std::move(cfg)),
packetInfoList(packetInfo),
lostSegmentsList(lostSegmentsList),
remoteCfgProvider(remoteCfgProvider) {}
cfdp::LocalEntityCfg cfg;
cfdp::PacketInfoListBase& packetInfoList;
cfdp::LostSegmentsListBase& lostSegmentsList;
cfdp::RemoteConfigTableIF& remoteCfgProvider;
};
class CfdpHandler : public SystemObject,
public cfdp::UserBase,
public cfdp::RemoteConfigTableIF,
public ExecutableObjectIF,
public AcceptsTelecommandsIF {
public:
@ -45,9 +49,6 @@ class CfdpHandler : public SystemObject,
ReturnValue_t initialize() override;
ReturnValue_t performOperation(uint8_t operationCode) override;
// CFDP remote table interface
bool getRemoteCfg(const cfdp::EntityId& remoteId, cfdp::RemoteEntityCfg** cfg) override;
// CFDP user overrides
void transactionIndication(const cfdp::TransactionId& id) override;
void eofSentIndication(const cfdp::TransactionId& id) override;