From 7b605deb90c5b05312fa67d969248089ddb9fd19 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 5 Jun 2021 00:05:12 +0200 Subject: [PATCH 1/7] submodule update --- fsfw | 2 +- fsfw_hal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 070c3f3..33e7c63 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 070c3f3bbfdbddbda54b18cdb5d1c9928640a0dd +Subproject commit 33e7c635c57055597caf3d9e9cbafc15c7364266 diff --git a/fsfw_hal b/fsfw_hal index c50868c..f7f6e4d 160000 --- a/fsfw_hal +++ b/fsfw_hal @@ -1 +1 @@ -Subproject commit c50868c9dc46e27ae59e79f83f27723766656f08 +Subproject commit f7f6e4d520295083818c971c00ffbc4af6d94c76 From f80fcac60ab1b73f9c799607d2078a4d7139ce0d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 5 Jun 2021 14:42:41 +0200 Subject: [PATCH 2/7] fsfw hal update --- fsfw_hal | 2 +- misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw_hal b/fsfw_hal index f7f6e4d..a35fdbc 160000 --- a/fsfw_hal +++ b/fsfw_hal @@ -1 +1 @@ -Subproject commit f7f6e4d520295083818c971c00ffbc4af6d94c76 +Subproject commit a35fdbc5dc7fa4f22cc0b949b001d85df9729dfa diff --git a/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch b/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch index c2dbd65..a8c0c1e 100644 --- a/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch +++ b/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch @@ -59,6 +59,6 @@ - + From 84134d4728eaef477a22fcbe21ab2758adf5a267 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 5 Jun 2021 14:50:14 +0200 Subject: [PATCH 3/7] fsfw_hal update --- fsfw_hal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw_hal b/fsfw_hal index a35fdbc..93db545 160000 --- a/fsfw_hal +++ b/fsfw_hal @@ -1 +1 @@ -Subproject commit a35fdbc5dc7fa4f22cc0b949b001d85df9729dfa +Subproject commit 93db545a1a573d39d17a4c14db5a21255f3f89c4 From dfc2e6bf67114ea59c82e0bc7adf2c095ca9cb7d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 5 Jun 2021 14:51:45 +0200 Subject: [PATCH 4/7] fsfw_hal update --- fsfw_hal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw_hal b/fsfw_hal index 93db545..d194b75 160000 --- a/fsfw_hal +++ b/fsfw_hal @@ -1 +1 @@ -Subproject commit 93db545a1a573d39d17a4c14db5a21255f3f89c4 +Subproject commit d194b759c4781f6384786010c460382de97830c2 From 0747db41ffead1449f71be79e005145c2af17afd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 5 Jun 2021 20:16:57 +0200 Subject: [PATCH 5/7] obj factory is singleton now --- bsp_stm32_freertos/core/InitMission.cpp | 5 ++--- bsp_stm32_freertos/core/ObjectFactory.cpp | 2 +- bsp_stm32_freertos/core/ObjectFactory.h | 2 +- bsp_stm32_freertos/main.cpp | 8 ++++---- .../stm32_nucleo/networking/UdpTcLwIpPollingTask.cpp | 3 ++- fsfw | 2 +- mission/assemblies/TestAssembly.cpp | 6 +++--- mission/controller/TestController.cpp | 7 ++++--- mission/utility/TmFunnel.cpp | 11 ++++++----- test/FsfwExampleTask.cpp | 12 ++++++------ test/TestTask.cpp | 4 ++-- 11 files changed, 32 insertions(+), 30 deletions(-) diff --git a/bsp_stm32_freertos/core/InitMission.cpp b/bsp_stm32_freertos/core/InitMission.cpp index 1b9cdcd..e4fa9da 100644 --- a/bsp_stm32_freertos/core/InitMission.cpp +++ b/bsp_stm32_freertos/core/InitMission.cpp @@ -1,6 +1,5 @@ #include "InitMission.h" #include "OBSWConfig.h" - #include "objects/systemObjectList.h" #include "pollingsequence/pollingSequenceFactory.h" @@ -8,7 +7,7 @@ #include "mission/assemblies/TestAssembly.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h" -#include "fsfw/serviceinterface/ServiceInterfaceStream.h" +#include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/tasks/FixedTimeslotTaskIF.h" #include "fsfw/tasks/PeriodicTaskIF.h" #include "fsfw/tasks/TaskFactory.h" @@ -195,7 +194,7 @@ void InitMission::createTasks() { #endif #if OBSW_ADD_DEVICE_HANDLER_DEMO - HasModesIF* assembly = objectManager->get(objects::TEST_ASSEMBLY); + HasModesIF* assembly = ObjectManager::instance()->get(objects::TEST_ASSEMBLY); if (assembly == nullptr){ return; } diff --git a/bsp_stm32_freertos/core/ObjectFactory.cpp b/bsp_stm32_freertos/core/ObjectFactory.cpp index 3935aa6..3c13e22 100644 --- a/bsp_stm32_freertos/core/ObjectFactory.cpp +++ b/bsp_stm32_freertos/core/ObjectFactory.cpp @@ -17,7 +17,7 @@ #include #include -void ObjectFactory::produce() { +void ObjectFactory::produce(void* args) { /* Located inside GenericFactory source file */ Factory::setStaticFrameworkObjectIds(); diff --git a/bsp_stm32_freertos/core/ObjectFactory.h b/bsp_stm32_freertos/core/ObjectFactory.h index 0d78319..1151a9e 100644 --- a/bsp_stm32_freertos/core/ObjectFactory.h +++ b/bsp_stm32_freertos/core/ObjectFactory.h @@ -4,7 +4,7 @@ namespace ObjectFactory { void setStatics(); - void produce(); + void produce(void* args); }; #endif /* MISSION_CORE_OBJECTFACTORY_H_ */ diff --git a/bsp_stm32_freertos/main.cpp b/bsp_stm32_freertos/main.cpp index 8383bbe..55c4eb1 100644 --- a/bsp_stm32_freertos/main.cpp +++ b/bsp_stm32_freertos/main.cpp @@ -33,8 +33,6 @@ ServiceInterfaceStream sif::warning("WARNING", true); ServiceInterfaceStream sif::error("ERROR", true); #endif -ObjectManagerIF *objectManager = nullptr; - void initTask(void *parameters); /** @@ -70,8 +68,10 @@ void initTask(void *parameters) { sif::printInfo("Creating objects..\n\r"); #endif - objectManager = new ObjectManager(ObjectFactory::produce); - objectManager->initialize(); + ObjectManager* objManager = ObjectManager::instance(); + objManager->setObjectFactoryFunction(ObjectFactory::produce, nullptr); + objManager->initialize(); + #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "Creating tasks.." << std::endl; #else diff --git a/common/stm32_nucleo/networking/UdpTcLwIpPollingTask.cpp b/common/stm32_nucleo/networking/UdpTcLwIpPollingTask.cpp index 4972976..11cd564 100644 --- a/common/stm32_nucleo/networking/UdpTcLwIpPollingTask.cpp +++ b/common/stm32_nucleo/networking/UdpTcLwIpPollingTask.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -18,7 +19,7 @@ UdpTcLwIpPollingTask::~UdpTcLwIpPollingTask() { } ReturnValue_t UdpTcLwIpPollingTask::initialize() { - udpBridge = objectManager->get(bridgeId); + udpBridge = ObjectManager::instance()->get(bridgeId); if(udpBridge == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; } diff --git a/fsfw b/fsfw index 33e7c63..50fac22 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 33e7c635c57055597caf3d9e9cbafc15c7364266 +Subproject commit 50fac22f54031e409306931e15d2e63426aa03b2 diff --git a/mission/assemblies/TestAssembly.cpp b/mission/assemblies/TestAssembly.cpp index 86dab25..8f4debc 100644 --- a/mission/assemblies/TestAssembly.cpp +++ b/mission/assemblies/TestAssembly.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include TestAssembly::TestAssembly(object_id_t objectId, object_id_t parentId): @@ -149,8 +149,8 @@ ReturnValue_t TestAssembly::initialize() { if(result != RETURN_OK){ return result; } - handler0 = objectManager->get(objects::TEST_DEVICE_HANDLER_0); - handler1 = objectManager->get(objects::TEST_DEVICE_HANDLER_1); + handler0 = ObjectManager::instance()->get(objects::TEST_DEVICE_HANDLER_0); + handler1 = ObjectManager::instance()->get(objects::TEST_DEVICE_HANDLER_1); if((handler0 == nullptr) or (handler1 == nullptr)){ return HasReturnvaluesIF::RETURN_FAILED; } diff --git a/mission/controller/TestController.cpp b/mission/controller/TestController.cpp index 46f75f3..385d07b 100644 --- a/mission/controller/TestController.cpp +++ b/mission/controller/TestController.cpp @@ -1,7 +1,8 @@ #include "TestController.h" -#include +#include "OBSWConfig.h" #include +#include #include TestController::TestController(object_id_t objectId, size_t commandQueueDepth): @@ -161,7 +162,7 @@ ReturnValue_t TestController::initializeLocalDataPool(localpool::DataPool &local ReturnValue_t TestController::initializeAfterTaskCreation() { namespace td = testdevice; - HasLocalDataPoolIF* device0 = objectManager->get( + HasLocalDataPoolIF* device0 = ObjectManager::instance()->get( objects::TEST_DEVICE_HANDLER_0); if(device0 == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -183,7 +184,7 @@ ReturnValue_t TestController::initializeAfterTaskCreation() { } - HasLocalDataPoolIF* device1 = objectManager->get( + HasLocalDataPoolIF* device1 = ObjectManager::instance()->get( objects::TEST_DEVICE_HANDLER_1); if(device1 == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 diff --git a/mission/utility/TmFunnel.cpp b/mission/utility/TmFunnel.cpp index b98c9e9..120cf4a 100644 --- a/mission/utility/TmFunnel.cpp +++ b/mission/utility/TmFunnel.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -81,7 +82,7 @@ ReturnValue_t TmFunnel::handlePacket(TmTcMessage* message) { ReturnValue_t TmFunnel::initialize() { - tmPool = objectManager->get(objects::TM_STORE); + tmPool = ObjectManager::instance()->get(objects::TM_STORE); if(tmPool == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "TmFunnel::initialize: TM store not set." << std::endl; @@ -91,8 +92,8 @@ ReturnValue_t TmFunnel::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - AcceptsTelemetryIF* tmTarget = - objectManager->get(downlinkDestination); + AcceptsTelemetryIF* tmTarget = ObjectManager::instance()-> + get(downlinkDestination); if(tmTarget == nullptr){ #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "TmFunnel::initialize: Downlink Destination not set." << std::endl; @@ -108,8 +109,8 @@ ReturnValue_t TmFunnel::initialize() { return SystemObject::initialize(); } - AcceptsTelemetryIF* storageTarget = - objectManager->get(storageDestination); + AcceptsTelemetryIF* storageTarget = ObjectManager::instance()-> + get(storageDestination); if(storageTarget != nullptr) { storageQueue->setDefaultDestination( storageTarget->getReportReceptionQueue()); diff --git a/test/FsfwExampleTask.cpp b/test/FsfwExampleTask.cpp index 3476ab9..7fe35ac 100644 --- a/test/FsfwExampleTask.cpp +++ b/test/FsfwExampleTask.cpp @@ -1,9 +1,10 @@ #include "FsfwExampleTask.h" -#include -#include -#include +#include "OBSWConfig.h" +#include "commonSystemObjects.h" +#include "objects/systemObjectList.h" #include +#include #include #include #include @@ -83,8 +84,7 @@ object_id_t FsfwExampleTask::getSender() { ReturnValue_t FsfwExampleTask::initialize() { // Get the dataset of the sender. Will be cached for later checks. object_id_t sender = getSender(); - HasLocalDataPoolIF* senderIF = - objectManager->get(sender); + HasLocalDataPoolIF* senderIF = ObjectManager::instance()->get(sender); if(senderIF == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "FsfwDemoTask::initialize: Sender object invalid!" << std::endl; @@ -163,7 +163,7 @@ ReturnValue_t FsfwExampleTask::performMonitoringDemo() { ReturnValue_t FsfwExampleTask::performSendOperation() { object_id_t nextRecipient = getNextRecipient(); - FsfwExampleTask* target = objectManager->get(nextRecipient); + FsfwExampleTask* target = ObjectManager::instance()->get(nextRecipient); if (target == nullptr) { /* Configuration error */ #if FSFW_CPP_OSTREAM_ENABLED == 1 diff --git a/test/TestTask.cpp b/test/TestTask.cpp index b1353d5..cb1a79d 100644 --- a/test/TestTask.cpp +++ b/test/TestTask.cpp @@ -1,6 +1,6 @@ #include "TestTask.h" -#include +#include #include bool TestTask::oneShotAction = true; @@ -12,7 +12,7 @@ TestTask::TestTask(object_id_t objectId, bool periodicPrintout): if(testLock == nullptr) { testLock = MutexFactory::instance()->createMutex(); } - IPCStore = objectManager->get(objects::IPC_STORE); + IPCStore = ObjectManager::instance()->get(objects::IPC_STORE); } TestTask::~TestTask() { From 9a491fc7dd628ae67217f18e089f05ff746cdf06 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 5 Jun 2021 20:23:38 +0200 Subject: [PATCH 6/7] fixes hosted build --- bsp_hosted/core/InitMission.cpp | 2 +- bsp_hosted/core/ObjectFactory.cpp | 8 +++----- bsp_hosted/core/ObjectFactory.h | 2 +- .../fsfwconfig/pollingsequence/pollingSequenceFactory.h | 2 +- bsp_hosted/main.cpp | 8 ++++---- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/bsp_hosted/core/InitMission.cpp b/bsp_hosted/core/InitMission.cpp index 0bd858e..c983861 100644 --- a/bsp_hosted/core/InitMission.cpp +++ b/bsp_hosted/core/InitMission.cpp @@ -283,7 +283,7 @@ void InitMission::createTasks() { #endif #if OBSW_ADD_DEVICE_HANDLER_DEMO - HasModesIF* assembly = objectManager->get(objects::TEST_ASSEMBLY); + HasModesIF* assembly = ObjectManager::instance()->get(objects::TEST_ASSEMBLY); if (assembly == nullptr){ return; } diff --git a/bsp_hosted/core/ObjectFactory.cpp b/bsp_hosted/core/ObjectFactory.cpp index bf5839e..b61fda1 100644 --- a/bsp_hosted/core/ObjectFactory.cpp +++ b/bsp_hosted/core/ObjectFactory.cpp @@ -1,8 +1,6 @@ -#include - -#include +#include "ObjectFactory.h" +#include "OBSWConfig.h" #include -#include #include #include @@ -21,7 +19,7 @@ #include #include -void ObjectFactory::produce(){ +void ObjectFactory::produce(void* args) { Factory::setStaticFrameworkObjectIds(); #if OBSW_ADD_CORE_COMPONENTS == 1 diff --git a/bsp_hosted/core/ObjectFactory.h b/bsp_hosted/core/ObjectFactory.h index 75d77a5..4b2d84c 100644 --- a/bsp_hosted/core/ObjectFactory.h +++ b/bsp_hosted/core/ObjectFactory.h @@ -4,7 +4,7 @@ namespace ObjectFactory { void setStatics(); -void produce(); +void produce(void* args); }; diff --git a/bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h index 87dd281..b696b78 100644 --- a/bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h +++ b/bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h @@ -1,7 +1,7 @@ #ifndef POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_ #define POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_ -#include +#include "OBSWConfig.h" #include class FixedTimeslotTaskIF; diff --git a/bsp_hosted/main.cpp b/bsp_hosted/main.cpp index 839fbab..6ffa5f8 100644 --- a/bsp_hosted/main.cpp +++ b/bsp_hosted/main.cpp @@ -26,8 +26,6 @@ ServiceInterfaceStream sif::warning("WARNING", false); ServiceInterfaceStream sif::error("ERROR", false, true, true); #endif -ObjectManagerIF *objectManager = nullptr; - int main() { utility::commonInitPrint("Hosted", COMPILE_PRINTOUT); @@ -38,7 +36,9 @@ int main() { sif::printInfo("Producing system objects..\n"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ - objectManager = new ObjectManager(ObjectFactory::produce); + ObjectManager* objManager = ObjectManager::instance(); + objManager->setObjectFactoryFunction(ObjectFactory::produce, nullptr); + #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "Objects created successfully.." << std::endl; @@ -47,7 +47,7 @@ int main() { sif::printInfo("Objects created successfully..\n"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ - objectManager->initialize(); + objManager->initialize(); #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "Creating tasks.." << std::endl; From 62878396804d16dc5fb4e71e6725a990b6e9d498 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 5 Jun 2021 20:30:55 +0200 Subject: [PATCH 7/7] fixed linux example --- bsp_hosted/main.cpp | 1 - bsp_linux/core/InitMission.cpp | 4 ++-- bsp_linux/core/ObjectFactory.cpp | 2 +- bsp_linux/core/ObjectFactory.h | 2 +- bsp_linux/main.cpp | 5 +++-- fsfw | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bsp_hosted/main.cpp b/bsp_hosted/main.cpp index 6ffa5f8..26b4414 100644 --- a/bsp_hosted/main.cpp +++ b/bsp_hosted/main.cpp @@ -39,7 +39,6 @@ int main() { 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; diff --git a/bsp_linux/core/InitMission.cpp b/bsp_linux/core/InitMission.cpp index 81ca23a..d74ba45 100644 --- a/bsp_linux/core/InitMission.cpp +++ b/bsp_linux/core/InitMission.cpp @@ -1,5 +1,5 @@ #include "InitMission.h" -#include +#include "OBSWConfig.h" #include #include @@ -216,7 +216,7 @@ void InitMission::createTasks() { #if OBSW_ADD_DEVICE_HANDLER_DEMO - HasModesIF* assembly = objectManager->get(objects::TEST_ASSEMBLY); + HasModesIF* assembly = ObjectManager::instance()->get(objects::TEST_ASSEMBLY); if (assembly == nullptr){ return; } diff --git a/bsp_linux/core/ObjectFactory.cpp b/bsp_linux/core/ObjectFactory.cpp index 0866c28..6a1fe59 100644 --- a/bsp_linux/core/ObjectFactory.cpp +++ b/bsp_linux/core/ObjectFactory.cpp @@ -20,7 +20,7 @@ #include -void ObjectFactory::produce() { +void ObjectFactory::produce(void* args) { /* Located inside the GenericFactory source file */ Factory::setStaticFrameworkObjectIds(); diff --git a/bsp_linux/core/ObjectFactory.h b/bsp_linux/core/ObjectFactory.h index 0d78319..1151a9e 100644 --- a/bsp_linux/core/ObjectFactory.h +++ b/bsp_linux/core/ObjectFactory.h @@ -4,7 +4,7 @@ namespace ObjectFactory { void setStatics(); - void produce(); + void produce(void* args); }; #endif /* MISSION_CORE_OBJECTFACTORY_H_ */ diff --git a/bsp_linux/main.cpp b/bsp_linux/main.cpp index 4437290..4696be2 100644 --- a/bsp_linux/main.cpp +++ b/bsp_linux/main.cpp @@ -39,7 +39,8 @@ int main() { sif::printInfo("Producing system objects..\n"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ - objectManager = new ObjectManager(ObjectFactory::produce); + ObjectManager* objManager = ObjectManager::instance(); + objManager->setObjectFactoryFunction(ObjectFactory::produce, nullptr); #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "Objects created successfully.." << std::endl; @@ -48,7 +49,7 @@ int main() { sif::printInfo("Objects created successfully..\n"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ - objectManager->initialize(); + objManager->initialize(); #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "Creating tasks.." << std::endl; diff --git a/fsfw b/fsfw index 50fac22..145dd33 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 50fac22f54031e409306931e15d2e63426aa03b2 +Subproject commit 145dd33fb1e467ef7370ccd44671a91d96c60e26