apply auto-formatter
All checks were successful
fsfw/fsfw example hosted/pipeline/head This commit looks good
All checks were successful
fsfw/fsfw example hosted/pipeline/head This commit looks good
This commit is contained in:
@ -1,12 +1,7 @@
|
||||
#include <OBSWConfig.h>
|
||||
|
||||
#include <bsp_hosted/core/InitMission.h>
|
||||
#include <bsp_hosted/fsfwconfig/objects/systemObjectList.h>
|
||||
#include <bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h>
|
||||
#include "example/utility/TaskCreation.h"
|
||||
|
||||
#include "fsfw_tests/integration/assemblies/TestAssembly.h"
|
||||
|
||||
#include <fsfw/modes/HasModesIF.h>
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
@ -14,281 +9,273 @@
|
||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
|
||||
#include "example/utility/TaskCreation.h"
|
||||
#include "fsfw_tests/integration/assemblies/TestAssembly.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <fsfw/osal/windows/winTaskHelpers.h>
|
||||
#endif
|
||||
|
||||
|
||||
void InitMission::createTasks() {
|
||||
TaskFactory* taskFactory = TaskFactory::instance();
|
||||
if(taskFactory == nullptr) {
|
||||
return;
|
||||
}
|
||||
TaskFactory* taskFactory = TaskFactory::instance();
|
||||
if (taskFactory == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
TaskPriority currPrio;
|
||||
TaskPriority currPrio;
|
||||
#ifdef _WIN32
|
||||
currPrio = tasks::makeWinPriority();
|
||||
currPrio = tasks::makeWinPriority();
|
||||
#endif
|
||||
|
||||
TaskDeadlineMissedFunction deadlineMissedFunc = nullptr;
|
||||
TaskDeadlineMissedFunction deadlineMissedFunc = nullptr;
|
||||
#if OBSW_PRINT_MISSED_DEADLINES == 1
|
||||
deadlineMissedFunc = TaskFactory::printMissedDeadline;
|
||||
deadlineMissedFunc = TaskFactory::printMissedDeadline;
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_CORE_COMPONENTS == 1
|
||||
|
||||
#ifdef __unix__
|
||||
currPrio = 40;
|
||||
currPrio = 40;
|
||||
#endif
|
||||
/* TMTC Distribution */
|
||||
PeriodicTaskIF* distributerTask = taskFactory->createPeriodicTask(
|
||||
"DIST", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.1, deadlineMissedFunc);
|
||||
ReturnValue_t result = distributerTask->addComponent(
|
||||
objects::CCSDS_DISTRIBUTOR);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("CCSDS distributor", objects::CCSDS_DISTRIBUTOR);
|
||||
}
|
||||
result = distributerTask->addComponent(objects::PUS_DISTRIBUTOR);
|
||||
if (result!=HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS distributor", objects::PUS_DISTRIBUTOR);
|
||||
}
|
||||
result = distributerTask->addComponent(objects::TM_FUNNEL);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("TM funnel", objects::TM_FUNNEL);
|
||||
}
|
||||
/* TMTC Distribution */
|
||||
PeriodicTaskIF* distributerTask = taskFactory->createPeriodicTask(
|
||||
"DIST", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.1, deadlineMissedFunc);
|
||||
ReturnValue_t result = distributerTask->addComponent(objects::CCSDS_DISTRIBUTOR);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("CCSDS distributor", objects::CCSDS_DISTRIBUTOR);
|
||||
}
|
||||
result = distributerTask->addComponent(objects::PUS_DISTRIBUTOR);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS distributor", objects::PUS_DISTRIBUTOR);
|
||||
}
|
||||
result = distributerTask->addComponent(objects::TM_FUNNEL);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("TM funnel", objects::TM_FUNNEL);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
currPrio = 50;
|
||||
currPrio = 50;
|
||||
#endif
|
||||
/* UDP bridge */
|
||||
PeriodicTaskIF* udpBridgeTask = taskFactory->createPeriodicTask(
|
||||
"TCPIP_TMTC_BRIDGE", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2,
|
||||
deadlineMissedFunc
|
||||
);
|
||||
result = udpBridgeTask->addComponent(objects::TCPIP_TMTC_BRIDGE);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("TMTC bridge", objects::TCPIP_TMTC_BRIDGE);
|
||||
}
|
||||
/* UDP bridge */
|
||||
PeriodicTaskIF* udpBridgeTask = taskFactory->createPeriodicTask(
|
||||
"TCPIP_TMTC_BRIDGE", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, deadlineMissedFunc);
|
||||
result = udpBridgeTask->addComponent(objects::TCPIP_TMTC_BRIDGE);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("TMTC bridge", objects::TCPIP_TMTC_BRIDGE);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
currPrio = 80;
|
||||
currPrio = 80;
|
||||
#endif
|
||||
PeriodicTaskIF* udpPollingTask = taskFactory->createPeriodicTask(
|
||||
"TMTC_POLLING", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc
|
||||
);
|
||||
result = udpPollingTask->addComponent(objects::TCPIP_TMTC_POLLING_TASK);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("TMTC polling", objects::TCPIP_TMTC_POLLING_TASK);
|
||||
}
|
||||
PeriodicTaskIF* udpPollingTask = taskFactory->createPeriodicTask(
|
||||
"TMTC_POLLING", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc);
|
||||
result = udpPollingTask->addComponent(objects::TCPIP_TMTC_POLLING_TASK);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("TMTC polling", objects::TCPIP_TMTC_POLLING_TASK);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
currPrio = 20;
|
||||
currPrio = 20;
|
||||
#endif
|
||||
PeriodicTaskIF* eventTask = taskFactory->createPeriodicTask(
|
||||
"EVENT", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.100, deadlineMissedFunc
|
||||
);
|
||||
result = eventTask->addComponent(objects::EVENT_MANAGER);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("Event Manager", objects::EVENT_MANAGER);
|
||||
}
|
||||
PeriodicTaskIF* eventTask = taskFactory->createPeriodicTask(
|
||||
"EVENT", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.100, deadlineMissedFunc);
|
||||
result = eventTask->addComponent(objects::EVENT_MANAGER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("Event Manager", objects::EVENT_MANAGER);
|
||||
}
|
||||
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
||||
|
||||
#if OBSW_ADD_TASK_EXAMPLE == 1
|
||||
|
||||
#ifdef __unix__
|
||||
currPrio = 50;
|
||||
currPrio = 50;
|
||||
#endif
|
||||
FixedTimeslotTaskIF* timeslotDemoTask = taskFactory->createFixedTimeslotTask(
|
||||
"PST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, deadlineMissedFunc);
|
||||
result = pst::pollingSequenceExamples(timeslotDemoTask);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
FixedTimeslotTaskIF* timeslotDemoTask = taskFactory->createFixedTimeslotTask(
|
||||
"PST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, deadlineMissedFunc);
|
||||
result = pst::pollingSequenceExamples(timeslotDemoTask);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "InitMission::createTasks: Timeslot demo task initialization failed!" <<
|
||||
std::endl;
|
||||
sif::error << "InitMission::createTasks: Timeslot demo task initialization failed!"
|
||||
<< std::endl;
|
||||
#else
|
||||
sif::printError("InitMission::createTasks: Timeslot demo task initialization failed!\n");
|
||||
sif::printError("InitMission::createTasks: Timeslot demo task initialization failed!\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
currPrio = 40;
|
||||
currPrio = 40;
|
||||
#endif
|
||||
PeriodicTaskIF* readerTask = taskFactory->createPeriodicTask(
|
||||
"READER_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc);
|
||||
result = readerTask->addComponent(objects::TEST_DUMMY_4);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("Dummy 4", objects::TEST_DUMMY_4);
|
||||
}
|
||||
PeriodicTaskIF* readerTask = taskFactory->createPeriodicTask(
|
||||
"READER_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc);
|
||||
result = readerTask->addComponent(objects::TEST_DUMMY_4);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("Dummy 4", objects::TEST_DUMMY_4);
|
||||
}
|
||||
#endif /* OBSW_ADD_TASK_EXAMPLE == 1 */
|
||||
|
||||
|
||||
#if OBSW_ADD_PUS_STACK == 1
|
||||
/* PUS Services */
|
||||
/* PUS Services */
|
||||
#ifdef __unix__
|
||||
currPrio = 45;
|
||||
currPrio = 45;
|
||||
#endif
|
||||
PeriodicTaskIF* pusVerification = taskFactory->createPeriodicTask(
|
||||
"PUS_VERIF_1", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, deadlineMissedFunc);
|
||||
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 1", objects::PUS_SERVICE_1_VERIFICATION);
|
||||
}
|
||||
PeriodicTaskIF* pusVerification = taskFactory->createPeriodicTask(
|
||||
"PUS_VERIF_1", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, deadlineMissedFunc);
|
||||
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 1", objects::PUS_SERVICE_1_VERIFICATION);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
currPrio = 50;
|
||||
currPrio = 50;
|
||||
#endif
|
||||
PeriodicTaskIF* pusHighPrio = taskFactory->createPeriodicTask(
|
||||
"PUS_HIGH_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, deadlineMissedFunc);
|
||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||
}
|
||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK){
|
||||
task::printInitError("PUS 5",objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||
}
|
||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 9", objects::PUS_SERVICE_9_TIME_MGMT);
|
||||
}
|
||||
PeriodicTaskIF* pusHighPrio = taskFactory->createPeriodicTask(
|
||||
"PUS_HIGH_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, deadlineMissedFunc);
|
||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||
}
|
||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 5", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||
}
|
||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 9", objects::PUS_SERVICE_9_TIME_MGMT);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
currPrio = 40;
|
||||
currPrio = 40;
|
||||
#endif
|
||||
PeriodicTaskIF* pusMedPrio = taskFactory->createPeriodicTask(
|
||||
"PUS_MED_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.6, deadlineMissedFunc);
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 200", objects::PUS_SERVICE_200_MODE_MGMT);
|
||||
}
|
||||
PeriodicTaskIF* pusMedPrio = taskFactory->createPeriodicTask(
|
||||
"PUS_MED_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.6, deadlineMissedFunc);
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 200", objects::PUS_SERVICE_200_MODE_MGMT);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
currPrio = 30;
|
||||
currPrio = 30;
|
||||
#endif
|
||||
PeriodicTaskIF* pusLowPrio = taskFactory->createPeriodicTask(
|
||||
"PUS_LOW_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.2, deadlineMissedFunc);
|
||||
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
||||
if(result!=HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 17", objects::PUS_SERVICE_17_TEST);
|
||||
}
|
||||
PeriodicTaskIF* pusLowPrio = taskFactory->createPeriodicTask(
|
||||
"PUS_LOW_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.2, deadlineMissedFunc);
|
||||
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("PUS 17", objects::PUS_SERVICE_17_TEST);
|
||||
}
|
||||
#endif /* OBSW_ADD_PUS_STACK == 1 */
|
||||
|
||||
#if OBSW_ADD_DEVICE_HANDLER_DEMO == 1
|
||||
#ifdef __unix__
|
||||
currPrio = 60;
|
||||
currPrio = 60;
|
||||
#elif _WIN32
|
||||
currPrio = tasks::makeWinPriority(tasks::PriorityClass::CLASS_HIGH,
|
||||
tasks::PriorityNumber::HIGHEST);
|
||||
currPrio =
|
||||
tasks::makeWinPriority(tasks::PriorityClass::CLASS_HIGH, tasks::PriorityNumber::HIGHEST);
|
||||
#endif
|
||||
FixedTimeslotTaskIF* testDevicesTimeslotTask = taskFactory->createFixedTimeslotTask(
|
||||
"PST_TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc);
|
||||
result = pst::pollingSequenceDevices(testDevicesTimeslotTask);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
FixedTimeslotTaskIF* testDevicesTimeslotTask = taskFactory->createFixedTimeslotTask(
|
||||
"PST_TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc);
|
||||
result = pst::pollingSequenceDevices(testDevicesTimeslotTask);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "InitMission::createTasks: Test PST initialization failed!" << std::endl;
|
||||
sif::error << "InitMission::createTasks: Test PST initialization failed!" << std::endl;
|
||||
#else
|
||||
sif::printError("InitMission::createTasks: Test PST initialization failed!\n");
|
||||
sif::printError("InitMission::createTasks: Test PST initialization failed!\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#if _WIN32
|
||||
currPrio = tasks::makeWinPriority();
|
||||
currPrio = tasks::makeWinPriority();
|
||||
#endif
|
||||
|
||||
PeriodicTaskIF* assemblyTask = taskFactory->createPeriodicTask("ASS_TASK", currPrio,
|
||||
PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, nullptr);
|
||||
if(assemblyTask == nullptr){
|
||||
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
|
||||
}
|
||||
result = assemblyTask->addComponent(objects::TEST_ASSEMBLY);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
|
||||
}
|
||||
PeriodicTaskIF* assemblyTask = taskFactory->createPeriodicTask(
|
||||
"ASS_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, nullptr);
|
||||
if (assemblyTask == nullptr) {
|
||||
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
|
||||
}
|
||||
result = assemblyTask->addComponent(objects::TEST_ASSEMBLY);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
|
||||
}
|
||||
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
|
||||
|
||||
#if OBSW_ADD_CONTROLLER_DEMO == 1
|
||||
#ifdef __unix__
|
||||
currPrio = 45;
|
||||
currPrio = 45;
|
||||
#endif
|
||||
PeriodicTaskIF* controllerTask = taskFactory->createPeriodicTask(
|
||||
"TEST_CTRL", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, deadlineMissedFunc);
|
||||
result = controllerTask->addComponent(objects::TEST_CONTROLLER);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("Controller Task", objects::TEST_CONTROLLER);
|
||||
}
|
||||
PeriodicTaskIF* controllerTask = taskFactory->createPeriodicTask(
|
||||
"TEST_CTRL", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, deadlineMissedFunc);
|
||||
result = controllerTask->addComponent(objects::TEST_CONTROLLER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("Controller Task", objects::TEST_CONTROLLER);
|
||||
}
|
||||
#endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */
|
||||
#ifdef __unix__
|
||||
currPrio = 15;
|
||||
currPrio = 15;
|
||||
#endif
|
||||
PeriodicTaskIF* testTask = TaskFactory::instance()->createPeriodicTask(
|
||||
"TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc);
|
||||
result = testTask->addComponent(objects::TEST_TASK);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("Test Task", objects::TEST_TASK);
|
||||
}
|
||||
PeriodicTaskIF* testTask = TaskFactory::instance()->createPeriodicTask(
|
||||
"TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc);
|
||||
result = testTask->addComponent(objects::TEST_TASK);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("Test Task", objects::TEST_TASK);
|
||||
}
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Starting tasks.." << std::endl;
|
||||
sif::info << "Starting tasks.." << std::endl;
|
||||
#else
|
||||
sif::printInfo("Starting tasks..\n");
|
||||
sif::printInfo("Starting tasks..\n");
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_CORE_COMPONENTS == 1
|
||||
distributerTask->startTask();
|
||||
udpBridgeTask->startTask();
|
||||
udpPollingTask->startTask();
|
||||
eventTask->startTask();
|
||||
distributerTask->startTask();
|
||||
udpBridgeTask->startTask();
|
||||
udpPollingTask->startTask();
|
||||
eventTask->startTask();
|
||||
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
||||
|
||||
#if OBSW_ADD_PUS_STACK == 1
|
||||
pusVerification->startTask();
|
||||
pusHighPrio->startTask();
|
||||
pusMedPrio->startTask();
|
||||
pusLowPrio->startTask();
|
||||
pusVerification->startTask();
|
||||
pusHighPrio->startTask();
|
||||
pusMedPrio->startTask();
|
||||
pusLowPrio->startTask();
|
||||
#endif /* OBSW_ADD_PUS_STACK == 1 */
|
||||
|
||||
#if OBSW_ADD_TASK_EXAMPLE == 1
|
||||
timeslotDemoTask->startTask();
|
||||
readerTask->startTask();
|
||||
timeslotDemoTask->startTask();
|
||||
readerTask->startTask();
|
||||
#endif /* OBSW_ADD_TASK_EXAMPLE == 1 */
|
||||
|
||||
#if OBSW_ADD_DEVICE_HANDLER_DEMO == 1
|
||||
testDevicesTimeslotTask->startTask();
|
||||
assemblyTask->startTask();
|
||||
testDevicesTimeslotTask->startTask();
|
||||
assemblyTask->startTask();
|
||||
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
|
||||
|
||||
#if OBSW_ADD_CONTROLLER_DEMO == 1
|
||||
controllerTask->startTask();
|
||||
controllerTask->startTask();
|
||||
#endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */
|
||||
|
||||
testTask->startTask();
|
||||
testTask->startTask();
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Tasks started.." << std::endl;
|
||||
sif::info << "Tasks started.." << std::endl;
|
||||
#else
|
||||
sif::printInfo("Tasks started..\n");
|
||||
sif::printInfo("Tasks started..\n");
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_DEVICE_HANDLER_DEMO
|
||||
auto* assembly = ObjectManager::instance()->get<HasModesIF>(objects::TEST_ASSEMBLY);
|
||||
if (assembly == nullptr){
|
||||
return;
|
||||
}
|
||||
auto* assembly = ObjectManager::instance()->get<HasModesIF>(objects::TEST_ASSEMBLY);
|
||||
if (assembly == nullptr) {
|
||||
return;
|
||||
}
|
||||
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO */
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,73 +1,67 @@
|
||||
#include "ObjectFactory.h"
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
#include <bsp_hosted/fsfwconfig/objects/systemObjectList.h>
|
||||
#include <bsp_hosted/fsfwconfig/tmtc/apid.h>
|
||||
#include <bsp_hosted/fsfwconfig/tmtc/pusIds.h>
|
||||
|
||||
#include "example/test/FsfwTestTask.h"
|
||||
#include "example/utility/TmFunnel.h"
|
||||
#include "example/core/GenericFactory.h"
|
||||
|
||||
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
|
||||
#include <fsfw/monitoring/MonitoringMessageContent.h>
|
||||
#include <fsfw/storagemanager/PoolManager.h>
|
||||
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
|
||||
#include <fsfw/tmtcpacket/pus/tm.h>
|
||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||
|
||||
#if OBSW_USE_TCP_SERVER == 0
|
||||
#include "OBSWConfig.h"
|
||||
#include "example/core/GenericFactory.h"
|
||||
#include "example/test/FsfwTestTask.h"
|
||||
#include "example/utility/TmFunnel.h"
|
||||
|
||||
#if OBSW_USE_TCP_SERVER == 0
|
||||
#include <fsfw/osal/common/UdpTcPollingTask.h>
|
||||
#include <fsfw/osal/common/UdpTmTcBridge.h>
|
||||
#else
|
||||
#include "fsfw/osal/common/TcpTmTcServer.h"
|
||||
#include "fsfw/osal/common/TcpTmTcBridge.h"
|
||||
#include "fsfw/osal/common/TcpTmTcServer.h"
|
||||
#endif
|
||||
|
||||
void ObjectFactory::produce(void* args) {
|
||||
Factory::setStaticFrameworkObjectIds();
|
||||
Factory::setStaticFrameworkObjectIds();
|
||||
|
||||
#if OBSW_ADD_CORE_COMPONENTS == 1
|
||||
{
|
||||
LocalPool::LocalPoolConfig poolCfg = {
|
||||
{16, 100}, {32, 50}, {64, 25}, {128,15}, {1024, 5}
|
||||
};
|
||||
new PoolManager(objects::TC_STORE, poolCfg);
|
||||
}
|
||||
{
|
||||
LocalPool::LocalPoolConfig poolCfg = {{16, 100}, {32, 50}, {64, 25}, {128, 15}, {1024, 5}};
|
||||
new PoolManager(objects::TC_STORE, poolCfg);
|
||||
}
|
||||
|
||||
{
|
||||
LocalPool::LocalPoolConfig poolCfg = {
|
||||
{16, 100}, {32, 50}, {64, 25}, {128,15}, {1024, 5}
|
||||
};
|
||||
new PoolManager(objects::TM_STORE, poolCfg);
|
||||
}
|
||||
{
|
||||
LocalPool::LocalPoolConfig poolCfg = {{16, 100}, {32, 50}, {64, 25}, {128, 15}, {1024, 5}};
|
||||
new PoolManager(objects::TM_STORE, poolCfg);
|
||||
}
|
||||
|
||||
{
|
||||
LocalPool::LocalPoolConfig poolCfg = {
|
||||
{16, 100}, {32, 50}, {64, 25}, {128,15}, {1024, 5}
|
||||
};
|
||||
new PoolManager(objects::IPC_STORE, poolCfg);
|
||||
}
|
||||
{
|
||||
LocalPool::LocalPoolConfig poolCfg = {{16, 100}, {32, 50}, {64, 25}, {128, 15}, {1024, 5}};
|
||||
new PoolManager(objects::IPC_STORE, poolCfg);
|
||||
}
|
||||
|
||||
// TMTC Reception via TCP/IP socket
|
||||
#if OBSW_USE_TCP_SERVER == 0
|
||||
auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR);
|
||||
tmtcBridge->setMaxNumberOfPacketsStored(50);
|
||||
sif::info << "Opening UDP TMTC server on port " << tmtcBridge->getUdpPort() << std::endl;
|
||||
new UdpTcPollingTask(objects::TCPIP_TMTC_POLLING_TASK, objects::TCPIP_TMTC_BRIDGE);
|
||||
// TMTC Reception via TCP/IP socket
|
||||
#if OBSW_USE_TCP_SERVER == 0
|
||||
auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR);
|
||||
tmtcBridge->setMaxNumberOfPacketsStored(50);
|
||||
sif::info << "Opening UDP TMTC server on port " << tmtcBridge->getUdpPort() << std::endl;
|
||||
new UdpTcPollingTask(objects::TCPIP_TMTC_POLLING_TASK, objects::TCPIP_TMTC_BRIDGE);
|
||||
#else
|
||||
auto tmtcBridge = new TcpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR);
|
||||
tmtcBridge->setMaxNumberOfPacketsStored(50);
|
||||
auto tmtcServer = new TcpTmTcServer(objects::TCPIP_TMTC_POLLING_TASK, objects::TCPIP_TMTC_BRIDGE);
|
||||
sif::info << "Opening TCP TMTC server on port " << tmtcServer->getTcpPort() << std::endl;
|
||||
auto tmtcBridge = new TcpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR);
|
||||
tmtcBridge->setMaxNumberOfPacketsStored(50);
|
||||
auto tmtcServer = new TcpTmTcServer(objects::TCPIP_TMTC_POLLING_TASK, objects::TCPIP_TMTC_BRIDGE);
|
||||
sif::info << "Opening TCP TMTC server on port " << tmtcServer->getTcpPort() << std::endl;
|
||||
#endif
|
||||
|
||||
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
||||
|
||||
bool periodicEvent = false;
|
||||
bool periodicEvent = false;
|
||||
#if OBSW_TASK_PERIODIC_EVENT == 1
|
||||
periodicEvent = true;
|
||||
periodicEvent = true;
|
||||
#endif
|
||||
new FsfwTestTask(objects::TEST_TASK, periodicEvent);
|
||||
new FsfwTestTask(objects::TEST_TASK, periodicEvent);
|
||||
|
||||
ObjectFactory::produceGenericObjects();
|
||||
ObjectFactory::produceGenericObjects();
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ namespace ObjectFactory {
|
||||
void setStatics();
|
||||
void produce(void* args);
|
||||
|
||||
};
|
||||
|
||||
}; // namespace ObjectFactory
|
||||
|
||||
#endif /* MISSION_CORE_OBJECTFACTORY_H_ */
|
||||
|
Reference in New Issue
Block a user