CFDP FSFW Integration #111

Merged
muellerr merged 170 commits from cfdp-integration into develop 2022-09-16 11:11:22 +02:00
18 changed files with 90 additions and 33 deletions
Showing only changes of commit dce1ebcf65 - Show all commits

8
src/fsfw/cfdp.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef FSFW_CFDP_H
#define FSFW_CFDP_H
#include "cfdp/definitions.h"
#include "cfdp/handler/DestHandler.h"
#include "cfdp/handler/FaultHandlerBase.h"
#endif // FSFW_CFDP_H

View File

@ -1,8 +1,5 @@
target_sources( target_sources(${LIB_FSFW_NAME} PRIVATE CfdpMessage.cpp CfdpDistributor.cpp)
${LIB_FSFW_NAME}
PRIVATE CfdpMessage.cpp CfdpDistributor.cpp CfdpSourceHandler.cpp
CfdpDestHandler.cpp FaultHandlerBase.cpp)
# CfdpDistributor.cpp CfdpHandler.cpp
add_subdirectory(pdu) add_subdirectory(pdu)
add_subdirectory(tlv) add_subdirectory(tlv)
add_subdirectory(handler)

View File

@ -1 +0,0 @@
#include "CfdpDestHandler.h"

View File

@ -1,15 +0,0 @@
#ifndef FSFW_CFDP_CFDPDESTHANDLER_H
#define FSFW_CFDP_CFDPDESTHANDLER_H
#include <etl/flat_map.h>
#include "fsfw/cfdp/pdu/PduConfig.h"
class CfdpDestHandler {
public:
CfdpDestHandler();
private:
};
#endif // FSFW_CFDP_CFDPDESTHANDLER_H

View File

@ -1 +0,0 @@
#include "CfdpSourceHandler.h"

View File

@ -0,0 +1,2 @@
target_sources(${LIB_FSFW_NAME} PRIVATE SourceHandler.cpp DestHandler.cpp
FaultHandlerBase.cpp UserBase.cpp)

View File

@ -0,0 +1,5 @@
#include "DestHandler.h"
#include <utility>
cfdp::DestHandler::DestHandler(LocalEntityCfg cfg) : cfg(std::move(cfg)) {}

View File

@ -0,0 +1,19 @@
#ifndef FSFW_CFDP_CFDPDESTHANDLER_H
#define FSFW_CFDP_CFDPDESTHANDLER_H
#include "fsfw/cfdp/handler/mib.h"
#include "fsfw/cfdp/pdu/PduConfig.h"
namespace cfdp {
class DestHandler {
public:
DestHandler(LocalEntityCfg cfg /*, CfdpUserBase& user, RemoteConfigTableIF& remoteConfigTable*/);
private:
LocalEntityCfg cfg;
};
} // namespace cfdp
#endif // FSFW_CFDP_CFDPDESTHANDLER_H

View File

