end-to-end file transfer working
This commit is contained in:
parent
c9383ca20b
commit
64a58c65dd
@ -11,8 +11,7 @@ using namespace cfdp;
|
|||||||
|
|
||||||
CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg)
|
CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg)
|
||||||
: SystemObject(fsfwParams.objectId),
|
: SystemObject(fsfwParams.objectId),
|
||||||
UserBase(fsfwParams.vfs),
|
destHandler(DestHandlerParams(LocalEntityCfg(cfdpCfg.id, cfdpCfg.indicCfg, *this), cfdpCfg.userHandler,
|
||||||
destHandler(DestHandlerParams(LocalEntityCfg(cfdpCfg.id, cfdpCfg.indicCfg, *this), *this,
|
|
||||||
cfdpCfg.remoteCfgProvider, cfdpCfg.packetInfoList,
|
cfdpCfg.remoteCfgProvider, cfdpCfg.packetInfoList,
|
||||||
cfdpCfg.lostSegmentsList),
|
cfdpCfg.lostSegmentsList),
|
||||||
FsfwParams(fsfwParams.packetDest, nullptr, this, fsfwParams.tcStore,
|
FsfwParams(fsfwParams.packetDest, nullptr, this, fsfwParams.tcStore,
|
||||||
@ -63,20 +62,6 @@ ReturnValue_t CfdpHandler::performOperation(uint8_t operationCode) {
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CfdpHandler::transactionIndication(const cfdp::TransactionId& id) {}
|
|
||||||
void CfdpHandler::eofSentIndication(const cfdp::TransactionId& id) {}
|
|
||||||
void CfdpHandler::transactionFinishedIndication(const cfdp::TransactionFinishedParams& params) {}
|
|
||||||
void CfdpHandler::metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) {}
|
|
||||||
void CfdpHandler::fileSegmentRecvdIndication(const cfdp::FileSegmentRecvdParams& params) {}
|
|
||||||
void CfdpHandler::reportIndication(const cfdp::TransactionId& id, cfdp::StatusReportIF& report) {}
|
|
||||||
void CfdpHandler::suspendedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code) {}
|
|
||||||
void CfdpHandler::resumedIndication(const cfdp::TransactionId& id, size_t progress) {}
|
|
||||||
void CfdpHandler::faultIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code,
|
|
||||||
size_t progress) {}
|
|
||||||
void CfdpHandler::abandonedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code,
|
|
||||||
size_t progress) {}
|
|
||||||
void CfdpHandler::eofRecvIndication(const cfdp::TransactionId& id) {}
|
|
||||||
|
|
||||||
ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) {
|
ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) {
|
||||||
auto accessorPair = tcStore->getData(msg.getStorageId());
|
auto accessorPair = tcStore->getData(msg.getStorageId());
|
||||||
if(accessorPair.first != OK) {
|
if(accessorPair.first != OK) {
|
||||||
|
@ -22,23 +22,26 @@ struct FsfwHandlerParams {
|
|||||||
|
|
||||||
struct CfdpHandlerCfg {
|
struct CfdpHandlerCfg {
|
||||||
CfdpHandlerCfg(cfdp::EntityId localId, cfdp::IndicationCfg indicationCfg,
|
CfdpHandlerCfg(cfdp::EntityId localId, cfdp::IndicationCfg indicationCfg,
|
||||||
cfdp::PacketInfoListBase& packetInfo, cfdp::LostSegmentsListBase& lostSegmentsList,
|
cfdp::UserBase &userHandler,
|
||||||
|
cfdp::PacketInfoListBase& packetInfo,
|
||||||
|
cfdp::LostSegmentsListBase& lostSegmentsList,
|
||||||
cfdp::RemoteConfigTableIF& remoteCfgProvider)
|
cfdp::RemoteConfigTableIF& remoteCfgProvider)
|
||||||
: id(std::move(localId)),
|
: id(std::move(localId)),
|
||||||
indicCfg(indicationCfg),
|
indicCfg(indicationCfg),
|
||||||
packetInfoList(packetInfo),
|
packetInfoList(packetInfo),
|
||||||
lostSegmentsList(lostSegmentsList),
|
lostSegmentsList(lostSegmentsList),
|
||||||
remoteCfgProvider(remoteCfgProvider) {}
|
remoteCfgProvider(remoteCfgProvider),
|
||||||
|
userHandler(userHandler) {}
|
||||||
|
|
||||||
cfdp::EntityId id;
|
cfdp::EntityId id;
|
||||||
cfdp::IndicationCfg indicCfg;
|
cfdp::IndicationCfg indicCfg;
|
||||||
cfdp::PacketInfoListBase& packetInfoList;
|
cfdp::PacketInfoListBase& packetInfoList;
|
||||||
cfdp::LostSegmentsListBase& lostSegmentsList;
|
cfdp::LostSegmentsListBase& lostSegmentsList;
|
||||||
cfdp::RemoteConfigTableIF& remoteCfgProvider;
|
cfdp::RemoteConfigTableIF& remoteCfgProvider;
|
||||||
|
cfdp::UserBase& userHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CfdpHandler : public SystemObject,
|
class CfdpHandler : public SystemObject,
|
||||||
public cfdp::UserBase,
|
|
||||||
public cfdp::FaultHandlerBase,
|
public cfdp::FaultHandlerBase,
|
||||||
public ExecutableObjectIF,
|
public ExecutableObjectIF,
|
||||||
public AcceptsTelecommandsIF {
|
public AcceptsTelecommandsIF {
|
||||||
@ -52,20 +55,6 @@ class CfdpHandler : public SystemObject,
|
|||||||
ReturnValue_t initialize() override;
|
ReturnValue_t initialize() override;
|
||||||
ReturnValue_t performOperation(uint8_t operationCode) override;
|
ReturnValue_t performOperation(uint8_t operationCode) override;
|
||||||
|
|
||||||
// CFDP user overrides
|
|
||||||
void transactionIndication(const cfdp::TransactionId& id) override;
|
|
||||||
void eofSentIndication(const cfdp::TransactionId& id) override;
|
|
||||||
void transactionFinishedIndication(const cfdp::TransactionFinishedParams& params) override;
|
|
||||||
void metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) override;
|
|
||||||
void fileSegmentRecvdIndication(const cfdp::FileSegmentRecvdParams& params) override;
|
|
||||||
void reportIndication(const cfdp::TransactionId& id, cfdp::StatusReportIF& report) override;
|
|
||||||
void suspendedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code) override;
|
|
||||||
void resumedIndication(const cfdp::TransactionId& id, size_t progress) override;
|
|
||||||
void faultIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code,
|
|
||||||
size_t progress) override;
|
|
||||||
void abandonedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code,
|
|
||||||
size_t progress) override;
|
|
||||||
void eofRecvIndication(const cfdp::TransactionId& id) override;
|
|
||||||
void noticeOfSuspensionCb(cfdp::ConditionCode code) override;
|
void noticeOfSuspensionCb(cfdp::ConditionCode code) override;
|
||||||
void noticeOfCancellationCb(cfdp::ConditionCode code) override;
|
void noticeOfCancellationCb(cfdp::ConditionCode code) override;
|
||||||
void abandonCb(cfdp::ConditionCode code) override;
|
void abandonCb(cfdp::ConditionCode code) override;
|
||||||
|
@ -22,6 +22,31 @@
|
|||||||
#include "fsfw/osal/common/TcpTmTcServer.h"
|
#include "fsfw/osal/common/TcpTmTcServer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class CfdpExampleUserHandler: public cfdp::UserBase {
|
||||||
|
public:
|
||||||
|
explicit CfdpExampleUserHandler(HasFileSystemIF& vfs): cfdp::UserBase(vfs) {}
|
||||||
|
|
||||||
|
void transactionIndication(const cfdp::TransactionId& id) override {}
|
||||||
|
void eofSentIndication(const cfdp::TransactionId& id) override {}
|
||||||
|
void transactionFinishedIndication(const cfdp::TransactionFinishedParams& params) override {
|
||||||
|
sif::info << "File transaction finished for transaction with " << params.id << std::endl;
|
||||||
|
}
|
||||||
|
void metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) override {
|
||||||
|
sif::info << "Metadata received for transaction with " << params.id << std::endl;
|
||||||
|
}
|
||||||
|
void fileSegmentRecvdIndication(const cfdp::FileSegmentRecvdParams& params) override {}
|
||||||
|
void reportIndication(const cfdp::TransactionId& id, cfdp::StatusReportIF& report) override {}
|
||||||
|
void suspendedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code) override {}
|
||||||
|
void resumedIndication(const cfdp::TransactionId& id, size_t progress) override {}
|
||||||
|
void faultIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code,
|
||||||
|
size_t progress) override {}
|
||||||
|
void abandonedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code,
|
||||||
|
size_t progress) override {}
|
||||||
|
void eofRecvIndication(const cfdp::TransactionId& id) override {
|
||||||
|
sif::info << "EOF PDU received for transaction with " << id << std::endl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void ObjectFactory::produce(void* args) {
|
void ObjectFactory::produce(void* args) {
|
||||||
Factory::setStaticFrameworkObjectIds();
|
Factory::setStaticFrameworkObjectIds();
|
||||||
StorageManagerIF* tcStore = nullptr;
|
StorageManagerIF* tcStore = nullptr;
|
||||||
@ -74,11 +99,15 @@ void ObjectFactory::produce(void* args) {
|
|||||||
cfdp::IndicationCfg indicationCfg;
|
cfdp::IndicationCfg indicationCfg;
|
||||||
UnsignedByteField<uint16_t> apid(common::COMMON_CFDP_APID);
|
UnsignedByteField<uint16_t> apid(common::COMMON_CFDP_APID);
|
||||||
cfdp::EntityId localId(apid);
|
cfdp::EntityId localId(apid);
|
||||||
cfdp::RemoteEntityCfg remoteCfg;
|
UnsignedByteField<uint16_t> remoteEntityId(common::COMMON_CFDP_CLIENT_ENTITY_ID);
|
||||||
cfdp::OneRemoteConfigProvider remoteCfgProvider(remoteCfg);
|
cfdp::EntityId remoteId(remoteEntityId);
|
||||||
|
cfdp::RemoteEntityCfg remoteCfg(remoteId);
|
||||||
|
remoteCfg.defaultChecksum = cfdp::ChecksumTypes::CRC_32;
|
||||||
|
auto* remoteCfgProvider = new cfdp::OneRemoteConfigProvider(remoteCfg);
|
||||||
|
auto* cfdpUserHandler = new CfdpExampleUserHandler(*hostFs);
|
||||||
cfdp::PacketInfoList<64> packetList;
|
cfdp::PacketInfoList<64> packetList;
|
||||||
cfdp::LostSegmentsList<128> lostSegments;
|
cfdp::LostSegmentsList<128> lostSegments;
|
||||||
CfdpHandlerCfg cfg(localId, indicationCfg, packetList, lostSegments, remoteCfgProvider);
|
CfdpHandlerCfg cfg(localId, indicationCfg, *cfdpUserHandler, packetList, lostSegments, *remoteCfgProvider);
|
||||||
auto* cfdpHandler = new CfdpHandler(params, cfg);
|
auto* cfdpHandler = new CfdpHandler(params, cfg);
|
||||||
CcsdsDistributorIF::DestInfo info("CFDP Destination", common::COMMON_CFDP_APID,
|
CcsdsDistributorIF::DestInfo info("CFDP Destination", common::COMMON_CFDP_APID,
|
||||||
cfdpHandler->getRequestQueue(), true);
|
cfdpHandler->getRequestQueue(), true);
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 22585773e7b31975a0335344036d3b6baa4d0fcb
|
Subproject commit 6b914a21fd52fe184784b90984bb4bc2db82544d
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 382543fc5989c6608e0aa7550ace6aa70f7d78e3
|
Subproject commit 44615c150b7690a3beccf459e3203561f17edf0a
|
@ -1 +1 @@
|
|||||||
Subproject commit 6ee3fa67dc1d34288192b512d4e7cc0927c51b7d
|
Subproject commit 0e1d4516519573fb33319eac7e9a56906a8db1a6
|
Loading…
Reference in New Issue
Block a user