start integrating cfdp code
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2022-09-16 12:14:27 +02:00
parent 547fcf22dd
commit 6b48fb64d8
6 changed files with 38 additions and 11 deletions

View File

@ -1,5 +1,6 @@
#include "GenericFactory.h"
#include <fsfw/cfdp/handler/CfdpHandler.h>
#include <fsfw/events/EventManager.h>
#include <fsfw/health/HealthTable.h>
#include <fsfw/internalerror/InternalErrorReporter.h>
@ -17,6 +18,7 @@
#include <fsfw/tcdistribution/CcsdsDistributor.h>
#include <fsfw/tcdistribution/PusDistributor.h>
#include <fsfw/timemanager/CdsShortTimeStamper.h>
#include <fsfw_hal/host/HostFilesystem.h>
#include <mission/tmtc/TmFunnel.h>
#include "OBSWConfig.h"
@ -56,17 +58,18 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) {
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
new VerificationReporter();
auto* timeStamper = new CdsShortTimeStamper(objects::TIME_STAMPER);
StorageManagerIF* tcStore;
StorageManagerIF* tmStore;
{
PoolManager::LocalPoolConfig poolCfg = {{300, 16}, {300, 32}, {200, 64},
{200, 128}, {100, 1024}, {10, 2048}};
new PoolManager(objects::TC_STORE, poolCfg);
tcStore = new PoolManager(objects::TC_STORE, poolCfg);
}
{
PoolManager::LocalPoolConfig poolCfg = {{300, 16}, {300, 32}, {100, 64},
{100, 128}, {100, 1024}, {10, 2048}};
new PoolManager(objects::TM_STORE, poolCfg);
tmStore = new PoolManager(objects::TM_STORE, poolCfg);
}
{
@ -83,7 +86,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) {
vc = config::LIVE_TM;
#endif
// Every TM packet goes through this funnel
new TmFunnel(objects::TM_FUNNEL, *timeStamper, 50, vc);
auto* funnel = new TmFunnel(objects::TM_FUNNEL, *timeStamper, 50, vc);
// PUS service stack
new Service1TelecommandVerification(objects::PUS_SERVICE_1_VERIFICATION, apid::EIVE_OBSW,
@ -129,4 +132,27 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) {
#endif /* OBSW_USE_TMTC_TCP_BRIDGE == 0 */
tmtcBridge->setMaxNumberOfPacketsStored(300);
#endif /* OBSW_ADD_TCPIP_BRIDGE == 1 */
#if OBSW_ADD_CFDP_COMPONENTS == 1
auto* hostFs = new HostFilesystem();
FsfwHandlerParams params(objects::CFDP_HANDLER, *hostFs, *funnel, *tcStore, *tmStore);
// cfdp::IndicationCfg indicationCfg;
// UnsignedByteField<uint16_t> apid(common::COMMON_CFDP_APID);
// cfdp::EntityId localId(apid);
// UnsignedByteField<uint16_t> remoteEntityId(common::COMMON_CFDP_CLIENT_ENTITY_ID);
// 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);
// auto* cfdpFaultHandler = new CfdpExampleFaultHandler();
// cfdp::PacketInfoList<64> packetList;
// cfdp::LostSegmentsList<128> lostSegments;
// CfdpHandlerCfg cfg(localId, indicationCfg, *cfdpUserHandler, *cfdpFaultHandler, packetList,
// lostSegments, *remoteCfgProvider);
// auto* cfdpHandler = new CfdpHandler(params, cfg);
// CcsdsDistributorIF::DestInfo info("CFDP Destination", common::COMMON_CFDP_APID,
// cfdpHandler->getRequestQueue(), true);
// ccsdsDistrib->registerApplication(info);
#endif
}