switch to default UDP TC server, bugfix
This commit is contained in:
parent
9a8cca1821
commit
f89ca50bcb
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "fsfw/cfdp/pdu/AckPduReader.h"
|
#include "fsfw/cfdp/pdu/AckPduReader.h"
|
||||||
#include "fsfw/cfdp/pdu/PduHeaderReader.h"
|
#include "fsfw/cfdp/pdu/PduHeaderReader.h"
|
||||||
|
#include "fsfw/globalfunctions/arrayprinter.h"
|
||||||
#include "fsfw/ipc/QueueFactory.h"
|
#include "fsfw/ipc/QueueFactory.h"
|
||||||
#include "fsfw/tmtcservices/TmTcMessage.h"
|
#include "fsfw/tmtcservices/TmTcMessage.h"
|
||||||
|
|
||||||
@ -78,6 +79,9 @@ void CfdpHandler::eofRecvIndication(const cfdp::TransactionId& id) {}
|
|||||||
|
|
||||||
ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) {
|
ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) {
|
||||||
auto accessorPair = tcStore->getData(msg.getStorageId());
|
auto accessorPair = tcStore->getData(msg.getStorageId());
|
||||||
|
if(accessorPair.first != OK) {
|
||||||
|
return accessorPair.first;
|
||||||
|
}
|
||||||
PduHeaderReader reader(accessorPair.second.data(), accessorPair.second.size());
|
PduHeaderReader reader(accessorPair.second.data(), accessorPair.second.size());
|
||||||
ReturnValue_t result = reader.parseData();
|
ReturnValue_t result = reader.parseData();
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
|
@ -3,13 +3,16 @@
|
|||||||
#include "CfdpHandler.h"
|
#include "CfdpHandler.h"
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
#include "bsp_hosted/fsfwconfig/objects/systemObjectList.h"
|
#include "bsp_hosted/fsfwconfig/objects/systemObjectList.h"
|
||||||
|
#include "common/definitions.h"
|
||||||
#include "commonConfig.h"
|
#include "commonConfig.h"
|
||||||
#include "example/core/GenericFactory.h"
|
#include "example/core/GenericFactory.h"
|
||||||
#include "example/test/FsfwTestTask.h"
|
#include "example/test/FsfwTestTask.h"
|
||||||
#include "example/utility/TmFunnel.h"
|
#include "example/utility/TmFunnel.h"
|
||||||
#include "fsfw/storagemanager/PoolManager.h"
|
#include "fsfw/storagemanager/PoolManager.h"
|
||||||
|
#include "fsfw/tcdistribution/CcsdsDistributorIF.h"
|
||||||
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
||||||
#include "fsfw_hal/host/HostFilesystem.h"
|
#include "fsfw_hal/host/HostFilesystem.h"
|
||||||
|
#include "fsfw/tcdistribution/CcsdsDistributor.h"
|
||||||
|
|
||||||
#if OBSW_USE_TCP_SERVER == 0
|
#if OBSW_USE_TCP_SERVER == 0
|
||||||
#include <fsfw/osal/common/UdpTcPollingTask.h>
|
#include <fsfw/osal/common/UdpTcPollingTask.h>
|
||||||
@ -42,7 +45,8 @@ void ObjectFactory::produce(void* args) {
|
|||||||
new PoolManager(objects::IPC_STORE, poolCfg);
|
new PoolManager(objects::IPC_STORE, poolCfg);
|
||||||
}
|
}
|
||||||
TmFunnel* funnel;
|
TmFunnel* funnel;
|
||||||
ObjectFactory::produceGenericObjects(&funnel, *tcStore);
|
CcsdsDistributor* ccsdsDistrib;
|
||||||
|
ObjectFactory::produceGenericObjects(&funnel, &ccsdsDistrib, *tcStore);
|
||||||
// TMTC Reception via TCP/IP socket
|
// TMTC Reception via TCP/IP socket
|
||||||
#if OBSW_USE_TCP_SERVER == 0
|
#if OBSW_USE_TCP_SERVER == 0
|
||||||
auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR);
|
auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR);
|
||||||
@ -68,13 +72,16 @@ void ObjectFactory::produce(void* args) {
|
|||||||
auto* hostFs = new HostFilesystem();
|
auto* hostFs = new HostFilesystem();
|
||||||
FsfwHandlerParams params(objects::CFDP_HANDLER, *hostFs, *funnel, *tcStore, *tmStore);
|
FsfwHandlerParams params(objects::CFDP_HANDLER, *hostFs, *funnel, *tcStore, *tmStore);
|
||||||
cfdp::IndicationCfg indicationCfg;
|
cfdp::IndicationCfg indicationCfg;
|
||||||
UnsignedByteField<uint16_t> apid(COMMON_APID);
|
UnsignedByteField<uint16_t> apid(common::COMMON_CFDP_APID);
|
||||||
cfdp::EntityId localId(apid);
|
cfdp::EntityId localId(apid);
|
||||||
cfdp::RemoteEntityCfg remoteCfg;
|
cfdp::RemoteEntityCfg remoteCfg;
|
||||||
cfdp::OneRemoteConfigProvider remoteCfgProvider(remoteCfg);
|
cfdp::OneRemoteConfigProvider remoteCfgProvider(remoteCfg);
|
||||||
cfdp::PacketInfoList<64> packetList;
|
cfdp::PacketInfoList<64> packetList;
|
||||||
cfdp::LostSegmentsList<128> lostSegments;
|
cfdp::LostSegmentsList<128> lostSegments;
|
||||||
CfdpHandlerCfg cfg(localId, indicationCfg, packetList, lostSegments, remoteCfgProvider);
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#define OBSW_TASK_PERIODIC_EVENT 0
|
#define OBSW_TASK_PERIODIC_EVENT 0
|
||||||
// Use a TCP server instead of a UDP server for TMTC reception
|
// 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
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
10
bsp_hosted/fsfwconfig/definitions.h
Normal file
10
bsp_hosted/fsfwconfig/definitions.h
Normal 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
|
@ -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
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 26b3e5a013726d86dfa5c64ec784499c763f143e
|
Subproject commit 382543fc5989c6608e0aa7550ace6aa70f7d78e3
|
2
tmtc/.idea/runConfigurations/CFDP_Test.xml
generated
2
tmtc/.idea/runConfigurations/CFDP_Test.xml
generated
@ -13,7 +13,7 @@
|
|||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.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="SHOW_COMMAND_LINE" value="false" />
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
<option name="EMULATE_TERMINAL" value="false" />
|
||||||
<option name="MODULE_MODE" value="false" />
|
<option name="MODULE_MODE" value="false" />
|
||||||
|
1
tmtc/cfdp_test.txt
Normal file
1
tmtc/cfdp_test.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
hello world
|
@ -1 +1 @@
|
|||||||
Subproject commit a3d1808457641eaab2f264ed70ec52b0df14c2dd
|
Subproject commit 6ee3fa67dc1d34288192b512d4e7cc0927c51b7d
|
@ -1 +1 @@
|
|||||||
Subproject commit ae8cf31044ccf24c4a3a8ad396163df84e7c7308
|
Subproject commit 4d8de6cf12bb5e9490c181f25c2f0dbaa2bf9e10
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"com_if": "tcp",
|
"com_if": "udp",
|
||||||
"tcpip_tcp_ip_addr": "127.0.0.1",
|
"tcpip_tcp_ip_addr": "127.0.0.1",
|
||||||
"tcpip_tcp_port": 7301,
|
"tcpip_tcp_port": 7301,
|
||||||
"tcpip_tcp_recv_max_size": 1500,
|
"tcpip_tcp_recv_max_size": 1500,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user