need an event reporter proxy

This commit is contained in:
Robin Müller 2022-09-05 11:19:23 +02:00
parent 3dfc882226
commit 0dd2b5ddd4
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 22 additions and 5 deletions

View File

@ -29,13 +29,20 @@ struct PacketInfo {
PacketInfo() = default; PacketInfo() = default;
}; };
template <size_t SIZE>
using LostSegmentsList = etl::set<etl::pair<uint64_t, uint64_t>, SIZE>;
template <size_t SIZE>
using PacketInfoList = etl::list<PacketInfo, SIZE>;
using LostSegmentsListBase = etl::iset<etl::pair<uint64_t, uint64_t>>;
using PacketInfoListBase = etl::ilist<PacketInfo>;
struct DestHandlerParams { struct DestHandlerParams {
DestHandlerParams(LocalEntityCfg cfg, UserBase& user, RemoteConfigTableIF& remoteCfgTable, DestHandlerParams(LocalEntityCfg cfg, UserBase& user, RemoteConfigTableIF& remoteCfgTable,
etl::ilist<PacketInfo>& packetList, PacketInfoListBase& packetList,
// TODO: This container can potentially take tons of space. For a better // TODO: This container can potentially take tons of space. For a better
// memory efficient implementation, an additional abstraction could be // memory efficient implementation, an additional abstraction could be
// be used so users can use uint32_t as the pair type // be used so users can use uint32_t as the pair type
etl::iset<etl::pair<uint64_t, uint64_t>>& lostSegmentsContainer) LostSegmentsListBase& lostSegmentsContainer)
: cfg(std::move(cfg)), : cfg(std::move(cfg)),
user(user), user(user),
remoteCfgTable(remoteCfgTable), remoteCfgTable(remoteCfgTable),
@ -46,8 +53,8 @@ struct DestHandlerParams {
UserBase& user; UserBase& user;
RemoteConfigTableIF& remoteCfgTable; RemoteConfigTableIF& remoteCfgTable;
etl::ilist<PacketInfo>& packetListRef; PacketInfoListBase& packetListRef;
etl::iset<etl::pair<uint64_t, uint64_t>>& lostSegmentsContainer; LostSegmentsListBase& lostSegmentsContainer;
uint8_t maxTlvsInOnePdu = 10; uint8_t maxTlvsInOnePdu = 10;
size_t maxFilenameLen = 255; size_t maxFilenameLen = 255;
}; };

View File

@ -1,20 +1,30 @@
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include "fsfw/cfdp.h" #include "fsfw/cfdp.h"
#include "mocks/AcceptsTmMock.h"
#include "mocks/FilesystemMock.h" #include "mocks/FilesystemMock.h"
#include "mocks/MessageQueueMock.h"
#include "mocks/cfdp/FaultHandlerMock.h" #include "mocks/cfdp/FaultHandlerMock.h"
#include "mocks/cfdp/RemoteConfigTableMock.h" #include "mocks/cfdp/RemoteConfigTableMock.h"
#include "mocks/cfdp/UserMock.h" #include "mocks/cfdp/UserMock.h"
TEST_CASE("CFDP Dest Handler", "[cfdp]") { TEST_CASE("CFDP Dest Handler", "[cfdp]") {
using namespace cfdp; using namespace cfdp;
MessageQueueId_t destQueueId = 2;
AcceptsTmMock tmReceiver(destQueueId);
MessageQueueMock mqMock(destQueueId);
EntityId localId = EntityId(UnsignedByteField<uint16_t>(2)); EntityId localId = EntityId(UnsignedByteField<uint16_t>(2));
auto fhMock = FaultHandlerMock(); auto fhMock = FaultHandlerMock();
auto localEntityCfg = LocalEntityCfg(localId, IndicationCfg(), fhMock); auto localEntityCfg = LocalEntityCfg(localId, IndicationCfg(), fhMock);
auto fsMock = FilesystemMock(); auto fsMock = FilesystemMock();
auto userMock = UserMock(fsMock); auto userMock = UserMock(fsMock);
auto remoteCfgTableMock = RemoteConfigTableMock(); auto remoteCfgTableMock = RemoteConfigTableMock();
// auto destHandler = DestHandler(localEntityCfg, userMock, remoteCfgTableMock); PacketInfoList<64> packetInfoList;
LostSegmentsList<128> lostSegmentsList;
DestHandlerParams dp(localEntityCfg, userMock, remoteCfgTableMock, packetInfoList,
lostSegmentsList);
// FsfwParams fp(destQueueId, mqMock);
// auto destHandler = DestHandler();
SECTION("State") {} SECTION("State") {}
} }