add cfdp components to generic factory
This commit is contained in:
@ -1,12 +1,13 @@
|
||||
#include "GenericFactory.h"
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "common/definitions.h"
|
||||
#include "definitions.h"
|
||||
#include "example/cfdp/Config.h"
|
||||
#include "example/test/FsfwExampleTask.h"
|
||||
#include "example/test/FsfwReaderTask.h"
|
||||
#include "example/utility/TmFunnel.h"
|
||||
#include "fsfw/FSFW.h"
|
||||
#include "fsfw/cfdp.h"
|
||||
#include "fsfw/cfdp/CfdpDistributor.h"
|
||||
#include "fsfw/devicehandlers/CookieIF.h"
|
||||
#include "fsfw/events/EventManager.h"
|
||||
@ -27,6 +28,7 @@
|
||||
#include "fsfw/tcdistribution/PusDistributor.h"
|
||||
#include "fsfw/timemanager/CdsShortTimeStamper.h"
|
||||
#include "fsfw/tmtcservices/VerificationReporter.h"
|
||||
#include "fsfw_hal/host/HostFilesystem.h"
|
||||
#include "fsfw_tests/integration/assemblies/TestAssembly.h"
|
||||
#include "fsfw_tests/integration/controller/TestController.h"
|
||||
#include "fsfw_tests/integration/devices/TestCookie.h"
|
||||
@ -35,8 +37,19 @@
|
||||
#include "fsfw_tests/internal/InternalUnitTester.h"
|
||||
#include "objects/systemObjectList.h"
|
||||
|
||||
#if OBSW_ADD_CFDP_COMPONENTS == 1
|
||||
namespace cfdp {
|
||||
EntityId REMOTE_CFDP_ID(cfdp::WidthInBytes::TWO_BYTES, common::COMMON_CFDP_CLIENT_ENTITY_ID);
|
||||
RemoteEntityCfg GROUND_REMOTE_CFG(REMOTE_CFDP_ID);
|
||||
OneRemoteConfigProvider REMOTE_CFG_PROVIDER(GROUND_REMOTE_CFG);
|
||||
HostFilesystem HOST_FS;
|
||||
ExampleUserHandler USER_HANDLER(HOST_FS);
|
||||
ExampleFaultHandler EXAMPLE_FAULT_HANDLER;
|
||||
} // namespace cfdp
|
||||
#endif
|
||||
|
||||
void ObjectFactory::produceGenericObjects(TmFunnel **tmFunnel, CcsdsDistributor **ccsdsDistrib,
|
||||
StorageManagerIF &tcStore) {
|
||||
StorageManagerIF &tcStore, StorageManagerIF &tmStore) {
|
||||
#if OBSW_ADD_CORE_COMPONENTS == 1
|
||||
/* Framework objects */
|
||||
new EventManager(objects::EVENT_MANAGER);
|
||||
@ -141,6 +154,29 @@ void ObjectFactory::produceGenericObjects(TmFunnel **tmFunnel, CcsdsDistributor
|
||||
InternalUnitTester unittester;
|
||||
unittester.performTests(testCfg);
|
||||
#endif /* OBSW_PERFORM_INTERNAL_UNITTEST == 1 */
|
||||
|
||||
#if OBSW_ADD_CFDP_COMPONENTS == 1
|
||||
using namespace cfdp;
|
||||
auto *msgQueue = QueueFactory::instance()->createMessageQueue(32);
|
||||
UnsignedByteField<uint16_t> remoteEntityId(common::COMMON_CFDP_CLIENT_ENTITY_ID);
|
||||
cfdp::EntityId remoteId(remoteEntityId);
|
||||
cfdp::RemoteEntityCfg remoteCfg(remoteId);
|
||||
remoteCfg.defaultChecksum = cfdp::ChecksumType::CRC_32;
|
||||
FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, **tmFunnel, tcStore, tmStore, *msgQueue);
|
||||
cfdp::IndicationCfg indicationCfg;
|
||||
UnsignedByteField<uint16_t> apid(common::COMMON_CFDP_APID);
|
||||
cfdp::EntityId localId(apid);
|
||||
GROUND_REMOTE_CFG.defaultChecksum = cfdp::ChecksumType::CRC_32;
|
||||
if (PACKET_LIST_PTR == nullptr or LOST_SEGMENTS_PTR == nullptr) {
|
||||
sif::error << "CFDP: No packet list or lost segments container set" << std::endl;
|
||||
}
|
||||
CfdpHandlerCfg cfdpCfg(localId, indicationCfg, USER_HANDLER, EXAMPLE_FAULT_HANDLER,
|
||||
*PACKET_LIST_PTR, *LOST_SEGMENTS_PTR, REMOTE_CFG_PROVIDER);
|
||||
auto *cfdpHandler = new CfdpHandler(params, cfdpCfg);
|
||||
CcsdsDistributorIF::DestInfo info("CFDP Destination", common::COMMON_CFDP_APID,
|
||||
cfdpHandler->getRequestQueue(), true);
|
||||
(*ccsdsDistrib)->registerApplication(info);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Factory::setStaticFrameworkObjectIds() {
|
||||
|
@ -1,13 +1,22 @@
|
||||
#ifndef MISSION_CORE_GENERICFACTORY_H_
|
||||
#define MISSION_CORE_GENERICFACTORY_H_
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include <fsfw/objectmanager/SystemObjectIF.h>
|
||||
|
||||
#include "fsfw/cfdp/handler/DestHandler.h"
|
||||
#include "fsfw/storagemanager/StorageManagerIF.h"
|
||||
|
||||
class TmFunnel;
|
||||
class CcsdsDistributor;
|
||||
|
||||
#if OBSW_ADD_CFDP_COMPONENTS == 1
|
||||
namespace cfdp {
|
||||
extern PacketInfoListBase* PACKET_LIST_PTR;
|
||||
extern LostSegmentsListBase* LOST_SEGMENTS_PTR;
|
||||
} // namespace cfdp
|
||||
#endif
|
||||
|
||||
namespace ObjectFactory {
|
||||
|
||||
/**
|
||||
@ -15,7 +24,7 @@ namespace ObjectFactory {
|
||||
* object factory.
|
||||
*/
|
||||
void produceGenericObjects(TmFunnel** funnel, CcsdsDistributor** ccsdsDistributor,
|
||||
StorageManagerIF& tcStore);
|
||||
StorageManagerIF& tcStore, StorageManagerIF& tmStore);
|
||||
|
||||
} // namespace ObjectFactory
|
||||
|
||||
|
Reference in New Issue
Block a user