added more files from main repo
This commit is contained in:
13
bsp_hosted/CMakeLists.txt
Normal file
13
bsp_hosted/CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
||||
target_sources(${TARGET_NAME}
|
||||
PRIVATE
|
||||
main.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(core)
|
||||
add_subdirectory(fsfwconfig)
|
||||
add_subdirectory(utility)
|
||||
|
||||
target_include_directories(${TARGET_NAME}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
18
bsp_hosted/Dockerfile
Normal file
18
bsp_hosted/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
||||
FROM ubuntu:latest
|
||||
# FROM alpine:latest
|
||||
|
||||
RUN apt-get update && apt-get install -y cmake g++
|
||||
# RUN apk add cmake make g++
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY . .
|
||||
|
||||
RUN set -ex; \
|
||||
rm -rf build-hosted; \
|
||||
mkdir build-hosted; \
|
||||
cd build-hosted; \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DOS_FSFW=host ..;
|
||||
|
||||
ENTRYPOINT ["cmake", "--build", "build-hosted"]
|
||||
CMD ["-j"]
|
||||
# CMD ["bash"]
|
9
bsp_hosted/bsp_hosted.mk
Normal file
9
bsp_hosted/bsp_hosted.mk
Normal file
@ -0,0 +1,9 @@
|
||||
CSRC += $(wildcard $(CURRENTPATH)/*.c)
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/*.cpp)
|
||||
|
||||
CSRC += $(wildcard $(CURRENTPATH)/core/*.c)
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/core/*.cpp)
|
||||
|
||||
CSRC += $(wildcard $(CURRENTPATH)/utility/*.c)
|
||||
|
||||
INCLUDES += $(CURRENTPATH)
|
5
bsp_hosted/core/CMakeLists.txt
Normal file
5
bsp_hosted/core/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${TARGET_NAME}
|
||||
PRIVATE
|
||||
InitMission.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
310
bsp_hosted/core/InitMission.cpp
Normal file
310
bsp_hosted/core/InitMission.cpp
Normal file
@ -0,0 +1,310 @@
|
||||
#include <OBSWConfig.h>
|
||||
|
||||
#include <bsp_hosted/core/InitMission.h>
|
||||
#include <bsp_hosted/fsfwconfig/objects/systemObjectList.h>
|
||||
#include <bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h>
|
||||
#include <fsfw/modes/HasModesIF.h>
|
||||
|
||||
#include <mission/utility/TaskCreation.h>
|
||||
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#include <mission/assemblies/TestAssembly.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <fsfw/osal/windows/winTaskHelpers.h>
|
||||
#endif
|
||||
|
||||
|
||||
void InitMission::createTasks() {
|
||||
TaskFactory* taskFactory = TaskFactory::instance();
|
||||
if(taskFactory == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
TaskPriority currPrio;
|
||||
#ifdef _WIN32
|
||||
currPrio = tasks::makeWinPriority();
|
||||
#endif
|
||||
|
||||
TaskDeadlineMissedFunction deadlineMissedFunc = nullptr;
|
||||
#if OBSW_PRINT_MISSED_DEADLINES == 1
|
||||
deadlineMissedFunc = TaskFactory::printMissedDeadline;
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_CORE_COMPONENTS == 1
|
||||
|
||||
#ifdef __unix__
|
||||
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);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
currPrio = 50;
|
||||
#endif
|
||||
/* UDP bridge */
|
||||
PeriodicTaskIF* udpBridgeTask = taskFactory->createPeriodicTask(
|
||||
"UDP_UNIX_BRIDGE", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2,
|
||||
deadlineMissedFunc
|
||||
);
|
||||
result = udpBridgeTask->addComponent(objects::UDP_BRIDGE);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("UDP bridge", objects::UDP_BRIDGE);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
currPrio = 80;
|
||||
#endif
|
||||
PeriodicTaskIF* udpPollingTask = taskFactory->createPeriodicTask(
|
||||
"UDP_POLLING", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc
|
||||
);
|
||||
result = udpPollingTask->addComponent(objects::UDP_POLLING_TASK);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("UDP polling", objects::UDP_POLLING_TASK);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
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);
|
||||
}
|
||||
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
||||
|
||||
#if OBSW_ADD_TASK_EXAMPLE == 1
|
||||
|
||||
#ifdef __unix__
|
||||
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) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "InitMission::createTasks: Timeslot demo task initialization failed!" <<
|
||||
std::endl;
|
||||
#else
|
||||
sif::printError("InitMission::createTasks: Timeslot demo task initialization failed!\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
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);
|
||||
}
|
||||
#endif /* OBSW_ADD_TASK_EXAMPLE == 1 */
|
||||
|
||||
|
||||
#if OBSW_ADD_PUS_STACK == 1
|
||||
/* PUS Services */
|
||||
#ifdef __unix__
|
||||
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);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
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);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
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);
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
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);
|
||||
}
|
||||
#endif /* OBSW_ADD_PUS_STACK == 1 */
|
||||
|
||||
#if OBSW_ADD_DEVICE_HANDLER_DEMO == 1
|
||||
#ifdef __unix__
|
||||
currPrio = 60;
|
||||
#elif _WIN32
|
||||
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) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "InitMission::createTasks: Test PST initialization failed!" << std::endl;
|
||||
#else
|
||||
sif::printError("InitMission::createTasks: Test PST initialization failed!\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if _WIN32
|
||||
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);
|
||||
}
|
||||
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
|
||||
|
||||
#if OBSW_ADD_CONTROLLER_DEMO == 1
|
||||
#ifdef __unix__
|
||||
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);
|
||||
}
|
||||
#endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */
|
||||
#ifdef __unix__
|
||||
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);
|
||||
}
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Starting tasks.." << std::endl;
|
||||
#else
|
||||
sif::printInfo("Starting tasks..\n");
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_CORE_COMPONENTS == 1
|
||||
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();
|
||||
#endif /* OBSW_ADD_PUS_STACK == 1 */
|
||||
|
||||
#if OBSW_ADD_TASK_EXAMPLE == 1
|
||||
timeslotDemoTask->startTask();
|
||||
readerTask->startTask();
|
||||
#endif /* OBSW_ADD_TASK_EXAMPLE == 1 */
|
||||
|
||||
#if OBSW_ADD_DEVICE_HANDLER_DEMO == 1
|
||||
testDevicesTimeslotTask->startTask();
|
||||
assemblyTask->startTask();
|
||||
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
|
||||
|
||||
#if OBSW_ADD_CONTROLLER_DEMO == 1
|
||||
controllerTask->startTask();
|
||||
#endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */
|
||||
|
||||
testTask->startTask();
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Tasks started.." << std::endl;
|
||||
#else
|
||||
sif::printInfo("Tasks started..\n");
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_DEVICE_HANDLER_DEMO
|
||||
HasModesIF* assembly = ObjectManager::instance()->get<HasModesIF>(objects::TEST_ASSEMBLY);
|
||||
if (assembly == nullptr){
|
||||
return;
|
||||
}
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Waiting 5 Seconds and then command Test Assembly to Normal, Dual" << std::endl;
|
||||
#else
|
||||
sif::printInfo("Waiting 5 Seconds and then command Test Assembly to Normal, Dual \n");
|
||||
#endif
|
||||
|
||||
TaskFactory::delayTask(5000);
|
||||
CommandMessage modeMessage;
|
||||
ModeMessage::setModeMessage(&modeMessage, ModeMessage::CMD_MODE_COMMAND,
|
||||
DeviceHandlerIF::MODE_NORMAL, TestAssembly::submodes::DUAL);
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Commanding Test Assembly to Normal, Dual" << std::endl;
|
||||
#else
|
||||
sif::printInfo("Commanding Test Assembly to Normal, Dual \n");
|
||||
#endif
|
||||
MessageQueueSenderIF::sendMessage(assembly->getCommandQueue(), &modeMessage,
|
||||
MessageQueueIF::NO_QUEUE);
|
||||
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO */
|
||||
}
|
||||
|
||||
|
10
bsp_hosted/core/InitMission.h
Normal file
10
bsp_hosted/core/InitMission.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef MISSION_CORE_INITMISSION_H_
|
||||
#define MISSION_CORE_INITMISSION_H_
|
||||
|
||||
#include <fsfw/objectmanager/SystemObjectIF.h>
|
||||
|
||||
namespace InitMission {
|
||||
void createTasks();
|
||||
};
|
||||
|
||||
#endif /* MISSION_CORE_INITMISSION_H_ */
|
57
bsp_hosted/core/ObjectFactory.cpp
Normal file
57
bsp_hosted/core/ObjectFactory.cpp
Normal file
@ -0,0 +1,57 @@
|
||||
#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 <test/TestTask.h>
|
||||
|
||||
#include <mission/utility/TmFunnel.h>
|
||||
#include <mission/core/GenericFactory.h>
|
||||
|
||||
#include <fsfw/monitoring/MonitoringMessageContent.h>
|
||||
#include <fsfw/storagemanager/PoolManager.h>
|
||||
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
|
||||
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||
|
||||
#include <fsfw/osal/common/UdpTcPollingTask.h>
|
||||
#include <fsfw/osal/common/UdpTmTcBridge.h>
|
||||
|
||||
void ObjectFactory::produce(void* args) {
|
||||
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::TM_STORE, poolCfg);
|
||||
}
|
||||
|
||||
{
|
||||
LocalPool::LocalPoolConfig poolCfg = {
|
||||
{16, 100}, {32, 50}, {64, 25}, {128,15}, {1024, 5}
|
||||
};
|
||||
new PoolManager(objects::IPC_STORE, poolCfg);
|
||||
}
|
||||
|
||||
/* TMTC Reception via UDP socket */
|
||||
auto tmtcBridge = new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_DISTRIBUTOR);
|
||||
tmtcBridge->setMaxNumberOfPacketsStored(20);
|
||||
new UdpTcPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE);
|
||||
|
||||
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
||||
|
||||
new TestTask(objects::TEST_TASK, false);
|
||||
|
||||
ObjectFactory::produceGenericObjects();
|
||||
}
|
12
bsp_hosted/core/ObjectFactory.h
Normal file
12
bsp_hosted/core/ObjectFactory.h
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef MISSION_CORE_OBJECTFACTORY_H_
|
||||
#define MISSION_CORE_OBJECTFACTORY_H_
|
||||
|
||||
namespace ObjectFactory {
|
||||
|
||||
void setStatics();
|
||||
void produce(void* args);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* MISSION_CORE_OBJECTFACTORY_H_ */
|
25
bsp_hosted/fsfwconfig/CMakeLists.txt
Normal file
25
bsp_hosted/fsfwconfig/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
target_sources(${TARGET_NAME}
|
||||
PRIVATE
|
||||
ipc/missionMessageTypes.cpp
|
||||
pollingsequence/pollingSequenceFactory.cpp
|
||||
)
|
||||
|
||||
# Add include paths for the executable
|
||||
target_include_directories(${TARGET_NAME}
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
# If a special translation file for object IDs exists, compile it.
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
objects/translateObjects.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
# If a special translation file for events exists, compile it.
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
events/translateEvents.cpp
|
||||
)
|
||||
endif()
|
72
bsp_hosted/fsfwconfig/FSFWConfig.h.in
Normal file
72
bsp_hosted/fsfwconfig/FSFWConfig.h.in
Normal file
@ -0,0 +1,72 @@
|
||||
#ifndef CONFIG_FSFWCONFIG_H_
|
||||
#define CONFIG_FSFWCONFIG_H_
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
//! Used to determine whether C++ ostreams are used which can increase
|
||||
//! the binary size significantly. If this is disabled,
|
||||
//! the C stdio functions can be used alternatively
|
||||
#define FSFW_CPP_OSTREAM_ENABLED 1
|
||||
|
||||
//! More FSFW related printouts depending on level. Useful for development.
|
||||
#define FSFW_VERBOSE_LEVEL 1
|
||||
|
||||
//! Can be used to completely disable printouts, even the C stdio ones.
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 0 && FSFW_VERBOSE_LEVEL == 0
|
||||
#define FSFW_DISABLE_PRINTOUT 0
|
||||
#endif
|
||||
|
||||
#define FSFW_USE_PUS_C_TELEMETRY 1
|
||||
|
||||
//! Can be used to disable the ANSI color sequences for C stdio.
|
||||
#define FSFW_COLORED_OUTPUT 1
|
||||
|
||||
//! If FSFW_OBJ_EVENT_TRANSLATION is set to one,
|
||||
//! additional output which requires the translation files translateObjects
|
||||
//! and translateEvents (and their compiled source files)
|
||||
#define FSFW_OBJ_EVENT_TRANSLATION 0
|
||||
|
||||
#if FSFW_OBJ_EVENT_TRANSLATION == 1
|
||||
//! Specify whether info events are printed too.
|
||||
#define FSFW_DEBUG_INFO 1
|
||||
#include "objects/translateObjects.h"
|
||||
#include "events/translateEvents.h"
|
||||
#else
|
||||
#endif
|
||||
|
||||
//! When using the newlib nano library, C99 support for stdio facilities
|
||||
//! will not be provided. This define should be set to 1 if this is the case.
|
||||
#define FSFW_NO_C99_IO 1
|
||||
|
||||
//! Specify whether a special mode store is used for Subsystem components.
|
||||
#define FSFW_USE_MODESTORE 0
|
||||
|
||||
//! Defines if the real time scheduler for linux should be used.
|
||||
//! If set to 0, this will also disable priority settings for linux
|
||||
//! as most systems will not allow to set nice values without privileges
|
||||
//! For embedded linux system set this to 1.
|
||||
//! If set to 1 the binary needs "cap_sys_nice=eip" privileges to run
|
||||
#define FSFW_USE_REALTIME_FOR_LINUX 0
|
||||
|
||||
namespace fsfwconfig {
|
||||
|
||||
//! Default timestamp size. The default timestamp will be an seven byte CDC short timestamp.
|
||||
static constexpr uint8_t FSFW_MISSION_TIMESTAMP_SIZE = 7;
|
||||
|
||||
//! Configure the allocated pool sizes for the event manager.
|
||||
static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240;
|
||||
static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120;
|
||||
static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120;
|
||||
|
||||
//! Defines the FIFO depth of each commanding service base which
|
||||
//! also determines how many commands a CSB service can handle in one cycle
|
||||
//! simultaneously. This will increase the required RAM for
|
||||
//! each CSB service !
|
||||
static constexpr uint8_t FSFW_CSB_FIFO_DEPTH = 6;
|
||||
|
||||
static constexpr size_t FSFW_PRINT_BUFFER_SIZE = 124;
|
||||
|
||||
}
|
||||
|
||||
#endif /* CONFIG_FSFWCONFIG_H_ */
|
25
bsp_hosted/fsfwconfig/OBSWConfig.h.in
Normal file
25
bsp_hosted/fsfwconfig/OBSWConfig.h.in
Normal file
@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @brief This file can be used to add preprocessor define for conditional
|
||||
* code inclusion exclusion or various other project constants and
|
||||
* properties in one place.
|
||||
*/
|
||||
#ifndef FSFWCONFIG_OBSWCONFIG_H_
|
||||
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||
|
||||
#include <commonConfig.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "events/subsystemIdRanges.h"
|
||||
#include "objects/systemObjectList.h"
|
||||
|
||||
namespace config {
|
||||
#endif
|
||||
|
||||
/* Add mission configuration flags here */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FSFWCONFIG_OBSWCONFIG_H_ */
|
11
bsp_hosted/fsfwconfig/events/subsystemIdRanges.h
Normal file
11
bsp_hosted/fsfwconfig/events/subsystemIdRanges.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef FSFWCONFIG_TMTC_SUBSYSTEMIDRANGES_H_
|
||||
#define FSFWCONFIG_TMTC_SUBSYSTEMIDRANGES_H_
|
||||
|
||||
#include <commonConfig.h>
|
||||
|
||||
namespace SUBSYSTEM_ID {
|
||||
enum subsystemId: uint8_t {
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* FSFWCONFIG_TMTC_SUBSYSTEMIDRANGES_H_ */
|
249
bsp_hosted/fsfwconfig/events/translateEvents.cpp
Normal file
249
bsp_hosted/fsfwconfig/events/translateEvents.cpp
Normal file
@ -0,0 +1,249 @@
|
||||
/**
|
||||
* @brief Auto-generated event translation file. Contains 78 translations.
|
||||
* @details
|
||||
* Generated on: 2021-05-28 18:21:33
|
||||
*/
|
||||
#include "translateEvents.h"
|
||||
|
||||
const char *STORE_SEND_WRITE_FAILED_STRING = "STORE_SEND_WRITE_FAILED";
|
||||
const char *STORE_WRITE_FAILED_STRING = "STORE_WRITE_FAILED";
|
||||
const char *STORE_SEND_READ_FAILED_STRING = "STORE_SEND_READ_FAILED";
|
||||
const char *STORE_READ_FAILED_STRING = "STORE_READ_FAILED";
|
||||
const char *UNEXPECTED_MSG_STRING = "UNEXPECTED_MSG";
|
||||
const char *STORING_FAILED_STRING = "STORING_FAILED";
|
||||
const char *TM_DUMP_FAILED_STRING = "TM_DUMP_FAILED";
|
||||
const char *STORE_INIT_FAILED_STRING = "STORE_INIT_FAILED";
|
||||
const char *STORE_INIT_EMPTY_STRING = "STORE_INIT_EMPTY";
|
||||
const char *STORE_CONTENT_CORRUPTED_STRING = "STORE_CONTENT_CORRUPTED";
|
||||
const char *STORE_INITIALIZE_STRING = "STORE_INITIALIZE";
|
||||
const char *INIT_DONE_STRING = "INIT_DONE";
|
||||
const char *DUMP_FINISHED_STRING = "DUMP_FINISHED";
|
||||
const char *DELETION_FINISHED_STRING = "DELETION_FINISHED";
|
||||
const char *DELETION_FAILED_STRING = "DELETION_FAILED";
|
||||
const char *AUTO_CATALOGS_SENDING_FAILED_STRING = "AUTO_CATALOGS_SENDING_FAILED";
|
||||
const char *GET_DATA_FAILED_STRING = "GET_DATA_FAILED";
|
||||
const char *STORE_DATA_FAILED_STRING = "STORE_DATA_FAILED";
|
||||
const char *DEVICE_BUILDING_COMMAND_FAILED_STRING = "DEVICE_BUILDING_COMMAND_FAILED";
|
||||
const char *DEVICE_SENDING_COMMAND_FAILED_STRING = "DEVICE_SENDING_COMMAND_FAILED";
|
||||
const char *DEVICE_REQUESTING_REPLY_FAILED_STRING = "DEVICE_REQUESTING_REPLY_FAILED";
|
||||
const char *DEVICE_READING_REPLY_FAILED_STRING = "DEVICE_READING_REPLY_FAILED";
|
||||
const char *DEVICE_INTERPRETING_REPLY_FAILED_STRING = "DEVICE_INTERPRETING_REPLY_FAILED";
|
||||
const char *DEVICE_MISSED_REPLY_STRING = "DEVICE_MISSED_REPLY";
|
||||
const char *DEVICE_UNKNOWN_REPLY_STRING = "DEVICE_UNKNOWN_REPLY";
|
||||
const char *DEVICE_UNREQUESTED_REPLY_STRING = "DEVICE_UNREQUESTED_REPLY";
|
||||
const char *INVALID_DEVICE_COMMAND_STRING = "INVALID_DEVICE_COMMAND";
|
||||
const char *MONITORING_LIMIT_EXCEEDED_STRING = "MONITORING_LIMIT_EXCEEDED";
|
||||
const char *MONITORING_AMBIGUOUS_STRING = "MONITORING_AMBIGUOUS";
|
||||
const char *FUSE_CURRENT_HIGH_STRING = "FUSE_CURRENT_HIGH";
|
||||
const char *FUSE_WENT_OFF_STRING = "FUSE_WENT_OFF";
|
||||
const char *POWER_ABOVE_HIGH_LIMIT_STRING = "POWER_ABOVE_HIGH_LIMIT";
|
||||
const char *POWER_BELOW_LOW_LIMIT_STRING = "POWER_BELOW_LOW_LIMIT";
|
||||
const char *SWITCH_WENT_OFF_STRING = "SWITCH_WENT_OFF";
|
||||
const char *HEATER_ON_STRING = "HEATER_ON";
|
||||
const char *HEATER_OFF_STRING = "HEATER_OFF";
|
||||
const char *HEATER_TIMEOUT_STRING = "HEATER_TIMEOUT";
|
||||
const char *HEATER_STAYED_ON_STRING = "HEATER_STAYED_ON";
|
||||
const char *HEATER_STAYED_OFF_STRING = "HEATER_STAYED_OFF";
|
||||
const char *TEMP_SENSOR_HIGH_STRING = "TEMP_SENSOR_HIGH";
|
||||
const char *TEMP_SENSOR_LOW_STRING = "TEMP_SENSOR_LOW";
|
||||
const char *TEMP_SENSOR_GRADIENT_STRING = "TEMP_SENSOR_GRADIENT";
|
||||
const char *COMPONENT_TEMP_LOW_STRING = "COMPONENT_TEMP_LOW";
|
||||
const char *COMPONENT_TEMP_HIGH_STRING = "COMPONENT_TEMP_HIGH";
|
||||
const char *COMPONENT_TEMP_OOL_LOW_STRING = "COMPONENT_TEMP_OOL_LOW";
|
||||
const char *COMPONENT_TEMP_OOL_HIGH_STRING = "COMPONENT_TEMP_OOL_HIGH";
|
||||
const char *TEMP_NOT_IN_OP_RANGE_STRING = "TEMP_NOT_IN_OP_RANGE";
|
||||
const char *FDIR_CHANGED_STATE_STRING = "FDIR_CHANGED_STATE";
|
||||
const char *FDIR_STARTS_RECOVERY_STRING = "FDIR_STARTS_RECOVERY";
|
||||
const char *FDIR_TURNS_OFF_DEVICE_STRING = "FDIR_TURNS_OFF_DEVICE";
|
||||
const char *MONITOR_CHANGED_STATE_STRING = "MONITOR_CHANGED_STATE";
|
||||
const char *VALUE_BELOW_LOW_LIMIT_STRING = "VALUE_BELOW_LOW_LIMIT";
|
||||
const char *VALUE_ABOVE_HIGH_LIMIT_STRING = "VALUE_ABOVE_HIGH_LIMIT";
|
||||
const char *VALUE_OUT_OF_RANGE_STRING = "VALUE_OUT_OF_RANGE";
|
||||
const char *SWITCHING_TM_FAILED_STRING = "SWITCHING_TM_FAILED";
|
||||
const char *CHANGING_MODE_STRING = "CHANGING_MODE";
|
||||
const char *MODE_INFO_STRING = "MODE_INFO";
|
||||
const char *FALLBACK_FAILED_STRING = "FALLBACK_FAILED";
|
||||
const char *MODE_TRANSITION_FAILED_STRING = "MODE_TRANSITION_FAILED";
|
||||
const char *CANT_KEEP_MODE_STRING = "CANT_KEEP_MODE";
|
||||
const char *OBJECT_IN_INVALID_MODE_STRING = "OBJECT_IN_INVALID_MODE";
|
||||
const char *FORCING_MODE_STRING = "FORCING_MODE";
|
||||
const char *MODE_CMD_REJECTED_STRING = "MODE_CMD_REJECTED";
|
||||
const char *HEALTH_INFO_STRING = "HEALTH_INFO";
|
||||
const char *CHILD_CHANGED_HEALTH_STRING = "CHILD_CHANGED_HEALTH";
|
||||
const char *CHILD_PROBLEMS_STRING = "CHILD_PROBLEMS";
|
||||
const char *OVERWRITING_HEALTH_STRING = "OVERWRITING_HEALTH";
|
||||
const char *TRYING_RECOVERY_STRING = "TRYING_RECOVERY";
|
||||
const char *RECOVERY_STEP_STRING = "RECOVERY_STEP";
|
||||
const char *RECOVERY_DONE_STRING = "RECOVERY_DONE";
|
||||
const char *RF_AVAILABLE_STRING = "RF_AVAILABLE";
|
||||
const char *RF_LOST_STRING = "RF_LOST";
|
||||
const char *BIT_LOCK_STRING = "BIT_LOCK";
|
||||
const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST";
|
||||
const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED";
|
||||
const char *CLOCK_SET_STRING = "CLOCK_SET";
|
||||
const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE";
|
||||
const char *TEST_STRING = "TEST";
|
||||
|
||||
const char * translateEvents(Event event) {
|
||||
switch( (event & 0xffff) ) {
|
||||
case(2200):
|
||||
return STORE_SEND_WRITE_FAILED_STRING;
|
||||
case(2201):
|
||||
return STORE_WRITE_FAILED_STRING;
|
||||
case(2202):
|
||||
return STORE_SEND_READ_FAILED_STRING;
|
||||
case(2203):
|
||||
return STORE_READ_FAILED_STRING;
|
||||
case(2204):
|
||||
return UNEXPECTED_MSG_STRING;
|
||||
case(2205):
|
||||
return STORING_FAILED_STRING;
|
||||
case(2206):
|
||||
return TM_DUMP_FAILED_STRING;
|
||||
case(2207):
|
||||
return STORE_INIT_FAILED_STRING;
|
||||
case(2208):
|
||||
return STORE_INIT_EMPTY_STRING;
|
||||
case(2209):
|
||||
return STORE_CONTENT_CORRUPTED_STRING;
|
||||
case(2210):
|
||||
return STORE_INITIALIZE_STRING;
|
||||
case(2211):
|
||||
return INIT_DONE_STRING;
|
||||
case(2212):
|
||||
return DUMP_FINISHED_STRING;
|
||||
case(2213):
|
||||
return DELETION_FINISHED_STRING;
|
||||
case(2214):
|
||||
return DELETION_FAILED_STRING;
|
||||
case(2215):
|
||||
return AUTO_CATALOGS_SENDING_FAILED_STRING;
|
||||
case(2600):
|
||||
return GET_DATA_FAILED_STRING;
|
||||
case(2601):
|
||||
return STORE_DATA_FAILED_STRING;
|
||||
case(2800):
|
||||
return DEVICE_BUILDING_COMMAND_FAILED_STRING;
|
||||
case(2801):
|
||||
return DEVICE_SENDING_COMMAND_FAILED_STRING;
|
||||
case(2802):
|
||||
return DEVICE_REQUESTING_REPLY_FAILED_STRING;
|
||||
case(2803):
|
||||
return DEVICE_READING_REPLY_FAILED_STRING;
|
||||
case(2804):
|
||||
return DEVICE_INTERPRETING_REPLY_FAILED_STRING;
|
||||
case(2805):
|
||||
return DEVICE_MISSED_REPLY_STRING;
|
||||
case(2806):
|
||||
return DEVICE_UNKNOWN_REPLY_STRING;
|
||||
case(2807):
|
||||
return DEVICE_UNREQUESTED_REPLY_STRING;
|
||||
case(2808):
|
||||
return INVALID_DEVICE_COMMAND_STRING;
|
||||
case(2809):
|
||||
return MONITORING_LIMIT_EXCEEDED_STRING;
|
||||
case(2810):
|
||||
return MONITORING_AMBIGUOUS_STRING;
|
||||
case(4201):
|
||||
return FUSE_CURRENT_HIGH_STRING;
|
||||
case(4202):
|
||||
return FUSE_WENT_OFF_STRING;
|
||||
case(4204):
|
||||
return POWER_ABOVE_HIGH_LIMIT_STRING;
|
||||
case(4205):
|
||||
return POWER_BELOW_LOW_LIMIT_STRING;
|
||||
case(4300):
|
||||
return SWITCH_WENT_OFF_STRING;
|
||||
case(5000):
|
||||
return HEATER_ON_STRING;
|
||||
case(5001):
|
||||
return HEATER_OFF_STRING;
|
||||
case(5002):
|
||||
return HEATER_TIMEOUT_STRING;
|
||||
case(5003):
|
||||
return HEATER_STAYED_ON_STRING;
|
||||
case(5004):
|
||||
return HEATER_STAYED_OFF_STRING;
|
||||
case(5200):
|
||||
return TEMP_SENSOR_HIGH_STRING;
|
||||
case(5201):
|
||||
return TEMP_SENSOR_LOW_STRING;
|
||||
case(5202):
|
||||
return TEMP_SENSOR_GRADIENT_STRING;
|
||||
case(5901):
|
||||
return COMPONENT_TEMP_LOW_STRING;
|
||||
case(5902):
|
||||
return COMPONENT_TEMP_HIGH_STRING;
|
||||
case(5903):
|
||||
return COMPONENT_TEMP_OOL_LOW_STRING;
|
||||
case(5904):
|
||||
return COMPONENT_TEMP_OOL_HIGH_STRING;
|
||||
case(5905):
|
||||
return TEMP_NOT_IN_OP_RANGE_STRING;
|
||||
case(7101):
|
||||
return FDIR_CHANGED_STATE_STRING;
|
||||
case(7102):
|
||||
return FDIR_STARTS_RECOVERY_STRING;
|
||||
case(7103):
|
||||
return FDIR_TURNS_OFF_DEVICE_STRING;
|
||||
case(7201):
|
||||
return MONITOR_CHANGED_STATE_STRING;
|
||||
case(7202):
|
||||
return VALUE_BELOW_LOW_LIMIT_STRING;
|
||||
case(7203):
|
||||
return VALUE_ABOVE_HIGH_LIMIT_STRING;
|
||||
case(7204):
|
||||
return VALUE_OUT_OF_RANGE_STRING;
|
||||
case(7301):
|
||||
return SWITCHING_TM_FAILED_STRING;
|
||||
case(7400):
|
||||
return CHANGING_MODE_STRING;
|
||||
case(7401):
|
||||
return MODE_INFO_STRING;
|
||||
case(7402):
|
||||
return FALLBACK_FAILED_STRING;
|
||||
case(7403):
|
||||
return MODE_TRANSITION_FAILED_STRING;
|
||||
case(7404):
|
||||
return CANT_KEEP_MODE_STRING;
|
||||
case(7405):
|
||||
return OBJECT_IN_INVALID_MODE_STRING;
|
||||
case(7406):
|
||||
return FORCING_MODE_STRING;
|
||||
case(7407):
|
||||
return MODE_CMD_REJECTED_STRING;
|
||||
case(7506):
|
||||
return HEALTH_INFO_STRING;
|
||||
case(7507):
|
||||
return CHILD_CHANGED_HEALTH_STRING;
|
||||
case(7508):
|
||||
return CHILD_PROBLEMS_STRING;
|
||||
case(7509):
|
||||
return OVERWRITING_HEALTH_STRING;
|
||||
case(7510):
|
||||
return TRYING_RECOVERY_STRING;
|
||||
case(7511):
|
||||
return RECOVERY_STEP_STRING;
|
||||
case(7512):
|
||||
return RECOVERY_DONE_STRING;
|
||||
case(7900):
|
||||
return RF_AVAILABLE_STRING;
|
||||
case(7901):
|
||||
return RF_LOST_STRING;
|
||||
case(7902):
|
||||
return BIT_LOCK_STRING;
|
||||
case(7903):
|
||||
return BIT_LOCK_LOST_STRING;
|
||||
case(7905):
|
||||
return FRAME_PROCESSING_FAILED_STRING;
|
||||
case(8900):
|
||||
return CLOCK_SET_STRING;
|
||||
case(8901):
|
||||
return CLOCK_SET_FAILURE_STRING;
|
||||
case(9700):
|
||||
return TEST_STRING;
|
||||
default:
|
||||
return "UNKNOWN_EVENT";
|
||||
}
|
||||
return 0;
|
||||
}
|
8
bsp_hosted/fsfwconfig/events/translateEvents.h
Normal file
8
bsp_hosted/fsfwconfig/events/translateEvents.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_
|
||||
#define FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_
|
||||
|
||||
#include <fsfw/events/Event.h>
|
||||
|
||||
const char * translateEvents(Event event);
|
||||
|
||||
#endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */
|
8
bsp_hosted/fsfwconfig/fsfwconfig.mk
Normal file
8
bsp_hosted/fsfwconfig/fsfwconfig.mk
Normal file
@ -0,0 +1,8 @@
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/datapool/*.cpp)
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/events/*.cpp)
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/ipc/*.cpp)
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/objects/*.cpp)
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/pollingsequence/*.cpp)
|
||||
|
||||
INCLUDES += $(CURRENTPATH)
|
||||
INCLUDES += $(CURRENTPATH)/events
|
11
bsp_hosted/fsfwconfig/ipc/missionMessageTypes.cpp
Normal file
11
bsp_hosted/fsfwconfig/ipc/missionMessageTypes.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include "missionMessageTypes.h"
|
||||
#include <fsfw/ipc/CommandMessage.h>
|
||||
#include <fsfw/ipc/CommandMessageCleaner.h>
|
||||
|
||||
void messagetypes::clearMissionMessage(CommandMessage* message) {
|
||||
switch((message->getMessageType())) {
|
||||
default:
|
||||
message->setCommand(CommandMessage::CMD_NONE);
|
||||
break;
|
||||
}
|
||||
}
|
19
bsp_hosted/fsfwconfig/ipc/missionMessageTypes.h
Normal file
19
bsp_hosted/fsfwconfig/ipc/missionMessageTypes.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef FSFWCONFIG_IPC_MISSIONMESSAGETYPES_H_
|
||||
#define FSFWCONFIG_IPC_MISSIONMESSAGETYPES_H_
|
||||
|
||||
#include <fsfw/ipc/FwMessageTypes.h>
|
||||
|
||||
class CommandMessage;
|
||||
|
||||
namespace messagetypes {
|
||||
/* First type must have number MESSAGE_TYPE::FW_MESSAGES_COUNT! */
|
||||
/* Remember to add new message types to the clearMissionMessage function below! */
|
||||
enum MISSION_MESSAGE_TYPE {
|
||||
COSTUM_MESSAGE = FW_MESSAGES_COUNT,
|
||||
};
|
||||
|
||||
void clearMissionMessage(CommandMessage* message);
|
||||
|
||||
}
|
||||
|
||||
#endif /* FSFWCONFIG_IPC_MISSIONMESSAGETYPES_H_ */
|
16
bsp_hosted/fsfwconfig/objects/systemObjectList.h
Normal file
16
bsp_hosted/fsfwconfig/objects/systemObjectList.h
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef FSFWCONFIG_OBJECTS_SYSTEMOBJECTLIST_H_
|
||||
#define FSFWCONFIG_OBJECTS_SYSTEMOBJECTLIST_H_
|
||||
|
||||
#include <commonSystemObjects.h>
|
||||
|
||||
namespace objects {
|
||||
enum mission_objects {
|
||||
/* 0x62 ('b') Board and mission specific objects */
|
||||
UDP_BRIDGE = 0x62000300,
|
||||
UDP_POLLING_TASK = 0x62000400,
|
||||
/* Generic name for FSFW static ID setter */
|
||||
DOWNLINK_DESTINATION = UDP_BRIDGE
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* FSFWCONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ */
|
127
bsp_hosted/fsfwconfig/objects/translateObjects.cpp
Normal file
127
bsp_hosted/fsfwconfig/objects/translateObjects.cpp
Normal file
@ -0,0 +1,127 @@
|
||||
/**
|
||||
* @brief Auto-generated object translation file.
|
||||
* @details
|
||||
* Contains 37 translations.
|
||||
* Generated on: 2021-05-28 18:12:56
|
||||
*/
|
||||
#include "translateObjects.h"
|
||||
|
||||
const char *TEST_ASSEMBLY_STRING = "TEST_ASSEMBLY";
|
||||
const char *TEST_CONTROLLER_STRING = "TEST_CONTROLLER";
|
||||
const char *TEST_DEVICE_HANDLER_0_STRING = "TEST_DEVICE_HANDLER_0";
|
||||
const char *TEST_DEVICE_HANDLER_1_STRING = "TEST_DEVICE_HANDLER_1";
|
||||
const char *TEST_ECHO_COM_IF_STRING = "TEST_ECHO_COM_IF";
|
||||
const char *FSFW_OBJECTS_START_STRING = "FSFW_OBJECTS_START";
|
||||
const char *PUS_SERVICE_1_VERIFICATION_STRING = "PUS_SERVICE_1_VERIFICATION";
|
||||
const char *PUS_SERVICE_2_DEVICE_ACCESS_STRING = "PUS_SERVICE_2_DEVICE_ACCESS";
|
||||
const char *PUS_SERVICE_3_HOUSEKEEPING_STRING = "PUS_SERVICE_3_HOUSEKEEPING";
|
||||
const char *PUS_SERVICE_5_EVENT_REPORTING_STRING = "PUS_SERVICE_5_EVENT_REPORTING";
|
||||
const char *PUS_SERVICE_8_FUNCTION_MGMT_STRING = "PUS_SERVICE_8_FUNCTION_MGMT";
|
||||
const char *PUS_SERVICE_9_TIME_MGMT_STRING = "PUS_SERVICE_9_TIME_MGMT";
|
||||
const char *PUS_SERVICE_17_TEST_STRING = "PUS_SERVICE_17_TEST";
|
||||
const char *PUS_SERVICE_20_PARAMETERS_STRING = "PUS_SERVICE_20_PARAMETERS";
|
||||
const char *PUS_SERVICE_200_MODE_MGMT_STRING = "PUS_SERVICE_200_MODE_MGMT";
|
||||
const char *PUS_SERVICE_201_HEALTH_STRING = "PUS_SERVICE_201_HEALTH";
|
||||
const char *HEALTH_TABLE_STRING = "HEALTH_TABLE";
|
||||
const char *MODE_STORE_STRING = "MODE_STORE";
|
||||
const char *EVENT_MANAGER_STRING = "EVENT_MANAGER";
|
||||
const char *INTERNAL_ERROR_REPORTER_STRING = "INTERNAL_ERROR_REPORTER";
|
||||
const char *TC_STORE_STRING = "TC_STORE";
|
||||
const char *TM_STORE_STRING = "TM_STORE";
|
||||
const char *IPC_STORE_STRING = "IPC_STORE";
|
||||
const char *TIME_STAMPER_STRING = "TIME_STAMPER";
|
||||
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
||||
const char *UDP_BRIDGE_STRING = "UDP_BRIDGE";
|
||||
const char *UDP_POLLING_TASK_STRING = "UDP_POLLING_TASK";
|
||||
const char *CCSDS_DISTRIBUTOR_STRING = "CCSDS_DISTRIBUTOR";
|
||||
const char *PUS_DISTRIBUTOR_STRING = "PUS_DISTRIBUTOR";
|
||||
const char *TM_FUNNEL_STRING = "TM_FUNNEL";
|
||||
const char *TEST_DUMMY_1_STRING = "TEST_DUMMY_1";
|
||||
const char *TEST_DUMMY_2_STRING = "TEST_DUMMY_2";
|
||||
const char *TEST_DUMMY_3_STRING = "TEST_DUMMY_3";
|
||||
const char *TEST_DUMMY_4_STRING = "TEST_DUMMY_4";
|
||||
const char *TEST_DUMMY_5_STRING = "TEST_DUMMY_5";
|
||||
const char *TEST_TASK_STRING = "TEST_TASK";
|
||||
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
||||
|
||||
const char* translateObject(object_id_t object) {
|
||||
switch( (object & 0xFFFFFFFF) ) {
|
||||
case 0x4100CAFE:
|
||||
return TEST_ASSEMBLY_STRING;
|
||||
case 0x4301CAFE:
|
||||
return TEST_CONTROLLER_STRING;
|
||||
case 0x4401AFFE:
|
||||
return TEST_DEVICE_HANDLER_0_STRING;
|
||||
case 0x4402AFFE:
|
||||
return TEST_DEVICE_HANDLER_1_STRING;
|
||||
case 0x4900AFFE:
|
||||
return TEST_ECHO_COM_IF_STRING;
|
||||
case 0x53000000:
|
||||
return FSFW_OBJECTS_START_STRING;
|
||||
case 0x53000001:
|
||||
return PUS_SERVICE_1_VERIFICATION_STRING;
|
||||
case 0x53000002:
|
||||
return PUS_SERVICE_2_DEVICE_ACCESS_STRING;
|
||||
case 0x53000003:
|
||||
return PUS_SERVICE_3_HOUSEKEEPING_STRING;
|
||||
case 0x53000005:
|
||||
return PUS_SERVICE_5_EVENT_REPORTING_STRING;
|
||||
case 0x53000008:
|
||||
return PUS_SERVICE_8_FUNCTION_MGMT_STRING;
|
||||
case 0x53000009:
|
||||
return PUS_SERVICE_9_TIME_MGMT_STRING;
|
||||
case 0x53000017:
|
||||
return PUS_SERVICE_17_TEST_STRING;
|
||||
case 0x53000020:
|
||||
return PUS_SERVICE_20_PARAMETERS_STRING;
|
||||
case 0x53000200:
|
||||
return PUS_SERVICE_200_MODE_MGMT_STRING;
|
||||
case 0x53000201:
|
||||
return PUS_SERVICE_201_HEALTH_STRING;
|
||||
case 0x53010000:
|
||||
return HEALTH_TABLE_STRING;
|
||||
case 0x53010100:
|
||||
return MODE_STORE_STRING;
|
||||
case 0x53030000:
|
||||
return EVENT_MANAGER_STRING;
|
||||
case 0x53040000:
|
||||
return INTERNAL_ERROR_REPORTER_STRING;
|
||||
case 0x534f0100:
|
||||
return TC_STORE_STRING;
|
||||
case 0x534f0200:
|
||||
return TM_STORE_STRING;
|
||||
case 0x534f0300:
|
||||
return IPC_STORE_STRING;
|
||||
case 0x53500010:
|
||||
return TIME_STAMPER_STRING;
|
||||
case 0x53ffffff:
|
||||
return FSFW_OBJECTS_END_STRING;
|
||||
case 0x62000300:
|
||||
return UDP_BRIDGE_STRING;
|
||||
case 0x62000400:
|
||||
return UDP_POLLING_TASK_STRING;
|
||||
case 0x63000000:
|
||||
return CCSDS_DISTRIBUTOR_STRING;
|
||||
case 0x63000001:
|
||||
return PUS_DISTRIBUTOR_STRING;
|
||||
case 0x63000002:
|
||||
return TM_FUNNEL_STRING;
|
||||
case 0x74000001:
|
||||
return TEST_DUMMY_1_STRING;
|
||||
case 0x74000002:
|
||||
return TEST_DUMMY_2_STRING;
|
||||
case 0x74000003:
|
||||
return TEST_DUMMY_3_STRING;
|
||||
case 0x74000004:
|
||||
return TEST_DUMMY_4_STRING;
|
||||
case 0x74000005:
|
||||
return TEST_DUMMY_5_STRING;
|
||||
case 0x7400CAFE:
|
||||
return TEST_TASK_STRING;
|
||||
case 0xFFFFFFFF:
|
||||
return NO_OBJECT_STRING;
|
||||
default:
|
||||
return "UNKNOWN_OBJECT";
|
||||
}
|
||||
return 0;
|
||||
}
|
8
bsp_hosted/fsfwconfig/objects/translateObjects.h
Normal file
8
bsp_hosted/fsfwconfig/objects/translateObjects.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_
|
||||
#define FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_
|
||||
|
||||
#include <fsfw/objectmanager/SystemObjectIF.h>
|
||||
|
||||
const char* translateObject(object_id_t object);
|
||||
|
||||
#endif /* FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ */
|
@ -0,0 +1,5 @@
|
||||
/**
|
||||
* Add polling sequence initialization which are not common to every BSP here.
|
||||
*/
|
||||
#include "pollingSequenceFactory.h"
|
||||
|
@ -0,0 +1,14 @@
|
||||
#ifndef POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_
|
||||
#define POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
|
||||
class FixedTimeslotTaskIF;
|
||||
|
||||
namespace pst {
|
||||
ReturnValue_t pollingSequenceExamples(FixedTimeslotTaskIF *thisSequence);
|
||||
ReturnValue_t pollingSequenceDevices(FixedTimeslotTaskIF* thisSequence);
|
||||
}
|
||||
|
||||
#endif /* POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_ */
|
14
bsp_hosted/fsfwconfig/returnvalues/classIds.h
Normal file
14
bsp_hosted/fsfwconfig/returnvalues/classIds.h
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef FSFWCONFIG_RETURNVALUES_CLASSIDS_H_
|
||||
#define FSFWCONFIG_RETURNVALUES_CLASSIDS_H_
|
||||
|
||||
#include "commonClassIds.h"
|
||||
|
||||
namespace CLASS_ID {
|
||||
enum classIds: uint8_t {
|
||||
CLASS_ID_START = COMMON_CLASS_ID_END,
|
||||
CLASS_ID_END // [EXPORT] : [END]
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif /* FSFWCONFIG_RETURNVALUES_CLASSIDS_H_ */
|
11
bsp_hosted/fsfwconfig/tmtc/apid.h
Normal file
11
bsp_hosted/fsfwconfig/tmtc/apid.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef FSFWCONFIG_TMTC_APID_H_
|
||||
#define FSFWCONFIG_TMTC_APID_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <commonConfig.h>
|
||||
|
||||
namespace apid {
|
||||
static const uint16_t APID = COMMON_APID;
|
||||
};
|
||||
|
||||
#endif /* FSFWCONFIG_TMTC_APID_H_ */
|
7
bsp_hosted/fsfwconfig/tmtc/pusIds.h
Normal file
7
bsp_hosted/fsfwconfig/tmtc/pusIds.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef FSFWCONFIG_TMTC_PUSIDS_H_
|
||||
#define FSFWCONFIG_TMTC_PUSIDS_H_
|
||||
|
||||
#include <commonConfig.h>
|
||||
|
||||
|
||||
#endif /* FSFWCONFIG_TMTC_PUSIDS_H_ */
|
68
bsp_hosted/main.cpp
Normal file
68
bsp_hosted/main.cpp
Normal file
@ -0,0 +1,68 @@
|
||||
#include <bsp_hosted/core/InitMission.h>
|
||||
#include <bsp_hosted/core/ObjectFactory.h>
|
||||
|
||||
#include <test/MutexExample.h>
|
||||
#include <common/utility/utility.h>
|
||||
#include <mission/utility/PusPacketCreator.h>
|
||||
|
||||
#include <fsfw/objectmanager/ObjectManager.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#ifdef WIN32
|
||||
static const char* COMPILE_PRINTOUT = "Windows";
|
||||
#elif LINUX
|
||||
static const char* COMPILE_PRINTOUT = "Linux";
|
||||
#else
|
||||
static const char* COMPILE_PRINTOUT = "unknown OS";
|
||||
#endif
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
ServiceInterfaceStream sif::debug("DEBUG", false);
|
||||
ServiceInterfaceStream sif::info("INFO", false);
|
||||
ServiceInterfaceStream sif::warning("WARNING", false);
|
||||
ServiceInterfaceStream sif::error("ERROR", false, true, true);
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
utility::commonInitPrint("Hosted", COMPILE_PRINTOUT);
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Producing system objects.." << std::endl;
|
||||
#else
|
||||
sif::printInfo("Producing system objects..\n");
|
||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||||
|
||||
ObjectManager* objManager = ObjectManager::instance();
|
||||
objManager->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Objects created successfully.." << std::endl;
|
||||
sif::info << "Initializing objects.." << std::endl;
|
||||
#else
|
||||
sif::printInfo("Objects created successfully..\n");
|
||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||||
|
||||
objManager->initialize();
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Creating tasks.." << std::endl;
|
||||
#else
|
||||
sif::printInfo("Creating tasks..\n");
|
||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||||
|
||||
InitMission::createTasks();
|
||||
|
||||
MutexExample::example();
|
||||
PusPacketCreator::createPusPacketAndPrint();
|
||||
|
||||
/* Permanent loop. */
|
||||
for(;;) {
|
||||
/* Sleep main thread, not needed anymore. */
|
||||
TaskFactory::delayTask(5000);
|
||||
}
|
||||
return 0;
|
||||
}
|
7
bsp_hosted/utility/CMakeLists.txt
Normal file
7
bsp_hosted/utility/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${TARGET_NAME}
|
||||
PUBLIC
|
||||
printChar.c
|
||||
)
|
||||
|
||||
|
||||
|
13
bsp_hosted/utility/printChar.c
Normal file
13
bsp_hosted/utility/printChar.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
void printChar(const char* character, bool errStream) {
|
||||
if(errStream) {
|
||||
fprintf(stderr, "%c", *character);
|
||||
}
|
||||
else {
|
||||
printf("%c", *character);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user