apply auto-formatter
fsfw/fsfw example hosted/pipeline/head This commit looks good Details

This commit is contained in:
Robin Müller 2022-05-05 20:55:48 +02:00
parent a9907fc7b3
commit d2337a769c
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
21 changed files with 513 additions and 532 deletions

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="fsfw-example-hosted" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="fsfw-example-hosted" TARGET_NAME="fsfw-example-hosted" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="fsfw-example-hosted" RUN_TARGET_NAME="fsfw-example-hosted"> <configuration default="false" name="fsfw-example-hosted" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="fsfw-example-hosted" TARGET_NAME="fsfw-example-hosted" CONFIG_NAME="Release" RUN_TARGET_PROJECT_NAME="fsfw-example-hosted" RUN_TARGET_NAME="fsfw-example-hosted">
<method v="2"> <method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" /> <option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method> </method>

View File

@ -13,7 +13,7 @@ cmake_minimum_required(VERSION 3.13)
# set(CMAKE_VERBOSE TRUE) # set(CMAKE_VERBOSE TRUE)
set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if(NOT FSFW_OSAL) if(NOT FSFW_OSAL)
set(FSFW_OSAL host CACHE STRING "OS for the FSFW.") set(FSFW_OSAL host CACHE STRING "OS for the FSFW.")
@ -173,5 +173,5 @@ add_custom_command(
COMMENT ${POST_BUILD_COMMENT} COMMENT ${POST_BUILD_COMMENT}
) )
include (${CMAKE_SCRIPT_PATH}/BuildType.cmake) include (BuildType)
set_build_type() set_build_type()

View File

