switch to default UDP TC server, bugfix

This commit is contained in:
Robin Müller 2022-09-13 15:29:24 +02:00
parent 9a8cca1821
commit f89ca50bcb
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
11 changed files with 31 additions and 21 deletions

View File

@ -2,6 +2,7 @@
#include "fsfw/cfdp/pdu/AckPduReader.h"
#include "fsfw/cfdp/pdu/PduHeaderReader.h"
#include "fsfw/globalfunctions/arrayprinter.h"
#include "fsfw/ipc/QueueFactory.h"
#include "fsfw/tmtcservices/TmTcMessage.h"
@ -78,6 +79,9 @@ void CfdpHandler::eofRecvIndication(const cfdp::TransactionId& id) {}
ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) {
auto accessorPair = tcStore->getData(msg.getStorageId());
if(accessorPair.first != OK) {
return accessorPair.first;
}
PduHeaderReader reader(accessorPair.second.data(), accessorPair.second.size());
ReturnValue_t result = reader.parseData();
if (result != returnvalue::OK) {

View File

@ -3,13 +3,16 @@
#include "CfdpHandler.h"
#include "OBSWConfig.h"
#include "bsp_hosted/fsfwconfig/objects/systemObjectList.h"
#include "common/definitions.h"
#include "commonConfig.h"
#include "example/core/GenericFactory.h"
#include "example/test/FsfwTestTask.h"
#include "example/utility/TmFunnel.h"
#include "fsfw/storagemanager/PoolManager.h"
#include "fsfw/tcdistribution/CcsdsDistributorIF.h"
#include "fsfw/tmtcservices/CommandingServiceBase.h"
#include "fsfw_hal/host/HostFilesystem.h"
#include "fsfw/tcdistribution/CcsdsDistributor.h"
#if OBSW_USE_TCP_SERVER == 0
#include <fsfw/osal/common/UdpTcPollingTask.h>
@ -42,7 +45,8 @@ void ObjectFactory::produce(void* args) {
new PoolManager(objects::IPC_STORE, poolCfg);
}
TmFunnel* funnel;
ObjectFactory::produceGenericObjects(&funnel, *tcStore);
CcsdsDistributor* ccsdsDistrib;
ObjectFactory::produceGenericObjects(&funnel, &ccsdsDistrib, *tcStore);
// TMTC Reception via TCP/IP socket
#if OBSW_USE_TCP_SERVER == 0
auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR);
@ -68,13 +72,16 @@ void ObjectFactory::produce(void* args) {
auto* hostFs = new HostFilesystem();
FsfwHandlerParams params(objects::CFDP_HANDLER, *hostFs, *funnel, *tcStore, *tmStore);
cfdp::IndicationCfg indicationCfg;
UnsignedByteField<uint16_t> apid(COMMON_APID);
UnsignedByteField<uint16_t> apid(common::COMMON_CFDP_APID);
cfdp::EntityId localId(apid);
cfdp::RemoteEntityCfg remoteCfg;
cfdp::OneRemoteConfigProvider remoteCfgProvider(remoteCfg);
cfdp::PacketInfoList<64> packetList;
cfdp::LostSegmentsList<128> lostSegments;
CfdpHandlerCfg cfg(localId, indicationCfg, packetList, lostSegments, remoteCfgProvider);
new CfdpHandler(params, cfg);
auto* cfdpHandler = new CfdpHandler(params, cfg);
CcsdsDistributorIF::DestInfo info("CFDP Destination", common::COMMON_CFDP_APID,
cfdpHandler->getRequestQueue(), true);
ccsdsDistrib->registerApplication(info);
#endif
}

View File

@ -10,7 +10,7 @@
#define OBSW_TASK_PERIODIC_EVENT 0
// Use a TCP server instead of a UDP server for TMTC reception
#define OBSW_USE_TCP_SERVER 1
#define OBSW_USE_TCP_SERVER 0
#ifdef __cplusplus

View File

@ -0,0 +1,10 @@
#ifndef FSFW_EXAMPLE_HOSTED_DEFINITIONS_H
#define FSFW_EXAMPLE_HOSTED_DEFINITIONS_H
#include <cstdint>
namespace cfg {
static constexpr uint32_t OBSW_MAX_SCHEDULED_TCS = 200;
}
#endif // FSFW_EXAMPLE_HOSTED_DEFINITIONS_H

View File

@ -1,12 +0,0 @@
#ifndef FSFWCONFIG_TMTC_APID_H_
#define FSFWCONFIG_TMTC_APID_H_
#include <commonConfig.h>
#include <cstdint>
namespace apid {
static const uint16_t APID = COMMON_APID;
};
#endif /* FSFWCONFIG_TMTC_APID_H_ */

2
fsfw

@ -1 +1 @@
Subproject commit 26b3e5a013726d86dfa5c64ec784499c763f143e
Subproject commit 382543fc5989c6608e0aa7550ace6aa70f7d78e3

View File

@ -13,7 +13,7 @@
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="cfdp /tmp/hello.txt /tmp/hello-cpy.txt" />
<option name="PARAMETERS" value="cfdp cfdp_test.txt /tmp/hello-cpy.txt" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

1
tmtc/cfdp_test.txt Normal file
View File

@ -0,0 +1 @@
hello world

@ -1 +1 @@
Subproject commit a3d1808457641eaab2f264ed70ec52b0df14c2dd
Subproject commit 6ee3fa67dc1d34288192b512d4e7cc0927c51b7d

@ -1 +1 @@
Subproject commit ae8cf31044ccf24c4a3a8ad396163df84e7c7308
Subproject commit 4d8de6cf12bb5e9490c181f25c2f0dbaa2bf9e10

View File

@ -1,5 +1,5 @@
{
"com_if": "tcp",
"com_if": "udp",
"tcpip_tcp_ip_addr": "127.0.0.1",
"tcpip_tcp_port": 7301,
"tcpip_tcp_recv_max_size": 1500,