CFDP integration almost complete
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2022-09-16 17:28:43 +02:00
parent cee114af7e
commit 9411b740ae
7 changed files with 103 additions and 21 deletions

View File

@ -1,9 +1,11 @@
#include "GenericFactory.h"
#include <fsfw/cfdp/handler/CfdpHandler.h>
#include <fsfw/cfdp/handler/RemoteConfigTableIF.h>
#include <fsfw/events/EventManager.h>
#include <fsfw/health/HealthTable.h>
#include <fsfw/internalerror/InternalErrorReporter.h>
#include <fsfw/ipc/QueueFactory.h>
#include <fsfw/pus/CService200ModeCommanding.h>
#include <fsfw/pus/CService201HealthCommanding.h>
#include <fsfw/pus/Service17Test.h>
@ -22,6 +24,7 @@
#include <mission/tmtc/TmFunnel.h>
#include "OBSWConfig.h"
#include "mission/cfdp/Config.h"
#include "eive/definitions.h"
#include "fsfw/pus/Service11TelecommandScheduling.h"
#include "objects/systemObjectList.h"
@ -47,6 +50,20 @@
#define OBSW_TM_TO_PTME 0
#endif
namespace cfdp {
PacketInfoList<64> PACKET_LIST;
LostSegmentsList<128> LOST_SEGMENTS;
EntityId REMOTE_CFDP_ID(UnsignedByteField<uint16_t>(config::EIVE_GROUND_CFDP_ENTITY_ID));
RemoteEntityCfg GROUND_REMOTE_CFG(REMOTE_CFDP_ID);
OneRemoteConfigProvider REMOTE_CFG_PROVIDER(GROUND_REMOTE_CFG);
HostFilesystem HOST_FS;
EiveUserHandler USER_HANDLER(HOST_FS);
EiveFaultHandler EIVE_FAULT_HANDLER;
}
void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) {
// Framework objects
new EventManager(objects::EVENT_MANAGER);
@ -135,25 +152,19 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) {
#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);
using namespace cfdp;
auto* msgQueue = QueueFactory::instance()->createMessageQueue(32);
FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, *funnel, *tcStore, *tmStore, *msgQueue);
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);
UnsignedByteField<uint16_t> apid(config::EIVE_LOCAL_CFDP_ENTITY_ID);
cfdp::EntityId localId(apid);
GROUND_REMOTE_CFG.defaultChecksum = cfdp::ChecksumType::CRC_32;
CfdpHandlerCfg cfg(localId, indicationCfg, USER_HANDLER, EIVE_FAULT_HANDLER, PACKET_LIST,
LOST_SEGMENTS, REMOTE_CFG_PROVIDER);
auto* cfdpHandler = new CfdpHandler(params, cfg);
// All CFDP packets arrive wrapped inside CCSDS space packets
CcsdsDistributorIF::DestInfo info("CFDP Destination", config::EIVE_CFDP_APID,
cfdpHandler->getRequestQueue(), true);
ccsdsDistrib->registerApplication(info);
#endif
}