@ -1,12 +1,7 @@
#include <OBSWConfig.h> #include <OBSWConfig.h>
#include <bsp_hosted/core/InitMission.h> #include <bsp_hosted/core/InitMission.h>
#include <bsp_hosted/fsfwconfig/objects/systemObjectList.h> #include <bsp_hosted/fsfwconfig/objects/systemObjectList.h>
#include <bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.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/modes/HasModesIF.h>
#include <fsfw/returnvalues/HasReturnvaluesIF.h> #include <fsfw/returnvalues/HasReturnvaluesIF.h>
#include <fsfw/serviceinterface/ServiceInterface.h> #include <fsfw/serviceinterface/ServiceInterface.h>
@ -14,281 +9,273 @@
#include <fsfw/tasks/PeriodicTaskIF.h> #include <fsfw/tasks/PeriodicTaskIF.h>
#include <fsfw/tasks/TaskFactory.h> #include <fsfw/tasks/TaskFactory.h>
#include "example/utility/TaskCreation.h"
#include "fsfw_tests/integration/assemblies/TestAssembly.h"
#ifdef _WIN32 #ifdef _WIN32
#include <fsfw/osal/windows/winTaskHelpers.h> #include <fsfw/osal/windows/winTaskHelpers.h>
#endif #endif
void InitMission::createTasks() { void InitMission::createTasks() {
TaskFactory* taskFactory = TaskFactory::instance(); TaskFactory* taskFactory = TaskFactory::instance();
if(taskFactory == nullptr) { if (taskFactory == nullptr) {
return; return;
} }
TaskPriority currPrio; TaskPriority currPrio;
#ifdef _WIN32 #ifdef _WIN32
currPrio = tasks::makeWinPriority(); currPrio = tasks::makeWinPriority();
#endif #endif
TaskDeadlineMissedFunction deadlineMissedFunc = nullptr; TaskDeadlineMissedFunction deadlineMissedFunc = nullptr;
#if OBSW_PRINT_MISSED_DEADLINES == 1 #if OBSW_PRINT_MISSED_DEADLINES == 1
deadlineMissedFunc = TaskFactory::printMissedDeadline; deadlineMissedFunc = TaskFactory::printMissedDeadline;
#endif #endif
#if OBSW_ADD_CORE_COMPONENTS == 1 #if OBSW_ADD_CORE_COMPONENTS == 1
#ifdef __unix__ #ifdef __unix__
currPrio = 40; currPrio = 40;
#endif #endif
/* TMTC Distribution */ /* TMTC Distribution */
PeriodicTaskIF* distributerTask = taskFactory->createPeriodicTask( PeriodicTaskIF* distributerTask = taskFactory->createPeriodicTask(
"DIST", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.1, deadlineMissedFunc); "DIST", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.1, deadlineMissedFunc);
ReturnValue_t result = distributerTask->addComponent( ReturnValue_t result = distributerTask->addComponent(objects::CCSDS_DISTRIBUTOR);
objects::CCSDS_DISTRIBUTOR); if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != HasReturnvaluesIF::RETURN_OK) { task::printInitError("CCSDS distributor", objects::CCSDS_DISTRIBUTOR);
task::printInitError("CCSDS distributor", objects::CCSDS_DISTRIBUTOR); }
} result = distributerTask->addComponent(objects::PUS_DISTRIBUTOR);
result = distributerTask->addComponent(objects::PUS_DISTRIBUTOR); if (result != HasReturnvaluesIF::RETURN_OK) {
if (result!=HasReturnvaluesIF::RETURN_OK) { task::printInitError("PUS distributor", objects::PUS_DISTRIBUTOR);
task::printInitError("PUS distributor", objects::PUS_DISTRIBUTOR); }
} result = distributerTask->addComponent(objects::TM_FUNNEL);
result = distributerTask->addComponent(objects::TM_FUNNEL); if (result != HasReturnvaluesIF::RETURN_OK) {
if (result != HasReturnvaluesIF::RETURN_OK) { task::printInitError("TM funnel", objects::TM_FUNNEL);
task::printInitError("TM funnel", objects::TM_FUNNEL); }
}
#ifdef __unix__ #ifdef __unix__
currPrio = 50; currPrio = 50;
#endif #endif
/* UDP bridge */ /* UDP bridge */
PeriodicTaskIF* udpBridgeTask = taskFactory->createPeriodicTask( PeriodicTaskIF* udpBridgeTask = taskFactory->createPeriodicTask(
"TCPIP_TMTC_BRIDGE", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, "TCPIP_TMTC_BRIDGE", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, deadlineMissedFunc);
deadlineMissedFunc result = udpBridgeTask->addComponent(objects::TCPIP_TMTC_BRIDGE);
); if (result != HasReturnvaluesIF::RETURN_OK) {
result = udpBridgeTask->addComponent(objects::TCPIP_TMTC_BRIDGE); task::printInitError("TMTC bridge", objects::TCPIP_TMTC_BRIDGE);
if(result != HasReturnvaluesIF::RETURN_OK) { }
task::printInitError("TMTC bridge", objects::TCPIP_TMTC_BRIDGE);
}
#ifdef __unix__ #ifdef __unix__
currPrio = 80; currPrio = 80;
#endif #endif
PeriodicTaskIF* udpPollingTask = taskFactory->createPeriodicTask( PeriodicTaskIF* udpPollingTask = taskFactory->createPeriodicTask(
"TMTC_POLLING", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc "TMTC_POLLING", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc);
); result = udpPollingTask->addComponent(objects::TCPIP_TMTC_POLLING_TASK);
result = udpPollingTask->addComponent(objects::TCPIP_TMTC_POLLING_TASK); if (result != HasReturnvaluesIF::RETURN_OK) {
if(result != HasReturnvaluesIF::RETURN_OK) { task::printInitError("TMTC polling", objects::TCPIP_TMTC_POLLING_TASK);
task::printInitError("TMTC polling", objects::TCPIP_TMTC_POLLING_TASK); }
}
#ifdef __unix__ #ifdef __unix__
currPrio = 20; currPrio = 20;
#endif #endif
PeriodicTaskIF* eventTask = taskFactory->createPeriodicTask( PeriodicTaskIF* eventTask = taskFactory->createPeriodicTask(
"EVENT", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.100, deadlineMissedFunc "EVENT", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.100, deadlineMissedFunc);
); result = eventTask->addComponent(objects::EVENT_MANAGER);
result = eventTask->addComponent(objects::EVENT_MANAGER); if (result != HasReturnvaluesIF::RETURN_OK) {
if(result != HasReturnvaluesIF::RETURN_OK) { task::printInitError("Event Manager", objects::EVENT_MANAGER);
task::printInitError("Event Manager", objects::EVENT_MANAGER); }
}
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */ #endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
#if OBSW_ADD_TASK_EXAMPLE == 1 #if OBSW_ADD_TASK_EXAMPLE == 1
#ifdef __unix__ #ifdef __unix__
currPrio = 50; currPrio = 50;
#endif #endif
FixedTimeslotTaskIF* timeslotDemoTask = taskFactory->createFixedTimeslotTask( FixedTimeslotTaskIF* timeslotDemoTask = taskFactory->createFixedTimeslotTask(
"PST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, deadlineMissedFunc); "PST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, deadlineMissedFunc);
result = pst::pollingSequenceExamples(timeslotDemoTask); result = pst::pollingSequenceExamples(timeslotDemoTask);
if(result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "InitMission::createTasks: Timeslot demo task initialization failed!" << sif::error << "InitMission::createTasks: Timeslot demo task initialization failed!"
std::endl; << std::endl;
#else #else
sif::printError("InitMission::createTasks: Timeslot demo task initialization failed!\n"); sif::printError("InitMission::createTasks: Timeslot demo task initialization failed!\n");
#endif #endif
} }
#ifdef __unix__ #ifdef __unix__
currPrio = 40; currPrio = 40;
#endif #endif
PeriodicTaskIF* readerTask = taskFactory->createPeriodicTask( PeriodicTaskIF* readerTask = taskFactory->createPeriodicTask(
"READER_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc); "READER_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc);
result = readerTask->addComponent(objects::TEST_DUMMY_4); result = readerTask->addComponent(objects::TEST_DUMMY_4);
if(result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("Dummy 4", objects::TEST_DUMMY_4); task::printInitError("Dummy 4", objects::TEST_DUMMY_4);
} }
#endif /* OBSW_ADD_TASK_EXAMPLE == 1 */ #endif /* OBSW_ADD_TASK_EXAMPLE == 1 */
#if OBSW_ADD_PUS_STACK == 1 #if OBSW_ADD_PUS_STACK == 1
/* PUS Services */ /* PUS Services */
#ifdef __unix__ #ifdef __unix__
currPrio = 45; currPrio = 45;
#endif #endif
PeriodicTaskIF* pusVerification = taskFactory->createPeriodicTask( PeriodicTaskIF* pusVerification = taskFactory->createPeriodicTask(
"PUS_VERIF_1", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, deadlineMissedFunc); "PUS_VERIF_1", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, deadlineMissedFunc);
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION); result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
if(result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("PUS 1", objects::PUS_SERVICE_1_VERIFICATION); task::printInitError("PUS 1", objects::PUS_SERVICE_1_VERIFICATION);
} }
#ifdef __unix__ #ifdef __unix__
currPrio = 50; currPrio = 50;
#endif #endif
PeriodicTaskIF* pusHighPrio = taskFactory->createPeriodicTask( PeriodicTaskIF* pusHighPrio = taskFactory->createPeriodicTask(
"PUS_HIGH_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, deadlineMissedFunc); "PUS_HIGH_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, deadlineMissedFunc);
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS); result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("PUS 2", objects::PUS_SERVICE_2_DEVICE_ACCESS); task::printInitError("PUS 2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
} }
result = pusHighPrio->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING); result = pusHighPrio->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
if(result != HasReturnvaluesIF::RETURN_OK){ if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("PUS 5",objects::PUS_SERVICE_5_EVENT_REPORTING); task::printInitError("PUS 5", objects::PUS_SERVICE_5_EVENT_REPORTING);
} }
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT); result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("PUS 9", objects::PUS_SERVICE_9_TIME_MGMT); task::printInitError("PUS 9", objects::PUS_SERVICE_9_TIME_MGMT);
} }
#ifdef __unix__ #ifdef __unix__
currPrio = 40; currPrio = 40;
#endif #endif
PeriodicTaskIF* pusMedPrio = taskFactory->createPeriodicTask( PeriodicTaskIF* pusMedPrio = taskFactory->createPeriodicTask(
"PUS_MED_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.6, deadlineMissedFunc); "PUS_MED_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.6, deadlineMissedFunc);
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING); result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("PUS 3", objects::PUS_SERVICE_3_HOUSEKEEPING); task::printInitError("PUS 3", objects::PUS_SERVICE_3_HOUSEKEEPING);
} }
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT); result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("PUS 8", objects::PUS_SERVICE_8_FUNCTION_MGMT); task::printInitError("PUS 8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
} }
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS); result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("PUS 20", objects::PUS_SERVICE_20_PARAMETERS); task::printInitError("PUS 20", objects::PUS_SERVICE_20_PARAMETERS);
} }
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT); result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("PUS 200", objects::PUS_SERVICE_200_MODE_MGMT); task::printInitError("PUS 200", objects::PUS_SERVICE_200_MODE_MGMT);
} }
#ifdef __unix__ #ifdef __unix__
currPrio = 30; currPrio = 30;
#endif #endif
PeriodicTaskIF* pusLowPrio = taskFactory->createPeriodicTask( PeriodicTaskIF* pusLowPrio = taskFactory->createPeriodicTask(
"PUS_LOW_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.2, deadlineMissedFunc); "PUS_LOW_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.2, deadlineMissedFunc);
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST); result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
if(result!=HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("PUS 17", objects::PUS_SERVICE_17_TEST); task::printInitError("PUS 17", objects::PUS_SERVICE_17_TEST);
} }
#endif /* OBSW_ADD_PUS_STACK == 1 */ #endif /* OBSW_ADD_PUS_STACK == 1 */
#if OBSW_ADD_DEVICE_HANDLER_DEMO == 1 #if OBSW_ADD_DEVICE_HANDLER_DEMO == 1
#ifdef __unix__ #ifdef __unix__
currPrio = 60; currPrio = 60;
#elif _WIN32 #elif _WIN32
currPrio = tasks::makeWinPriority(tasks::PriorityClass::CLASS_HIGH, currPrio =
tasks::PriorityNumber::HIGHEST); tasks::makeWinPriority(tasks::PriorityClass::CLASS_HIGH, tasks::PriorityNumber::HIGHEST);
#endif #endif
FixedTimeslotTaskIF* testDevicesTimeslotTask = taskFactory->createFixedTimeslotTask( FixedTimeslotTaskIF* testDevicesTimeslotTask = taskFactory->createFixedTimeslotTask(
"PST_TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc); "PST_TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc);
result = pst::pollingSequenceDevices(testDevicesTimeslotTask); result = pst::pollingSequenceDevices(testDevicesTimeslotTask);
if(result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #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 #else
sif::printError("InitMission::createTasks: Test PST initialization failed!\n"); sif::printError("InitMission::createTasks: Test PST initialization failed!\n");
#endif #endif
}
}
#if _WIN32 #if _WIN32
currPrio = tasks::makeWinPriority(); currPrio = tasks::makeWinPriority();
#endif #endif
PeriodicTaskIF* assemblyTask = taskFactory->createPeriodicTask("ASS_TASK", currPrio, PeriodicTaskIF* assemblyTask = taskFactory->createPeriodicTask(
PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, nullptr); "ASS_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, nullptr);
if(assemblyTask == nullptr){ if (assemblyTask == nullptr) {
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY); task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
} }
result = assemblyTask->addComponent(objects::TEST_ASSEMBLY); result = assemblyTask->addComponent(objects::TEST_ASSEMBLY);
if(result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY); task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
} }
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */ #endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
#if OBSW_ADD_CONTROLLER_DEMO == 1 #if OBSW_ADD_CONTROLLER_DEMO == 1
#ifdef __unix__ #ifdef __unix__
currPrio = 45; currPrio = 45;
#endif #endif
PeriodicTaskIF* controllerTask = taskFactory->createPeriodicTask( PeriodicTaskIF* controllerTask = taskFactory->createPeriodicTask(
"TEST_CTRL", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, deadlineMissedFunc); "TEST_CTRL", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, deadlineMissedFunc);
result = controllerTask->addComponent(objects::TEST_CONTROLLER); result = controllerTask->addComponent(objects::TEST_CONTROLLER);
if(result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("Controller Task", objects::TEST_CONTROLLER); task::printInitError("Controller Task", objects::TEST_CONTROLLER);
} }
#endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */ #endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */
#ifdef __unix__ #ifdef __unix__
currPrio = 15; currPrio = 15;
#endif #endif
PeriodicTaskIF* testTask = TaskFactory::instance()->createPeriodicTask( PeriodicTaskIF* testTask = TaskFactory::instance()->createPeriodicTask(
"TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc); "TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc);
result = testTask->addComponent(objects::TEST_TASK); result = testTask->addComponent(objects::TEST_TASK);
if(result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("Test Task", objects::TEST_TASK); task::printInitError("Test Task", objects::TEST_TASK);
} }
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Starting tasks.." << std::endl; sif::info << "Starting tasks.." << std::endl;
#else #else
sif::printInfo("Starting tasks..\n"); sif::printInfo("Starting tasks..\n");
#endif #endif
#if OBSW_ADD_CORE_COMPONENTS == 1 #if OBSW_ADD_CORE_COMPONENTS == 1
distributerTask->startTask(); distributerTask->startTask();
udpBridgeTask->startTask(); udpBridgeTask->startTask();
udpPollingTask->startTask(); udpPollingTask->startTask();
eventTask->startTask(); eventTask->startTask();
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */ #endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
#if OBSW_ADD_PUS_STACK == 1 #if OBSW_ADD_PUS_STACK == 1
pusVerification->startTask(); pusVerification->startTask();
pusHighPrio->startTask(); pusHighPrio->startTask();
pusMedPrio->startTask(); pusMedPrio->startTask();
pusLowPrio->startTask(); pusLowPrio->startTask();
#endif /* OBSW_ADD_PUS_STACK == 1 */ #endif /* OBSW_ADD_PUS_STACK == 1 */
#if OBSW_ADD_TASK_EXAMPLE == 1 #if OBSW_ADD_TASK_EXAMPLE == 1
timeslotDemoTask->startTask(); timeslotDemoTask->startTask();
readerTask->startTask(); readerTask->startTask();
#endif /* OBSW_ADD_TASK_EXAMPLE == 1 */ #endif /* OBSW_ADD_TASK_EXAMPLE == 1 */
#if OBSW_ADD_DEVICE_HANDLER_DEMO == 1 #if OBSW_ADD_DEVICE_HANDLER_DEMO == 1
testDevicesTimeslotTask->startTask(); testDevicesTimeslotTask->startTask();
assemblyTask->startTask(); assemblyTask->startTask();
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */ #endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
#if OBSW_ADD_CONTROLLER_DEMO == 1 #if OBSW_ADD_CONTROLLER_DEMO == 1
controllerTask->startTask(); controllerTask->startTask();
#endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */ #endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */
testTask->startTask(); testTask->startTask();
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Tasks started.." << std::endl; sif::info << "Tasks started.." << std::endl;
#else #else
sif::printInfo("Tasks started..\n"); sif::printInfo("Tasks started..\n");
#endif #endif
#if OBSW_ADD_DEVICE_HANDLER_DEMO #if OBSW_ADD_DEVICE_HANDLER_DEMO
auto* assembly = ObjectManager::instance()->get<HasModesIF>(objects::TEST_ASSEMBLY); auto* assembly = ObjectManager::instance()->get<HasModesIF>(objects::TEST_ASSEMBLY);
if (assembly == nullptr){ if (assembly == nullptr) {
return; return;
} }
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO */ #endif /* OBSW_ADD_DEVICE_HANDLER_DEMO */
} }