@ -3,7 +3,7 @@
#include <etl/flat_map.h> #include <etl/flat_map.h>
#include "definitions.h" #include "fsfw/cfdp/definitions.h"
namespace cfdp { namespace cfdp {

View File

@ -0,0 +1 @@
#include "SourceHandler.h"

View File

@ -1,6 +1,6 @@
#ifndef FSFW_CFDP_CFDPSOURCEHANDLER_H #ifndef FSFW_CFDP_CFDPSOURCEHANDLER_H
#define FSFW_CFDP_CFDPSOURCEHANDLER_H #define FSFW_CFDP_CFDPSOURCEHANDLER_H
class CfdpSourceHandler {}; class SourceHandler {};
#endif // FSFW_CFDP_CFDPSOURCEHANDLER_H #endif // FSFW_CFDP_CFDPSOURCEHANDLER_H

View File

@ -0,0 +1,3 @@
#include "UserBase.h"
cfdp::UserBase::UserBase(HasFileSystemIF& vfs) : vfs(vfs) {}

View File

@ -0,0 +1,18 @@
#ifndef FSFW_CFDP_USERBASE_H
#define FSFW_CFDP_USERBASE_H
#include "fsfw/memory/HasFileSystemIF.h"
namespace cfdp {
class UserBase {
public:
explicit UserBase(HasFileSystemIF& vfs);
private:
HasFileSystemIF& vfs;
};
} // namespace cfdp
#endif // FSFW_CFDP_USERBASE_H

View File

@ -1,6 +1,12 @@
#ifndef FSFW_CFDP_MIB_H #ifndef FSFW_CFDP_MIB_H
#define FSFW_CFDP_MIB_H #define FSFW_CFDP_MIB_H
#include <utility>
#include "FaultHandlerBase.h"
namespace cfdp {
struct IndicationCfg { struct IndicationCfg {
bool eofSentIndicRequired = true; bool eofSentIndicRequired = true;
bool eofRecvIndicRequired = true; bool eofRecvIndicRequired = true;
@ -11,8 +17,14 @@ struct IndicationCfg {
}; };
struct LocalEntityCfg { struct LocalEntityCfg {
cfdp::EntityId localId; LocalEntityCfg(EntityId localId, IndicationCfg indicationCfg, FaultHandlerBase& fhBase)
: localId(std::move(localId)), indicCfg(indicationCfg), fhBase(fhBase) {}
EntityId localId;
IndicationCfg indicCfg; IndicationCfg indicCfg;
FaultHandlerBase& fhBase;
}; };
} // namespace cfdp
#endif // FSFW_CFDP_MIB_H #endif // FSFW_CFDP_MIB_H

View File

@ -1,3 +1,11 @@
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
TEST_CASE("CFDP Dest Handler", "[cfdp]") {} #include "fsfw/cfdp.h"
TEST_CASE("CFDP Dest Handler", "[cfdp]") {
using namespace cfdp;
// auto localEntityCfg = LocalEntityCfg();
// auto destHandler = DestHandler();
SECTION("State") {}
}

View File

@ -43,8 +43,9 @@ TEST_CASE("CFDP Fault Handler", "[cfdp]") {
SECTION("Invalid Reported Code") { CHECK(not fhMock.reportFault(ConditionCode::NO_ERROR)); } SECTION("Invalid Reported Code") { CHECK(not fhMock.reportFault(ConditionCode::NO_ERROR)); }
SECTION("Invalid FH code"){ SECTION("Invalid FH code") {
CHECK(not fhMock.setFaultHandler(ConditionCode::KEEP_ALIVE_LIMIT_REACHED, FaultHandlerCodes::RESERVED)); CHECK(not fhMock.setFaultHandler(ConditionCode::KEEP_ALIVE_LIMIT_REACHED,
FaultHandlerCodes::RESERVED));
CHECK(fhMock.getFaultHandler(ConditionCode::KEEP_ALIVE_LIMIT_REACHED, fhCode)); CHECK(fhMock.getFaultHandler(ConditionCode::KEEP_ALIVE_LIMIT_REACHED, fhCode));
CHECK(fhCode == FaultHandlerCodes::IGNORE_ERROR); CHECK(fhCode == FaultHandlerCodes::IGNORE_ERROR);
CHECK(not fhMock.setFaultHandler(ConditionCode::NO_ERROR, FaultHandlerCodes::IGNORE_ERROR)); CHECK(not fhMock.setFaultHandler(ConditionCode::NO_ERROR, FaultHandlerCodes::IGNORE_ERROR));

View File

@ -4,7 +4,7 @@
#include <map> #include <map>
#include <queue> #include <queue>
#include "fsfw/cfdp/FaultHandlerBase.h" #include "fsfw/cfdp/handler/FaultHandlerBase.h"
class CfdpFaultHandlerMock : public cfdp::FaultHandlerBase { class CfdpFaultHandlerMock : public cfdp::FaultHandlerBase {
public: public: