diff --git a/bsp_hosted/OBSWConfig.h.in b/bsp_hosted/OBSWConfig.h.in index f234e795..e58e534d 100644 --- a/bsp_hosted/OBSWConfig.h.in +++ b/bsp_hosted/OBSWConfig.h.in @@ -102,11 +102,8 @@ /** CMake Defines */ /*******************************************************************/ -// Use TCP instead of UDP for the TMTC bridge. This allows using the TMTC client locally -// because UDP packets are not allowed in the VPN -// This will cause the OBSW to initialize the TMTC bridge responsible for exchanging data with the -// CCSDS IP Cores. -#define OBSW_USE_TMTC_TCP_BRIDGE 0 +#define OBSW_ADD_TMTC_UDP_SERVER 1 +#define OBSW_ADD_TMTC_TCP_SERVER 1 #cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 6db37e93..779bb006 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -15,10 +15,11 @@ #include "fsfw_tests/integration/task/TestTask.h" #include "tmtc/pusIds.h" -#if OBSW_USE_TMTC_TCP_BRIDGE == 0 +#if OBSW_ADD_TMTC_UDP_SERVER == 1 #include "fsfw/osal/common/UdpTcPollingTask.h" #include "fsfw/osal/common/UdpTmTcBridge.h" -#else +#endif +#if OBSW_ADD_TMTC_TCP_SERVER == 1 #include "fsfw/osal/common/TcpTmTcBridge.h" #include "fsfw/osal/common/TcpTmTcServer.h" #endif diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index 76a8f2e9..548be5e8 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -68,14 +68,24 @@ void scheduling::initTasks() { if (result != returnvalue::OK) { sif::error << "Object add component failed" << std::endl; } - result = tmtcDistributor->addComponent(objects::TMTC_BRIDGE); + result = tmtcDistributor->addComponent(objects::UDP_TMTC_SERVER); + if (result != returnvalue::OK) { + sif::error << "Add component UDP Unix Bridge failed" << std::endl; + } + result = tmtcDistributor->addComponent(objects::TCP_TMTC_SERVER); if (result != returnvalue::OK) { sif::error << "Add component UDP Unix Bridge failed" << std::endl; } - PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask( - "UDP_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); - result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK); + PeriodicTaskIF* udpPollingTask = factory->createPeriodicTask( + "UDP_POLLING", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); + result = udpPollingTask->addComponent(objects::UDP_TMTC_POLLING_TASK); + if (result != returnvalue::OK) { + sif::error << "Add component UDP Polling failed" << std::endl; + } + PeriodicTaskIF* tcpPollingTask = factory->createPeriodicTask( + "TCP_POLLING", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); + result = tcpPollingTask->addComponent(objects::TCP_TMTC_POLLING_TASK); if (result != returnvalue::OK) { sif::error << "Add component UDP Polling failed" << std::endl; } @@ -185,7 +195,8 @@ void scheduling::initTasks() { sif::info << "Starting tasks.." << std::endl; tmtcDistributor->startTask(); - tmtcPollingTask->startTask(); + udpPollingTask->startTask(); + tcpPollingTask->startTask(); pusVerification->startTask(); eventHandling->startTask();