View File

@ -1,73 +1,67 @@
#include "ObjectFactory.h" #include "ObjectFactory.h"
#include "OBSWConfig.h"
#include <bsp_hosted/fsfwconfig/objects/systemObjectList.h> #include <bsp_hosted/fsfwconfig/objects/systemObjectList.h>
#include <bsp_hosted/fsfwconfig/tmtc/apid.h> #include <bsp_hosted/fsfwconfig/tmtc/apid.h>
#include <bsp_hosted/fsfwconfig/tmtc/pusIds.h> #include <bsp_hosted/fsfwconfig/tmtc/pusIds.h>
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
#include "example/test/FsfwTestTask.h"
#include "example/utility/TmFunnel.h"
#include "example/core/GenericFactory.h"
#include <fsfw/monitoring/MonitoringMessageContent.h> #include <fsfw/monitoring/MonitoringMessageContent.h>
#include <fsfw/storagemanager/PoolManager.h> #include <fsfw/storagemanager/PoolManager.h>
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
#include <fsfw/tmtcpacket/pus/tm.h> #include <fsfw/tmtcpacket/pus/tm.h>
#include <fsfw/tmtcservices/CommandingServiceBase.h> #include <fsfw/tmtcservices/CommandingServiceBase.h>
#include <fsfw/tmtcservices/PusServiceBase.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/UdpTcPollingTask.h>
#include <fsfw/osal/common/UdpTmTcBridge.h> #include <fsfw/osal/common/UdpTmTcBridge.h>
#else #else
#include "fsfw/osal/common/TcpTmTcServer.h"
#include "fsfw/osal/common/TcpTmTcBridge.h" #include "fsfw/osal/common/TcpTmTcBridge.h"
#include "fsfw/osal/common/TcpTmTcServer.h"
#endif #endif
void ObjectFactory::produce(void* args) { void ObjectFactory::produce(void* args) {
Factory::setStaticFrameworkObjectIds(); Factory::setStaticFrameworkObjectIds();
#if OBSW_ADD_CORE_COMPONENTS == 1 #if OBSW_ADD_CORE_COMPONENTS == 1
{ {
LocalPool::LocalPoolConfig poolCfg = { LocalPool::LocalPoolConfig poolCfg = {{16, 100}, {32, 50}, {64, 25}, {128, 15}, {1024, 5}};
{16, 100}, {32, 50}, {64, 25}, {128,15}, {1024, 5} new PoolManager(objects::TC_STORE, poolCfg);
}; }
new PoolManager(objects::TC_STORE, poolCfg);
}
{ {
LocalPool::LocalPoolConfig poolCfg = { LocalPool::LocalPoolConfig poolCfg = {{16, 100}, {32, 50}, {64, 25}, {128, 15}, {1024, 5}};
{16, 100}, {32, 50}, {64, 25}, {128,15}, {1024, 5} new PoolManager(objects::TM_STORE, poolCfg);
}; }
new PoolManager(objects::TM_STORE, poolCfg);
}
{ {
LocalPool::LocalPoolConfig poolCfg = { LocalPool::LocalPoolConfig poolCfg = {{16, 100}, {32, 50}, {64, 25}, {128, 15}, {1024, 5}};
{16, 100}, {32, 50}, {64, 25}, {128,15}, {1024, 5} new PoolManager(objects::IPC_STORE, poolCfg);
}; }
new PoolManager(objects::IPC_STORE, poolCfg);
}
// TMTC Reception via TCP/IP socket // TMTC Reception via TCP/IP socket
#if OBSW_USE_TCP_SERVER == 0 #if OBSW_USE_TCP_SERVER == 0
auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR); auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR);
tmtcBridge->setMaxNumberOfPacketsStored(50); tmtcBridge->setMaxNumberOfPacketsStored(50);
sif::info << "Opening UDP TMTC server on port " << tmtcBridge->getUdpPort() << std::endl; sif::info << "Opening UDP TMTC server on port " << tmtcBridge->getUdpPort() << std::endl;
new UdpTcPollingTask(objects::TCPIP_TMTC_POLLING_TASK, objects::TCPIP_TMTC_BRIDGE); new UdpTcPollingTask(objects::TCPIP_TMTC_POLLING_TASK, objects::TCPIP_TMTC_BRIDGE);
#else #else
auto tmtcBridge = new TcpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR); auto tmtcBridge = new TcpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR);
tmtcBridge->setMaxNumberOfPacketsStored(50); tmtcBridge->setMaxNumberOfPacketsStored(50);
auto tmtcServer = new TcpTmTcServer(objects::TCPIP_TMTC_POLLING_TASK, objects::TCPIP_TMTC_BRIDGE); 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; sif::info << "Opening TCP TMTC server on port " << tmtcServer->getTcpPort() << std::endl;
#endif #endif
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */ #endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
bool periodicEvent = false; bool periodicEvent = false;
#if OBSW_TASK_PERIODIC_EVENT == 1 #if OBSW_TASK_PERIODIC_EVENT == 1
periodicEvent = true; periodicEvent = true;
#endif #endif
new FsfwTestTask(objects::TEST_TASK, periodicEvent); new FsfwTestTask(objects::TEST_TASK, periodicEvent);
ObjectFactory::produceGenericObjects(); ObjectFactory::produceGenericObjects();
} }

