start integrating cfdp code
EIVE/eive-obsw/pipeline/pr-develop This commit looks good Details

This commit is contained in:
Robin Müller 2022-09-16 12:14:27 +02:00
parent 547fcf22dd
commit 6b48fb64d8
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
6 changed files with 38 additions and 11 deletions

View File

@ -37,6 +37,7 @@
#define OBSW_ADD_RAD_SENSORS @OBSW_ADD_RAD_SENSORS@
#define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@
#define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@
#define OBSW_ADD_CFDP_COMPONENTS 1
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
#define OBSW_MPSOC_JTAG_BOOT 0

View File

@ -19,8 +19,8 @@
#include "OBSWConfig.h"
#include "bsp_q7s/fs/SdCardManager.h"
#include "bsp_q7s/memory/scratchApi.h"
#include "bsp_q7s/fs/helpers.h"
#include "bsp_q7s/memory/scratchApi.h"
#include "fsfw/tasks/TaskFactory.h"
#include "fsfw/timemanager/Stopwatch.h"
#include "p60pdu.h"
@ -379,11 +379,11 @@ void Q7STestTask::testFileSystemHandlerDirect(FsOpCodes opCode) {
if (opCode == FsOpCodes::CREATE_EMPTY_FILE_IN_TMP) {
FilesystemParams params("/tmp/hello.txt");
auto res = hostFs.createFile(params);
if(res != OK) {
if (res != OK) {
sif::warning << "Creating empty file in /tmp failed" << std::endl;
}
bool fileExists = std::filesystem::exists("/tmp/hello.txt");
if(not fileExists) {
if (not fileExists) {
sif::warning << "File was not created!" << std::endl;
}
hostFs.removeFile("/tmp/hello.txt");

View File

@ -1,7 +1,7 @@
#include "helpers.h"
std::filesystem::path fshelpers::getPrefixedPath(SdCardManager &man,
std::filesystem::path pathWihtoutPrefix) {
std::filesystem::path pathWihtoutPrefix) {
auto prefix = man.getCurrentMountPrefix();
auto resPath = prefix / pathWihtoutPrefix;
return resPath;

View File

@ -7,8 +7,7 @@
namespace fshelpers {
std::filesystem::path getPrefixedPath(SdCardManager& man,
std::filesystem::path pathWihtoutPrefix);
std::filesystem::path getPrefixedPath(SdCardManager& man, std::filesystem::path pathWihtoutPrefix);
}

View File

@ -121,7 +121,8 @@ enum commonObjects : uint32_t {
ACS_BOARD_ASS = 0x73000001,
SUS_BOARD_ASS = 0x73000002,
TCS_BOARD_ASS = 0x73000003,
RW_ASS = 0x73000004
RW_ASS = 0x73000004,
CFDP_HANDLER = 0x73000005,
};
}

View File

@ -1,5 +1,6 @@
#include "GenericFactory.h"
#include <fsfw/cfdp/handler/CfdpHandler.h>
#include <fsfw/events/EventManager.h>
#include <fsfw/health/HealthTable.h>
#include <fsfw/internalerror/InternalErrorReporter.h>
@ -17,6 +18,7 @@
#include <fsfw/tcdistribution/CcsdsDistributor.h>
#include <fsfw/tcdistribution/PusDistributor.h>
#include <fsfw/timemanager/CdsShortTimeStamper.h>
#include <fsfw_hal/host/HostFilesystem.h>
#include <mission/tmtc/TmFunnel.h>
#include "OBSWConfig.h"
@ -56,17 +58,18 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) {
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
new VerificationReporter();
auto* timeStamper = new CdsShortTimeStamper(objects::TIME_STAMPER);
StorageManagerIF* tcStore;
StorageManagerIF* tmStore;
{
PoolManager::LocalPoolConfig poolCfg = {{300, 16}, {300, 32}, {200, 64},
{200, 128}, {100, 1024}, {10, 2048}};
new PoolManager(objects::TC_STORE, poolCfg);
tcStore = new PoolManager(objects::TC_STORE, poolCfg);
}
{
PoolManager::LocalPoolConfig poolCfg = {{300, 16}, {300, 32}, {100, 64},
{100, 128}, {100, 1024}, {10, 2048}};
new PoolManager(objects::TM_STORE, poolCfg);
tmStore = new PoolManager(objects::TM_STORE, poolCfg);
}
{
@ -83,7 +86,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) {
vc = config::LIVE_TM;
#endif
// Every TM packet goes through this funnel
new TmFunnel(objects::TM_FUNNEL, *timeStamper, 50, vc);
auto* funnel = new TmFunnel(objects::TM_FUNNEL, *timeStamper, 50, vc);
// PUS service stack
new Service1TelecommandVerification(objects::PUS_SERVICE_1_VERIFICATION, apid::EIVE_OBSW,
@ -129,4 +132,27 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) {
#endif /* OBSW_USE_TMTC_TCP_BRIDGE == 0 */
tmtcBridge->setMaxNumberOfPacketsStored(300);
#endif /* OBSW_ADD_TCPIP_BRIDGE == 1 */
#if OBSW_ADD_CFDP_COMPONENTS == 1
auto* hostFs = new HostFilesystem();
FsfwHandlerParams params(objects::CFDP_HANDLER, *hostFs, *funnel, *tcStore, *tmStore);
// cfdp::IndicationCfg indicationCfg;
// UnsignedByteField<uint16_t> apid(common::COMMON_CFDP_APID);
// cfdp::EntityId localId(apid);
// UnsignedByteField<uint16_t> remoteEntityId(common::COMMON_CFDP_CLIENT_ENTITY_ID);
// cfdp::EntityId remoteId(remoteEntityId);
// cfdp::RemoteEntityCfg remoteCfg(remoteId);
// remoteCfg.defaultChecksum = cfdp::ChecksumTypes::CRC_32;
// auto* remoteCfgProvider = new cfdp::OneRemoteConfigProvider(remoteCfg);
// auto* cfdpUserHandler = new CfdpExampleUserHandler(*hostFs);
// auto* cfdpFaultHandler = new CfdpExampleFaultHandler();
// cfdp::PacketInfoList<64> packetList;
// cfdp::LostSegmentsList<128> lostSegments;
// CfdpHandlerCfg cfg(localId, indicationCfg, *cfdpUserHandler, *cfdpFaultHandler, packetList,
// lostSegments, *remoteCfgProvider);
// auto* cfdpHandler = new CfdpHandler(params, cfg);
// CcsdsDistributorIF::DestInfo info("CFDP Destination", common::COMMON_CFDP_APID,
// cfdpHandler->getRequestQueue(), true);
// ccsdsDistrib->registerApplication(info);
#endif
}