From 859aa7750aebec588fa1b52d3ef3202bcce09881 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Sep 2021 16:04:16 +0200 Subject: [PATCH] smaller tweaks and project file updatss --- bsp_hosted/bsp_hosted.mk | 9 -------- bsp_hosted/core/InitMission.cpp | 12 +++++----- bsp_hosted/core/ObjectFactory.cpp | 23 ++++++++++++++----- bsp_hosted/fsfwconfig/OBSWConfig.h.in | 4 +++- bsp_hosted/fsfwconfig/fsfwconfig.mk | 8 ------- .../fsfwconfig/objects/systemObjectList.h | 6 ++--- misc/eclipse/.cproject | 18 ++++++++++++--- tmtc/log/tmtc_error.log | 1 + 8 files changed, 45 insertions(+), 36 deletions(-) delete mode 100644 bsp_hosted/bsp_hosted.mk delete mode 100644 bsp_hosted/fsfwconfig/fsfwconfig.mk diff --git a/bsp_hosted/bsp_hosted.mk b/bsp_hosted/bsp_hosted.mk deleted file mode 100644 index 9bb0bf0..0000000 --- a/bsp_hosted/bsp_hosted.mk +++ /dev/null @@ -1,9 +0,0 @@ -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) \ No newline at end of file diff --git a/bsp_hosted/core/InitMission.cpp b/bsp_hosted/core/InitMission.cpp index c983861..f359404 100644 --- a/bsp_hosted/core/InitMission.cpp +++ b/bsp_hosted/core/InitMission.cpp @@ -62,23 +62,23 @@ void InitMission::createTasks() { #endif /* UDP bridge */ PeriodicTaskIF* udpBridgeTask = taskFactory->createPeriodicTask( - "UDP_UNIX_BRIDGE", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, + "TCPIP_TMTC_BRIDGE", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, deadlineMissedFunc ); - result = udpBridgeTask->addComponent(objects::UDP_BRIDGE); + result = udpBridgeTask->addComponent(objects::TCPIP_TMTC_BRIDGE); if(result != HasReturnvaluesIF::RETURN_OK) { - task::printInitError("UDP bridge", objects::UDP_BRIDGE); + task::printInitError("TMTC bridge", objects::TCPIP_TMTC_BRIDGE); } #ifdef __unix__ currPrio = 80; #endif PeriodicTaskIF* udpPollingTask = taskFactory->createPeriodicTask( - "UDP_POLLING", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc + "TMTC_POLLING", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc ); - result = udpPollingTask->addComponent(objects::UDP_POLLING_TASK); + result = udpPollingTask->addComponent(objects::TCPIP_TMTC_POLLING_TASK); if(result != HasReturnvaluesIF::RETURN_OK) { - task::printInitError("UDP polling", objects::UDP_POLLING_TASK); + task::printInitError("TMTC polling", objects::TCPIP_TMTC_POLLING_TASK); } #ifdef __unix__ diff --git a/bsp_hosted/core/ObjectFactory.cpp b/bsp_hosted/core/ObjectFactory.cpp index 004f0f7..e13ac9c 100644 --- a/bsp_hosted/core/ObjectFactory.cpp +++ b/bsp_hosted/core/ObjectFactory.cpp @@ -16,8 +16,13 @@ #include #include +#if OBSW_USE_TCP_SERVER == 0 #include #include +#else +#include "fsfw/osal/common/TcpTmTcServer.h" +#include "fsfw/osal/common/TcpTmTcBridge.h" +#endif void ObjectFactory::produce(void* args) { Factory::setStaticFrameworkObjectIds(); @@ -44,12 +49,18 @@ void ObjectFactory::produce(void* args) { new PoolManager(objects::IPC_STORE, poolCfg); } - /* TMTC Reception via UDP socket */ - auto tmtcBridge = new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_DISTRIBUTOR); - tmtcBridge->setMaxNumberOfPacketsStored(20); - sif::info << "Opening UDP TMTC server on port " << tmtcBridge->getUdpPort() << - std::endl; - new UdpTcPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE); + // TMTC Reception via TCP/IP socket +#if OBSW_USE_TCP_SERVER == 0 + auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR); + tmtcBridge->setMaxNumberOfPacketsStored(50); + sif::info << "Opening UDP TMTC server on port " << tmtcBridge->getUdpPort() << std::endl; + new UdpTcPollingTask(objects::TCPIP_TMTC_POLLING_TASK, objects::TCPIP_TMTC_BRIDGE); +#else + auto tmtcBridge = new TcpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR); + tmtcBridge->setMaxNumberOfPacketsStored(50); + auto tmtcServer = new TcpTmTcServer(objects::TCPIP_TMTC_POLLING_TASK, objects::TCPIP_TMTC_BRIDGE); + sif::info << "Opening UDP TMTC server on port " << tmtcServer->getTcpPort() << std::endl; +#endif #endif /* OBSW_ADD_CORE_COMPONENTS == 1 */ diff --git a/bsp_hosted/fsfwconfig/OBSWConfig.h.in b/bsp_hosted/fsfwconfig/OBSWConfig.h.in index 52db5b5..c9f2acb 100644 --- a/bsp_hosted/fsfwconfig/OBSWConfig.h.in +++ b/bsp_hosted/fsfwconfig/OBSWConfig.h.in @@ -8,7 +8,9 @@ #include -#define OBSW_TASK_PERIODIC_EVENT 0 +#define OBSW_TASK_PERIODIC_EVENT 0 +// Use a TCP server instead of a UDP server for TMTC reception +#define OBSW_USE_TCP_SERVER 0 #ifdef __cplusplus diff --git a/bsp_hosted/fsfwconfig/fsfwconfig.mk b/bsp_hosted/fsfwconfig/fsfwconfig.mk deleted file mode 100644 index 4577ab6..0000000 --- a/bsp_hosted/fsfwconfig/fsfwconfig.mk +++ /dev/null @@ -1,8 +0,0 @@ -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 \ No newline at end of file diff --git a/bsp_hosted/fsfwconfig/objects/systemObjectList.h b/bsp_hosted/fsfwconfig/objects/systemObjectList.h index bb1cb78..a4e47a3 100644 --- a/bsp_hosted/fsfwconfig/objects/systemObjectList.h +++ b/bsp_hosted/fsfwconfig/objects/systemObjectList.h @@ -6,10 +6,10 @@ namespace objects { enum mission_objects { /* 0x62 ('b') Board and mission specific objects */ - UDP_BRIDGE = 0x62000300, - UDP_POLLING_TASK = 0x62000400, + TCPIP_TMTC_BRIDGE = 0x62000300, + TCPIP_TMTC_POLLING_TASK = 0x62000400, /* Generic name for FSFW static ID setter */ - DOWNLINK_DESTINATION = UDP_BRIDGE + DOWNLINK_DESTINATION = TCPIP_TMTC_BRIDGE }; } diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index 1451558..14b24bf 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -25,6 +25,7 @@ + @@ -33,6 +34,7 @@ + @@ -48,6 +50,7 @@ + @@ -87,6 +90,7 @@ + @@ -96,6 +100,7 @@ + @@ -107,10 +112,11 @@ - @@ -144,10 +150,11 @@ - @@ -157,6 +164,7 @@ + @@ -165,6 +173,7 @@ + @@ -205,10 +214,11 @@ - @@ -218,6 +228,7 @@ + @@ -226,6 +237,7 @@ + diff --git a/tmtc/log/tmtc_error.log b/tmtc/log/tmtc_error.log index e69de29..1a0090e 100644 --- a/tmtc/log/tmtc_error.log +++ b/tmtc/log/tmtc_error.log @@ -0,0 +1 @@ +WARNING : 2021-09-28 16:03:41.772 | [com_if.py:93] | TCP communication interface without any specified space packet ID might not woWARNWARNING : 2021-09-28 16:03:42.176 | [tm_listener.py:346] | No TM handler assigned forWARNING WARNING : 2021-09-28 16:03:42.177 | [tm_listener.py:330] | No target queue found, inserting into unknown tWARNING : 20WARNING : 2021-09-28 16:03:42.177 | [tm_listener.py:346] | No TM handler assiWARNING : 2021-0WARNING : 2021-09-28 16:03:42.178 | [tm_listener.py:330] | No target queue found, inserting into uWARNING : 2021-09-28WARNING : 2021-09-28 16:03:42.178 | [tm_listener.py:346] | No TM handWARNING : 2021-09-28 16:WARNING : 2021-09-28 16:03:42.178 | [tm_listener.py:330] | No target queue found, insertinWARNING : 2021-09-28 16:03:4WARNING : 2021-09-28 16:03:42.178 | [tm_listener.py:346] | NoWARNING : 2021-09-28 16:03:42.17WARNING : 2021-09-28 16:03:42.178 | [tm_listener.py:330] | No target queue found, inserting into unknown target queue