View File

@ -6,7 +6,6 @@ namespace ObjectFactory {
void setStatics(); void setStatics();
void produce(void* args); void produce(void* args);
}; }; // namespace ObjectFactory
#endif /* MISSION_CORE_OBJECTFACTORY_H_ */ #endif /* MISSION_CORE_OBJECTFACTORY_H_ */

View File

@ -4,8 +4,7 @@
#include "commonSubsystemIds.h" #include "commonSubsystemIds.h"
namespace SUBSYSTEM_ID { namespace SUBSYSTEM_ID {
enum subsystemId: uint8_t { enum subsystemId : uint8_t {};
};
} }
#endif /* FSFWCONFIG_TMTC_SUBSYSTEMIDRANGES_H_ */ #endif /* FSFWCONFIG_TMTC_SUBSYSTEMIDRANGES_H_ */

View File

@ -84,166 +84,166 @@ const char *CLOCK_SET_STRING = "CLOCK_SET";
const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE";
const char *TEST_STRING = "TEST"; const char *TEST_STRING = "TEST";
const char * translateEvents(Event event) { const char *translateEvents(Event event) {
switch( (event & 0xffff) ) { switch ((event & 0xffff)) {
case(2200): case (2200):
return STORE_SEND_WRITE_FAILED_STRING; return STORE_SEND_WRITE_FAILED_STRING;
case(2201): case (2201):
return STORE_WRITE_FAILED_STRING; return STORE_WRITE_FAILED_STRING;
case(2202): case (2202):
return STORE_SEND_READ_FAILED_STRING; return STORE_SEND_READ_FAILED_STRING;
case(2203): case (2203):
return STORE_READ_FAILED_STRING; return STORE_READ_FAILED_STRING;
case(2204): case (2204):
return UNEXPECTED_MSG_STRING; return UNEXPECTED_MSG_STRING;
case(2205): case (2205):
return STORING_FAILED_STRING; return STORING_FAILED_STRING;
case(2206): case (2206):
return TM_DUMP_FAILED_STRING; return TM_DUMP_FAILED_STRING;
case(2207): case (2207):
return STORE_INIT_FAILED_STRING; return STORE_INIT_FAILED_STRING;
case(2208): case (2208):
return STORE_INIT_EMPTY_STRING; return STORE_INIT_EMPTY_STRING;
case(2209): case (2209):
return STORE_CONTENT_CORRUPTED_STRING; return STORE_CONTENT_CORRUPTED_STRING;
case(2210): case (2210):
return STORE_INITIALIZE_STRING; return STORE_INITIALIZE_STRING;
case(2211): case (2211):
return INIT_DONE_STRING; return INIT_DONE_STRING;
case(2212): case (2212):
return DUMP_FINISHED_STRING; return DUMP_FINISHED_STRING;
case(2213): case (2213):
return DELETION_FINISHED_STRING; return DELETION_FINISHED_STRING;
case(2214): case (2214):
return DELETION_FAILED_STRING; return DELETION_FAILED_STRING;
case(2215): case (2215):
return AUTO_CATALOGS_SENDING_FAILED_STRING; return AUTO_CATALOGS_SENDING_FAILED_STRING;
case(2600): case (2600):
return GET_DATA_FAILED_STRING; return GET_DATA_FAILED_STRING;
case(2601): case (2601):
return STORE_DATA_FAILED_STRING; return STORE_DATA_FAILED_STRING;
case(2800): case (2800):
return DEVICE_BUILDING_COMMAND_FAILED_STRING; return DEVICE_BUILDING_COMMAND_FAILED_STRING;
case(2801): case (2801):
return DEVICE_SENDING_COMMAND_FAILED_STRING; return DEVICE_SENDING_COMMAND_FAILED_STRING;
case(2802): case (2802):
return DEVICE_REQUESTING_REPLY_FAILED_STRING; return DEVICE_REQUESTING_REPLY_FAILED_STRING;
case(2803): case (2803):
return DEVICE_READING_REPLY_FAILED_STRING; return DEVICE_READING_REPLY_FAILED_STRING;
case(2804): case (2804):
return DEVICE_INTERPRETING_REPLY_FAILED_STRING; return DEVICE_INTERPRETING_REPLY_FAILED_STRING;
case(2805): case (2805):
return DEVICE_MISSED_REPLY_STRING; return DEVICE_MISSED_REPLY_STRING;
case(2806): case (2806):
return DEVICE_UNKNOWN_REPLY_STRING; return DEVICE_UNKNOWN_REPLY_STRING;
case(2807): case (2807):
return DEVICE_UNREQUESTED_REPLY_STRING; return DEVICE_UNREQUESTED_REPLY_STRING;
case(2808): case (2808):
return INVALID_DEVICE_COMMAND_STRING; return INVALID_DEVICE_COMMAND_STRING;
case(2809): case (2809):
return MONITORING_LIMIT_EXCEEDED_STRING; return MONITORING_LIMIT_EXCEEDED_STRING;
case(2810): case (2810):
return MONITORING_AMBIGUOUS_STRING; return MONITORING_AMBIGUOUS_STRING;
case(4201): case (4201):
return FUSE_CURRENT_HIGH_STRING; return FUSE_CURRENT_HIGH_STRING;
case(4202): case (4202):
return FUSE_WENT_OFF_STRING; return FUSE_WENT_OFF_STRING;
case(4204): case (4204):
return POWER_ABOVE_HIGH_LIMIT_STRING; return POWER_ABOVE_HIGH_LIMIT_STRING;
case(4205): case (4205):
return POWER_BELOW_LOW_LIMIT_STRING; return POWER_BELOW_LOW_LIMIT_STRING;
case(4300): case (4300):
return SWITCH_WENT_OFF_STRING; return SWITCH_WENT_OFF_STRING;
case(5000): case (5000):
return HEATER_ON_STRING; return HEATER_ON_STRING;
case(5001): case (5001):
return HEATER_OFF_STRING; return HEATER_OFF_STRING;
case(5002): case (5002):
return HEATER_TIMEOUT_STRING; return HEATER_TIMEOUT_STRING;
case(5003): case (5003):
return HEATER_STAYED_ON_STRING; return HEATER_STAYED_ON_STRING;
case(5004): case (5004):
return HEATER_STAYED_OFF_STRING; return HEATER_STAYED_OFF_STRING;
case(5200): case (5200):
return TEMP_SENSOR_HIGH_STRING; return TEMP_SENSOR_HIGH_STRING;
case(5201): case (5201):
return TEMP_SENSOR_LOW_STRING; return TEMP_SENSOR_LOW_STRING;
case(5202): case (5202):
return TEMP_SENSOR_GRADIENT_STRING; return TEMP_SENSOR_GRADIENT_STRING;
case(5901): case (5901):
return COMPONENT_TEMP_LOW_STRING; return COMPONENT_TEMP_LOW_STRING;
case(5902): case (5902):
return COMPONENT_TEMP_HIGH_STRING; return COMPONENT_TEMP_HIGH_STRING;
case(5903): case (5903):
return COMPONENT_TEMP_OOL_LOW_STRING; return COMPONENT_TEMP_OOL_LOW_STRING;
case(5904): case (5904):
return COMPONENT_TEMP_OOL_HIGH_STRING; return COMPONENT_TEMP_OOL_HIGH_STRING;
case(5905): case (5905):
return TEMP_NOT_IN_OP_RANGE_STRING; return TEMP_NOT_IN_OP_RANGE_STRING;
case(7101): case (7101):
return FDIR_CHANGED_STATE_STRING; return FDIR_CHANGED_STATE_STRING;
case(7102): case (7102):
return FDIR_STARTS_RECOVERY_STRING; return FDIR_STARTS_RECOVERY_STRING;
case(7103): case (7103):
return FDIR_TURNS_OFF_DEVICE_STRING; return FDIR_TURNS_OFF_DEVICE_STRING;
case(7201): case (7201):
return MONITOR_CHANGED_STATE_STRING; return MONITOR_CHANGED_STATE_STRING;
case(7202): case (7202):
return VALUE_BELOW_LOW_LIMIT_STRING; return VALUE_BELOW_LOW_LIMIT_STRING;
case(7203): case (7203):
return VALUE_ABOVE_HIGH_LIMIT_STRING; return VALUE_ABOVE_HIGH_LIMIT_STRING;
case(7204): case (7204):
return VALUE_OUT_OF_RANGE_STRING; return VALUE_OUT_OF_RANGE_STRING;
case(7301): case (7301):
return SWITCHING_TM_FAILED_STRING; return SWITCHING_TM_FAILED_STRING;
case(7400): case (7400):
return CHANGING_MODE_STRING; return CHANGING_MODE_STRING;
case(7401): case (7401):
return MODE_INFO_STRING; return MODE_INFO_STRING;
case(7402): case (7402):
return FALLBACK_FAILED_STRING; return FALLBACK_FAILED_STRING;
case(7403): case (7403):
return MODE_TRANSITION_FAILED_STRING; return MODE_TRANSITION_FAILED_STRING;
case(7404): case (7404):
return CANT_KEEP_MODE_STRING; return CANT_KEEP_MODE_STRING;
case(7405): case (7405):
return OBJECT_IN_INVALID_MODE_STRING; return OBJECT_IN_INVALID_MODE_STRING;
case(7406): case (7406):
return FORCING_MODE_STRING; return FORCING_MODE_STRING;
case(7407): case (7407):
return MODE_CMD_REJECTED_STRING; return MODE_CMD_REJECTED_STRING;
case(7506): case (7506):
return HEALTH_INFO_STRING; return HEALTH_INFO_STRING;
case(7507): case (7507):
return CHILD_CHANGED_HEALTH_STRING; return CHILD_CHANGED_HEALTH_STRING;
case(7508): case (7508):
return CHILD_PROBLEMS_STRING; return CHILD_PROBLEMS_STRING;
case(7509): case (7509):
return OVERWRITING_HEALTH_STRING; return OVERWRITING_HEALTH_STRING;
case(7510): case (7510):
return TRYING_RECOVERY_STRING; return TRYING_RECOVERY_STRING;
case(7511): case (7511):
return RECOVERY_STEP_STRING; return RECOVERY_STEP_STRING;
case(7512): case (7512):
return RECOVERY_DONE_STRING; return RECOVERY_DONE_STRING;
case(7900): case (7900):
return RF_AVAILABLE_STRING; return RF_AVAILABLE_STRING;
case(7901): case (7901):
return RF_LOST_STRING; return RF_LOST_STRING;
case(7902): case (7902):
return BIT_LOCK_STRING; return BIT_LOCK_STRING;
case(7903): case (7903):
return BIT_LOCK_LOST_STRING; return BIT_LOCK_LOST_STRING;
case(7905): case (7905):
return FRAME_PROCESSING_FAILED_STRING; return FRAME_PROCESSING_FAILED_STRING;
case(8900): case (8900):
return CLOCK_SET_STRING; return CLOCK_SET_STRING;
case(8901): case (8901):
return CLOCK_SET_FAILURE_STRING; return CLOCK_SET_FAILURE_STRING;
case(9700): case (9700):
return TEST_STRING; return TEST_STRING;
default: default:
return "UNKNOWN_EVENT"; return "UNKNOWN_EVENT";
} }
return 0; return 0;
} }

