Update FSFW from upstream #71
8
src/fsfw/cfdp.h
Normal file
8
src/fsfw/cfdp.h
Normal 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
|
@ -1,8 +1,5 @@
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE CfdpMessage.cpp CfdpDistributor.cpp CfdpSourceHandler.cpp
|
||||
CfdpDestHandler.cpp FaultHandlerBase.cpp)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE CfdpMessage.cpp CfdpDistributor.cpp)
|
||||
|
||||
# CfdpDistributor.cpp CfdpHandler.cpp
|
||||
add_subdirectory(pdu)
|
||||
add_subdirectory(tlv)
|
||||
add_subdirectory(handler)
|
||||
|
@ -1 +0,0 @@
|
||||
#include "CfdpDestHandler.h"
|
@ -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
|
@ -1 +0,0 @@
|
||||
#include "CfdpSourceHandler.h"
|
2
src/fsfw/cfdp/handler/CMakeLists.txt
Normal file
2
src/fsfw/cfdp/handler/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE SourceHandler.cpp DestHandler.cpp
|
||||
FaultHandlerBase.cpp UserBase.cpp)
|
5
src/fsfw/cfdp/handler/DestHandler.cpp
Normal file
5
src/fsfw/cfdp/handler/DestHandler.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
#include "DestHandler.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
cfdp::DestHandler::DestHandler(LocalEntityCfg cfg) : cfg(std::move(cfg)) {}
|
19
src/fsfw/cfdp/handler/DestHandler.h
Normal file
19
src/fsfw/cfdp/handler/DestHandler.h
Normal 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
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <etl/flat_map.h>
|
||||
|
||||
#include "definitions.h"
|
||||
#include "fsfw/cfdp/definitions.h"
|
||||
|
||||
namespace cfdp {
|
||||
|
1
src/fsfw/cfdp/handler/SourceHandler.cpp
Normal file
1
src/fsfw/cfdp/handler/SourceHandler.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "SourceHandler.h"
|
@ -1,6 +1,6 @@
|
||||
#ifndef FSFW_CFDP_CFDPSOURCEHANDLER_H
|
||||
#define FSFW_CFDP_CFDPSOURCEHANDLER_H
|
||||
|
||||
class CfdpSourceHandler {};
|
||||
class SourceHandler {};
|
||||
|
||||
#endif // FSFW_CFDP_CFDPSOURCEHANDLER_H
|
3
src/fsfw/cfdp/handler/UserBase.cpp
Normal file
3
src/fsfw/cfdp/handler/UserBase.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
#include "UserBase.h"
|
||||
|
||||
cfdp::UserBase::UserBase(HasFileSystemIF& vfs) : vfs(vfs) {}
|
18
src/fsfw/cfdp/handler/UserBase.h
Normal file
18
src/fsfw/cfdp/handler/UserBase.h
Normal 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
|
@ -1,6 +1,12 @@
|
||||
#ifndef FSFW_CFDP_MIB_H
|
||||
#define FSFW_CFDP_MIB_H
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "FaultHandlerBase.h"
|
||||
|
||||
namespace cfdp {
|
||||
|
||||
struct IndicationCfg {
|
||||
bool eofSentIndicRequired = true;
|
||||
bool eofRecvIndicRequired = true;
|
||||
@ -11,8 +17,14 @@ struct IndicationCfg {
|
||||
};
|
||||
|
||||
struct LocalEntityCfg {
|
||||
cfdp::EntityId localId;
|
||||
LocalEntityCfg(EntityId localId, IndicationCfg indicationCfg, FaultHandlerBase& fhBase)
|
||||
: localId(std::move(localId)), indicCfg(indicationCfg), fhBase(fhBase) {}
|
||||
|
||||
EntityId localId;
|
||||
IndicationCfg indicCfg;
|
||||
FaultHandlerBase& fhBase;
|
||||
};
|
||||
|
||||
} // namespace cfdp
|
||||
|
||||
#endif // FSFW_CFDP_MIB_H
|
@ -1,3 +1,11 @@
|
||||
#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") {}
|
||||
}
|
@ -43,12 +43,13 @@ TEST_CASE("CFDP Fault Handler", "[cfdp]") {
|
||||
|
||||
SECTION("Invalid Reported Code") { CHECK(not fhMock.reportFault(ConditionCode::NO_ERROR)); }
|
||||
|
||||
SECTION("Invalid FH code"){
|
||||
CHECK(not fhMock.setFaultHandler(ConditionCode::KEEP_ALIVE_LIMIT_REACHED, FaultHandlerCodes::RESERVED));
|
||||
CHECK(fhMock.getFaultHandler(ConditionCode::KEEP_ALIVE_LIMIT_REACHED, fhCode));
|
||||
CHECK(fhCode == FaultHandlerCodes::IGNORE_ERROR);
|
||||
CHECK(not fhMock.setFaultHandler(ConditionCode::NO_ERROR, FaultHandlerCodes::IGNORE_ERROR));
|
||||
CHECK(not fhMock.getFaultHandler(ConditionCode::NO_ERROR, fhCode));
|
||||
SECTION("Invalid FH code") {
|
||||
CHECK(not fhMock.setFaultHandler(ConditionCode::KEEP_ALIVE_LIMIT_REACHED,
|
||||
FaultHandlerCodes::RESERVED));
|
||||
CHECK(fhMock.getFaultHandler(ConditionCode::KEEP_ALIVE_LIMIT_REACHED, fhCode));
|
||||
CHECK(fhCode == FaultHandlerCodes::IGNORE_ERROR);
|
||||
CHECK(not fhMock.setFaultHandler(ConditionCode::NO_ERROR, FaultHandlerCodes::IGNORE_ERROR));
|
||||
CHECK(not fhMock.getFaultHandler(ConditionCode::NO_ERROR, fhCode));
|
||||
}
|
||||
|
||||
SECTION("Set Other Fault Handler") {
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <map>
|
||||
#include <queue>
|
||||
|
||||
#include "fsfw/cfdp/FaultHandlerBase.h"
|
||||
#include "fsfw/cfdp/handler/FaultHandlerBase.h"
|
||||
|
||||
class CfdpFaultHandlerMock : public cfdp::FaultHandlerBase {
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user