moved config flag to cmmon config

This commit is contained in:
Robin Müller 2021-07-26 13:51:00 +02:00
parent 590d5e11e1
commit 261fc8b58f
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
6 changed files with 31 additions and 18 deletions

View File

@ -70,15 +70,15 @@ void initmission::initTasks() {
} }
/* UDP bridge */ /* UDP bridge */
PeriodicTaskIF* udpBridgeTask = factory->createPeriodicTask( PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask(
"UDP_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); "TMTC_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
result = udpBridgeTask->addComponent(objects::TMTC_BRIDGE); result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component UDP Unix Bridge failed" << std::endl; sif::error << "Add component UDP Unix Bridge failed" << std::endl;
} }
PeriodicTaskIF* udpPollingTask = factory->createPeriodicTask( PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask(
"UDP_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); "UDP_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
result = udpPollingTask->addComponent(objects::TMTC_POLLING_TASK); result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component UDP Polling failed" << std::endl; sif::error << "Add component UDP Polling failed" << std::endl;
} }
@ -142,8 +142,8 @@ void initmission::initTasks() {
sif::info << "Starting tasks.." << std::endl; sif::info << "Starting tasks.." << std::endl;
tmTcDistributor->startTask(); tmTcDistributor->startTask();
udpBridgeTask->startTask(); tmtcBridgeTask->startTask();
udpPollingTask->startTask(); tmtcPollingTask->startTask();
pusVerification->startTask(); pusVerification->startTask();
pusEvents->startTask(); pusEvents->startTask();

View File

@ -1,6 +1,5 @@
#include "ObjectFactory.h" #include "ObjectFactory.h"
#include "OBSWConfig.h"
#include <OBSWConfig.h>
#include <objects/systemObjectList.h> #include <objects/systemObjectList.h>
#include <tmtc/apid.h> #include <tmtc/apid.h>
#include <tmtc/pusIds.h> #include <tmtc/pusIds.h>
@ -11,8 +10,13 @@
#include <mission/core/GenericFactory.h> #include <mission/core/GenericFactory.h>
#include <mission/utility/TmFunnel.h> #include <mission/utility/TmFunnel.h>
#include <fsfw/osal/common/UdpTcPollingTask.h> #if OBSW_USE_TMTC_TCP_BRIDGE == 0
#include <fsfw/osal/common/UdpTmTcBridge.h> #include "fsfw/osal/common/UdpTcPollingTask.h"
#include "fsfw/osal/common/UdpTmTcBridge.h"
#else
#include "fsfw/osal/common/TcpTmTcBridge.h"
#include "fsfw/osal/common/TcpTmTcServer.h"
#endif
#include <fsfw/tmtcpacket/pus/tm.h> #include <fsfw/tmtcpacket/pus/tm.h>
@ -40,7 +44,16 @@ void ObjectFactory::produce(void* args){
Factory::setStaticFrameworkObjectIds(); Factory::setStaticFrameworkObjectIds();
ObjectFactory::produceGenericObjects(); ObjectFactory::produceGenericObjects();
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
sif::info << "Setting up UDP TMTC bridge with listener port " <<
UdpTmTcBridge::DEFAULT_SERVER_PORT << std::endl;
new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR);
new UdpTcPollingTask(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); new UdpTcPollingTask(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE);
#else
sif::info << "Setting up TCP TMTC bridge with listener port " <<
TcpTmTcBridge::DEFAULT_SERVER_PORT << std::endl;
new TcpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR);
new TcpTmTcServer(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE);
#endif
} }

View File

@ -360,10 +360,10 @@ void CoreController::initPrint() {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
#if OBSW_USE_TMTC_TCP_BRIDGE == 0 #if OBSW_USE_TMTC_TCP_BRIDGE == 0
sif::info << "Created UDP server for TMTC commanding with listener port " << sif::info << "Created UDP server for TMTC commanding with listener port " <<
UdpTmTcBridge::DEFAULT_UDP_SERVER_PORT << std::endl; UdpTmTcBridge::DEFAULT_SERVER_PORT << std::endl;
#else #else
sif::info << "Created TCP server for TMTC commanding with listener port " << sif::info << "Created TCP server for TMTC commanding with listener port " <<
TcpTmTcBridge::DEFAULT_TCP_SERVER_PORT << std::endl; TcpTmTcBridge::DEFAULT_SERVER_PORT << std::endl;
#endif #endif
#endif #endif
} }

View File

@ -3,4 +3,8 @@
#define OBSW_ADD_LWGPS_TEST 0 #define OBSW_ADD_LWGPS_TEST 0
// 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
#define OBSW_USE_TMTC_TCP_BRIDGE 0
#endif /* COMMON_CONFIG_COMMONCONFIG_H_ */ #endif /* COMMON_CONFIG_COMMONCONFIG_H_ */

2
fsfw

@ -1 +1 @@
Subproject commit 1f6a5e635fcd6bd812e262cc65a15a8a054f7ecf Subproject commit 54c028f913e81077855aa1ed727bac43e7efea82

View File

@ -18,10 +18,6 @@
debugging. */ debugging. */
#define OBSW_VERBOSE_LEVEL 1 #define OBSW_VERBOSE_LEVEL 1
// 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
#define OBSW_USE_TMTC_TCP_BRIDGE 0
#define OBSW_PRINT_MISSED_DEADLINES 1 #define OBSW_PRINT_MISSED_DEADLINES 1
#define OBSW_ADD_TEST_CODE 1 #define OBSW_ADD_TEST_CODE 1
#define OBSW_ADD_TEST_PST 1 #define OBSW_ADD_TEST_PST 1