View File

@ -3,6 +3,6 @@
#include <fsfw/events/Event.h> #include <fsfw/events/Event.h>
const char * translateEvents(Event event); const char* translateEvents(Event event);
#endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */ #endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */

View File

@ -1,11 +1,12 @@
#include "missionMessageTypes.h" #include "missionMessageTypes.h"
#include <fsfw/ipc/CommandMessage.h> #include <fsfw/ipc/CommandMessage.h>
#include <fsfw/ipc/CommandMessageCleaner.h> #include <fsfw/ipc/CommandMessageCleaner.h>
void messagetypes::clearMissionMessage(CommandMessage* message) { void messagetypes::clearMissionMessage(CommandMessage* message) {
switch((message->getMessageType())) { switch ((message->getMessageType())) {
default: default:
message->setCommand(CommandMessage::CMD_NONE); message->setCommand(CommandMessage::CMD_NONE);
break; break;
} }
} }

View File

@ -9,11 +9,11 @@ namespace messagetypes {
/* First type must have number MESSAGE_TYPE::FW_MESSAGES_COUNT! */ /* First type must have number MESSAGE_TYPE::FW_MESSAGES_COUNT! */
/* Remember to add new message types to the clearMissionMessage function below! */ /* Remember to add new message types to the clearMissionMessage function below! */
enum MISSION_MESSAGE_TYPE { enum MISSION_MESSAGE_TYPE {
COSTUM_MESSAGE = FW_MESSAGES_COUNT, COSTUM_MESSAGE = FW_MESSAGES_COUNT,
}; };
void clearMissionMessage(CommandMessage* message); void clearMissionMessage(CommandMessage* message);
} } // namespace messagetypes
#endif /* FSFWCONFIG_IPC_MISSIONMESSAGETYPES_H_ */ #endif /* FSFWCONFIG_IPC_MISSIONMESSAGETYPES_H_ */

