testArduino/bsp_linux/main.cpp

57 lines
1.7 KiB
C++

#include <fsfw/datapool/DataPool.h>
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include <fsfw/tasks/TaskFactory.h>
#include <bsp_linux/core/InitMission.h>
#include <bsp_linux/core/ObjectFactory.h>
//#include <mission/test/MutexExample.h>
#include <mission/utility/PusPacketCreator.h>
#include <iostream>
#include "../bsp_linux/fsfwconfig/datapool/dataPoolInit.h"
#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
// This is configured for linux without \cr
ServiceInterfaceStream sif::debug("DEBUG", false);
ServiceInterfaceStream sif::info("INFO", false);
ServiceInterfaceStream sif::warning("WARNING", false);
ServiceInterfaceStream sif::error("ERROR", false, false, true);
ObjectManagerIF *objectManager = nullptr;
//Initialize Data Pool
DataPool dataPool(dataPoolInit);
#include <array>
int main() {
std::cout << "-- FSFW Example (Hosted) --" << std::endl;
std::cout << "-- Compiled for " << COMPILE_PRINTOUT << " --" << std::endl;
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
objectManager = new ObjectManager(ObjectFactory::produce);
sif::debug << "debug_MAIN: object produced" << std::endl;
objectManager->initialize();
sif::debug << "debug_MAIN: object initialized" << std::endl;
InitMission::createTasks();
sif::debug << "debug_MAIN: tasks created" << std::endl;
//MutexExample::example();
PusPacketCreator::createPusPacketAndPrint();
// Permanent loop.
for(;;) {
// sleep main thread, not needed anymore.
TaskFactory::delayTask(5000);
}
return 0;
}