fsfw-example-stm32h7-freertos/bsp_stm32h7_freertos/core/ObjectFactory.cpp

61 lines
1.8 KiB
C++
Raw Normal View History

2021-07-12 21:50:48 +02:00
#include "ObjectFactory.h"
2021-07-12 23:33:05 +02:00
#include "OBSWConfig.h"
2021-07-12 21:50:48 +02:00
#include <objects/systemObjectList.h>
#include <mission/utility/TmFunnel.h>
#include <mission/core/GenericFactory.h>
2021-07-12 23:33:05 +02:00
#if OBSW_ADD_LWIP_COMPONENTS == 1
#include "example_common/stm32h7/networking/UdpTcLwIpPollingTask.h"
#include "example_common/stm32h7/networking/TmTcLwIpUdpBridge.h"
#endif /* OBSW_ADD_LWIP_COMPONENTS == 1 */
#include "example_common/stm32h7/STM32TestTask.h"
2021-07-12 21:50:48 +02:00
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
#include <fsfw/monitoring/MonitoringMessageContent.h>
#include <fsfw/storagemanager/PoolManager.h>
2021-07-12 23:33:05 +02:00
#include <fsfw/tmtcpacket/pus/tm.h>
2021-07-12 21:50:48 +02:00
#include <fsfw/tmtcservices/CommandingServiceBase.h>
#include <fsfw/tmtcservices/PusServiceBase.h>
2021-07-12 23:33:05 +02:00
void ObjectFactory::produce(void* args) {
2021-07-12 21:50:48 +02:00
/* Located inside GenericFactory source file */
Factory::setStaticFrameworkObjectIds();
#if OBSW_ADD_CORE_COMPONENTS == 1
{
LocalPool::LocalPoolConfig poolCfg = {
{100, 32}, {30, 64}, {10, 128}, {2, 1024}
};
new PoolManager(objects::TC_STORE, poolCfg);
}
{
LocalPool::LocalPoolConfig poolCfg = {
{100, 32}, {30, 64}, {10, 128}, {2, 1024}
};
new PoolManager(objects::TM_STORE, poolCfg);
}
{
LocalPool::LocalPoolConfig poolCfg = {
{100, 32}, {30, 64}, {10, 128}, {2, 1024}
};
new PoolManager(objects::IPC_STORE, poolCfg);
}
2021-07-12 23:33:05 +02:00
#if OBSW_ADD_LWIP_COMPONENTS == 1
2021-07-12 21:50:48 +02:00
/* UDP Server */
new TmTcLwIpUdpBridge(objects::UDP_BRIDGE,
objects::CCSDS_DISTRIBUTOR, objects::TM_STORE, objects::TC_STORE);
new UdpTcLwIpPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE);
2021-07-12 23:33:05 +02:00
#endif /* OBSW_ADD_LWIP_COMPONENTS == 1 */
2021-07-12 21:50:48 +02:00
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
ObjectFactory::produceGenericObjects();
/* Test Device Handler */
new STM32TestTask(objects::TEST_TASK, false, true);
}