View File

@ -5,11 +5,11 @@
namespace objects { namespace objects {
enum mission_objects { enum mission_objects {
/* 0x62 ('b') Board and mission specific objects */ /* 0x62 ('b') Board and mission specific objects */
TCPIP_TMTC_BRIDGE = 0x62000300, TCPIP_TMTC_BRIDGE = 0x62000300,
TCPIP_TMTC_POLLING_TASK = 0x62000400, TCPIP_TMTC_POLLING_TASK = 0x62000400,
/* Generic name for FSFW static ID setter */ /* Generic name for FSFW static ID setter */
DOWNLINK_DESTINATION = TCPIP_TMTC_BRIDGE DOWNLINK_DESTINATION = TCPIP_TMTC_BRIDGE
}; };
} }

View File

@ -44,84 +44,84 @@ const char *TEST_DUMMY_5_STRING = "TEST_DUMMY_5";
const char *TEST_TASK_STRING = "TEST_TASK"; const char *TEST_TASK_STRING = "TEST_TASK";
const char *NO_OBJECT_STRING = "NO_OBJECT"; const char *NO_OBJECT_STRING = "NO_OBJECT";
const char* translateObject(object_id_t object) { const char *translateObject(object_id_t object) {
switch( (object & 0xFFFFFFFF) ) { switch ((object & 0xFFFFFFFF)) {
case 0x4100CAFE: case 0x4100CAFE:
return TEST_ASSEMBLY_STRING; return TEST_ASSEMBLY_STRING;
case 0x4301CAFE: case 0x4301CAFE:
return TEST_CONTROLLER_STRING; return TEST_CONTROLLER_STRING;
case 0x4401AFFE: case 0x4401AFFE:
return TEST_DEVICE_HANDLER_0_STRING; return TEST_DEVICE_HANDLER_0_STRING;
case 0x4402AFFE: case 0x4402AFFE:
return TEST_DEVICE_HANDLER_1_STRING; return TEST_DEVICE_HANDLER_1_STRING;
case 0x4900AFFE: case 0x4900AFFE:
return TEST_ECHO_COM_IF_STRING; return TEST_ECHO_COM_IF_STRING;
case 0x53000000: case 0x53000000:
return FSFW_OBJECTS_START_STRING; return FSFW_OBJECTS_START_STRING;
case 0x53000001: case 0x53000001:
return PUS_SERVICE_1_VERIFICATION_STRING; return PUS_SERVICE_1_VERIFICATION_STRING;
case 0x53000002: case 0x53000002:
return PUS_SERVICE_2_DEVICE_ACCESS_STRING; return PUS_SERVICE_2_DEVICE_ACCESS_STRING;
case 0x53000003: case 0x53000003:
return PUS_SERVICE_3_HOUSEKEEPING_STRING; return PUS_SERVICE_3_HOUSEKEEPING_STRING;
case 0x53000005: case 0x53000005:
return PUS_SERVICE_5_EVENT_REPORTING_STRING; return PUS_SERVICE_5_EVENT_REPORTING_STRING;
case 0x53000008: case 0x53000008:
return PUS_SERVICE_8_FUNCTION_MGMT_STRING; return PUS_SERVICE_8_FUNCTION_MGMT_STRING;
case 0x53000009: case 0x53000009:
return PUS_SERVICE_9_TIME_MGMT_STRING; return PUS_SERVICE_9_TIME_MGMT_STRING;
case 0x53000017: case 0x53000017:
return PUS_SERVICE_17_TEST_STRING; return PUS_SERVICE_17_TEST_STRING;
case 0x53000020: case 0x53000020:
return PUS_SERVICE_20_PARAMETERS_STRING; return PUS_SERVICE_20_PARAMETERS_STRING;
case 0x53000200: case 0x53000200:
return PUS_SERVICE_200_MODE_MGMT_STRING; return PUS_SERVICE_200_MODE_MGMT_STRING;
case 0x53000201: case 0x53000201:
return PUS_SERVICE_201_HEALTH_STRING; return PUS_SERVICE_201_HEALTH_STRING;
case 0x53010000: case 0x53010000:
return HEALTH_TABLE_STRING; return HEALTH_TABLE_STRING;
case 0x53010100: case 0x53010100:
return MODE_STORE_STRING; return MODE_STORE_STRING;
case 0x53030000: case 0x53030000:
return EVENT_MANAGER_STRING; return EVENT_MANAGER_STRING;
case 0x53040000: case 0x53040000:
return INTERNAL_ERROR_REPORTER_STRING; return INTERNAL_ERROR_REPORTER_STRING;
case 0x534f0100: case 0x534f0100:
return TC_STORE_STRING; return TC_STORE_STRING;
case 0x534f0200: case 0x534f0200:
return TM_STORE_STRING; return TM_STORE_STRING;
case 0x534f0300: case 0x534f0300:
return IPC_STORE_STRING; return IPC_STORE_STRING;
case 0x53500010: case 0x53500010:
return TIME_STAMPER_STRING; return TIME_STAMPER_STRING;
case 0x53ffffff: case 0x53ffffff:
return FSFW_OBJECTS_END_STRING; return FSFW_OBJECTS_END_STRING;
case 0x62000300: case 0x62000300:
return UDP_BRIDGE_STRING; return UDP_BRIDGE_STRING;
case 0x62000400: case 0x62000400:
return UDP_POLLING_TASK_STRING; return UDP_POLLING_TASK_STRING;
case 0x63000000: case 0x63000000:
return CCSDS_DISTRIBUTOR_STRING; return CCSDS_DISTRIBUTOR_STRING;
case 0x63000001: case 0x63000001:
return PUS_DISTRIBUTOR_STRING; return PUS_DISTRIBUTOR_STRING;
case 0x63000002: case 0x63000002:
return TM_FUNNEL_STRING; return TM_FUNNEL_STRING;
case 0x74000001: case 0x74000001:
return TEST_DUMMY_1_STRING; return TEST_DUMMY_1_STRING;
case 0x74000002: case 0x74000002:
return TEST_DUMMY_2_STRING; return TEST_DUMMY_2_STRING;
case 0x74000003: case 0x74000003:
return TEST_DUMMY_3_STRING; return TEST_DUMMY_3_STRING;
case 0x74000004: case 0x74000004:
return TEST_DUMMY_4_STRING; return TEST_DUMMY_4_STRING;
case 0x74000005: case 0x74000005:
return TEST_DUMMY_5_STRING; return TEST_DUMMY_5_STRING;
case 0x7400CAFE: case 0x7400CAFE:
return TEST_TASK_STRING; return TEST_TASK_STRING;
case 0xFFFFFFFF: case 0xFFFFFFFF:
return NO_OBJECT_STRING; return NO_OBJECT_STRING;
default: default:
return "UNKNOWN_OBJECT"; return "UNKNOWN_OBJECT";
} }
return 0; return 0;
} }

