From 7d7efaca426bd0909d891ad82a3d9840873c07df Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 15 Nov 2022 16:44:07 +0100 Subject: [PATCH] improve hosted SW --- bsp_hosted/OBSWConfig.h.in | 8 ++++++++ bsp_hosted/ObjectFactory.cpp | 6 ++---- bsp_q7s/OBSWConfig.h.in | 7 +++++++ common/config/commonConfig.h.in | 6 ------ dummies/TemperatureSensorsDummy.cpp | 4 ++++ mission/core/GenericFactory.cpp | 12 ++++++------ 6 files changed, 27 insertions(+), 16 deletions(-) diff --git a/bsp_hosted/OBSWConfig.h.in b/bsp_hosted/OBSWConfig.h.in index 9c7a3f03..f234e795 100644 --- a/bsp_hosted/OBSWConfig.h.in +++ b/bsp_hosted/OBSWConfig.h.in @@ -24,6 +24,7 @@ #define OBSW_ADD_GPS_0 0 #define OBSW_ADD_GPS_1 0 #define OBSW_ADD_RW 0 +#define OBSW_DEBUG_TMP1075 0 #define OBSW_ADD_BPX_BATTERY_HANDLER 0 #define OBSW_ADD_RTD_DEVICES 0 #define OBSW_ADD_PL_PCDU 0 @@ -100,6 +101,13 @@ /*******************************************************************/ /** 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 + #cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER #cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@ diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 7289c361..01d6da22 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -64,10 +64,10 @@ void Factory::setStaticFrameworkObjectIds() { PusServiceBase::PUS_DISTRIBUTOR = objects::PUS_PACKET_DISTRIBUTOR; - PusServiceBase::PACKET_DESTINATION = objects::TM_FUNNEL; + PusServiceBase::PACKET_DESTINATION = objects::PUS_TM_FUNNEL; CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; - CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; + CommandingServiceBase::defaultPacketDestination = objects::PUS_TM_FUNNEL; VerificationReporter::DEFAULT_RECEIVER = objects::PUS_SERVICE_1_VERIFICATION; } @@ -107,8 +107,6 @@ void ObjectFactory::produce(void* args) { dummy::DummyCfg cfg; dummy::createDummies(cfg); - new TemperatureSensorsDummy(); - new SusDummy(); new ThermalController(objects::THERMAL_CONTROLLER); new TestTask(objects::TEST_TASK); } diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index 499d8e6b..5cde824d 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -119,6 +119,13 @@ /*******************************************************************/ /** 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 1 + #cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER #cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@ diff --git a/common/config/commonConfig.h.in b/common/config/commonConfig.h.in index 83e1aaac..4fcc308f 100644 --- a/common/config/commonConfig.h.in +++ b/common/config/commonConfig.h.in @@ -19,12 +19,6 @@ debugging. */ // Disable this for mission code. It allows exchanging TMTC packets via the Ethernet port #define OBSW_ADD_TCPIP_BRIDGE 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 -// 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 1 - #define OBSW_ADD_CFDP_COMPONENTS 1 namespace common { diff --git a/dummies/TemperatureSensorsDummy.cpp b/dummies/TemperatureSensorsDummy.cpp index 52190ee8..e7c75833 100644 --- a/dummies/TemperatureSensorsDummy.cpp +++ b/dummies/TemperatureSensorsDummy.cpp @@ -25,6 +25,10 @@ TemperatureSensorsDummy::TemperatureSensorsDummy() ObjectManager::instance()->insert(objects::RTD_15_IC18_IMTQ, this); ObjectManager::instance()->insert(objects::TMP1075_HANDLER_TCS_0, this); ObjectManager::instance()->insert(objects::TMP1075_HANDLER_TCS_1, this); + + ObjectManager::instance()->insert(objects::TMP1075_HANDLER_PLPCDU_0, this); + ObjectManager::instance()->insert(objects::TMP1075_HANDLER_PLPCDU_1, this); + ObjectManager::instance()->insert(objects::TMP1075_HANDLER_IF_BOARD, this); } ReturnValue_t TemperatureSensorsDummy::initialize() { diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 0e1926f4..114451b2 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -99,12 +99,12 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun #if OBSW_ADD_TCPIP_BRIDGE == 1 #if OBSW_USE_TMTC_TCP_BRIDGE == 0 - auto tcpIpTmtcBridge = new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); + auto tmtcBridge = new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); new UdpTcPollingTask(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); sif::info << "Created UDP server for TMTC commanding with listener port " - << udpBridge->getUdpPort() << std::endl; + << tmtcBridge->getUdpPort() << std::endl; #else - auto tcpIpTmtcBridge = new TcpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); + auto tmtcBridge = new TcpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); auto tcpServer = new TcpTmTcServer(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); // TCP is stream based. Use packet ID as start marker when parsing for space packets tcpServer->setSpacePacketParsingOptions({common::PUS_PACKET_ID, common::CFDP_PACKET_ID}); @@ -114,7 +114,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun tcpServer->enableWiretapping(true); #endif /* OBSW_TCP_SERVER_WIRETAPPING == 1 */ #endif /* OBSW_USE_TMTC_TCP_BRIDGE == 0 */ - tcpIpTmtcBridge->setMaxNumberOfPacketsStored(150); + tmtcBridge->setMaxNumberOfPacketsStored(150); #endif /* OBSW_ADD_TCPIP_BRIDGE == 1 */ auto* ccsdsDistrib = @@ -124,8 +124,8 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun *cfdpFunnel = new CfdpTmFunnel(objects::CFDP_TM_FUNNEL, config::EIVE_CFDP_APID, *tmStore, 50); *pusFunnel = new PusTmFunnel(objects::PUS_TM_FUNNEL, *timeStamper, *tmStore, 80); #if OBSW_ADD_TCPIP_BRIDGE == 1 - (*cfdpFunnel)->addDestination(*tcpIpTmtcBridge, 0); - (*pusFunnel)->addDestination(*tcpIpTmtcBridge, 0); + (*cfdpFunnel)->addDestination(*tmtcBridge, 0); + (*pusFunnel)->addDestination(*tmtcBridge, 0); #endif // Every TM packet goes through this funnel new TmFunnelHandler(objects::TM_FUNNEL, **pusFunnel, **cfdpFunnel);