View File

@ -2,4 +2,3 @@
* Add polling sequence initialization which are not common to every BSP here. * Add polling sequence initialization which are not common to every BSP here.
*/ */
#include "pollingSequenceFactory.h" #include "pollingSequenceFactory.h"

View File

@ -1,14 +1,15 @@
#ifndef POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_ #ifndef POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_
#define POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_ #define POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_
#include "OBSWConfig.h"
#include <fsfw/returnvalues/HasReturnvaluesIF.h> #include <fsfw/returnvalues/HasReturnvaluesIF.h>
#include "OBSWConfig.h"
class FixedTimeslotTaskIF; class FixedTimeslotTaskIF;
namespace pst { namespace pst {
ReturnValue_t pollingSequenceExamples(FixedTimeslotTaskIF *thisSequence); ReturnValue_t pollingSequenceExamples(FixedTimeslotTaskIF* thisSequence);
ReturnValue_t pollingSequenceDevices(FixedTimeslotTaskIF* thisSequence); ReturnValue_t pollingSequenceDevices(FixedTimeslotTaskIF* thisSequence);
} } // namespace pst
#endif /* POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_ */ #endif /* POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_ */

View File

@ -4,11 +4,10 @@
#include "commonClassIds.h" #include "commonClassIds.h"
namespace CLASS_ID { namespace CLASS_ID {
enum classIds: uint8_t { enum classIds : uint8_t {
CLASS_ID_START = COMMON_CLASS_ID_END, CLASS_ID_START = COMMON_CLASS_ID_END,
CLASS_ID_END // [EXPORT] : [END] CLASS_ID_END // [EXPORT] : [END]
}; };
} }
#endif /* FSFWCONFIG_RETURNVALUES_CLASSIDS_H_ */ #endif /* FSFWCONFIG_RETURNVALUES_CLASSIDS_H_ */

View File

@ -1,9 +1,10 @@
#ifndef FSFWCONFIG_TMTC_APID_H_ #ifndef FSFWCONFIG_TMTC_APID_H_
#define FSFWCONFIG_TMTC_APID_H_ #define FSFWCONFIG_TMTC_APID_H_
#include <cstdint>
#include <commonConfig.h> #include <commonConfig.h>
#include <cstdint>
namespace apid { namespace apid {
static const uint16_t APID = COMMON_APID; static const uint16_t APID = COMMON_APID;
}; };

View File

@ -3,5 +3,4 @@
#include <commonConfig.h> #include <commonConfig.h>
#endif /* FSFWCONFIG_TMTC_PUSIDS_H_ */ #endif /* FSFWCONFIG_TMTC_PUSIDS_H_ */

View File

@ -1,16 +1,15 @@
#include <bsp_hosted/core/InitMission.h> #include <bsp_hosted/core/InitMission.h>
#include <bsp_hosted/core/ObjectFactory.h> #include <bsp_hosted/core/ObjectFactory.h>
#include "example/test/MutexExample.h"
#include "example/utility/utility.h"
#include <fsfw/platform.h>
#include <fsfw/objectmanager/ObjectManager.h> #include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/platform.h>
#include <fsfw/serviceinterface/ServiceInterface.h> #include <fsfw/serviceinterface/ServiceInterface.h>
#include <fsfw/tasks/TaskFactory.h> #include <fsfw/tasks/TaskFactory.h>
#include <chrono> #include <chrono>
#include "example/test/MutexExample.h"
#include "example/utility/utility.h"
#ifdef PLATFORM_WIN #ifdef PLATFORM_WIN
static const char* COMPILE_PRINTOUT = "Windows"; static const char* COMPILE_PRINTOUT = "Windows";
#elif defined(PLATFORM_UNIX) #elif defined(PLATFORM_UNIX)
@ -27,42 +26,41 @@ ServiceInterfaceStream sif::error("ERROR", false, true, true);
#endif #endif
int main() { int main() {
utility::commonInitPrint("Hosted", COMPILE_PRINTOUT);
utility::commonInitPrint("Hosted", COMPILE_PRINTOUT);
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Producing system objects.." << std::endl; sif::info << "Producing system objects.." << std::endl;
#else #else
sif::printInfo("Producing system objects..\n"); sif::printInfo("Producing system objects..\n");
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
ObjectManager* objManager = ObjectManager::instance(); ObjectManager* objManager = ObjectManager::instance();
objManager->setObjectFactoryFunction(ObjectFactory::produce, nullptr); objManager->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Objects created successfully.." << std::endl; sif::info << "Objects created successfully.." << std::endl;
sif::info << "Initializing objects.." << std::endl; sif::info << "Initializing objects.." << std::endl;
#else #else
sif::printInfo("Objects created successfully..\n"); sif::printInfo("Objects created successfully..\n");
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
objManager->initialize(); objManager->initialize();
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Creating tasks.." << std::endl; sif::info << "Creating tasks.." << std::endl;
#else #else
sif::printInfo("Creating tasks..\n"); sif::printInfo("Creating tasks..\n");
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
InitMission::createTasks(); InitMission::createTasks();
MutexExample::example(); MutexExample::example();
//PusPacketCreator::createPusPacketAndPrint(); // PusPacketCreator::createPusPacketAndPrint();
/* Permanent loop. */ /* Permanent loop. */
for(;;) { for (;;) {
/* Sleep main thread, not needed anymore. */ /* Sleep main thread, not needed anymore. */
TaskFactory::delayTask(5000); TaskFactory::delayTask(5000);
} }
return 0; return 0;
} }

View File

@ -1,13 +1,10 @@
#include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h>
void printChar(const char* character, bool errStream) { void printChar(const char* character, bool errStream) {
if(errStream) { if (errStream) {
fprintf(stderr, "%c", *character); fprintf(stderr, "%c", *character);
} } else {
else { printf("%c", *character);
printf("%c", *character); }
}
} }

@ -1 +1 @@
Subproject commit c2a9db8ac8f7d8a153673a1c4d74a8d56922b56b Subproject commit c88a534e1c48387c6de584a4c9b0b75a81f9eeba

7
scripts/apply-clang-format.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
if [[ ! -f README.md ]]; then
cd ..
fi
find ./bsp_hosted -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./example_common -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i