continue request handling
EIVE/eive-obsw/pipeline/pr-develop This commit looks good Details

This commit is contained in:
Robin Müller 2022-12-19 13:57:05 +01:00
parent 74f116f2fa
commit c4c1f09f2e
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
7 changed files with 40 additions and 13 deletions

View File

@ -80,6 +80,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun
auto* timeStamper = new CdsShortTimeStamper(objects::TIME_STAMPER);
StorageManagerIF* tcStore;
StorageManagerIF* tmStore;
StorageManagerIF* ipcStore;
{
PoolManager::LocalPoolConfig poolCfg = {{250, 16}, {250, 32}, {250, 64},
{150, 128}, {120, 1024}, {120, 2048}};
@ -95,7 +96,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun
{
PoolManager::LocalPoolConfig poolCfg = {{300, 16}, {200, 32}, {150, 64}, {150, 128},
{100, 256}, {50, 512}, {50, 1024}, {10, 2048}};
new PoolManager(objects::IPC_STORE, poolCfg);
ipcStore = new PoolManager(objects::IPC_STORE, poolCfg);
}
#if OBSW_ADD_TCPIP_SERVERS == 1
@ -121,8 +122,10 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun
new CcsdsDistributor(config::EIVE_PUS_APID, objects::CCSDS_PACKET_DISTRIBUTOR);
new PusDistributor(config::EIVE_PUS_APID, objects::PUS_PACKET_DISTRIBUTOR, ccsdsDistrib);
*cfdpFunnel = new CfdpTmFunnel(objects::CFDP_TM_FUNNEL, config::EIVE_CFDP_APID, *tmStore, 50, 15);
*pusFunnel = new PusTmFunnel(objects::PUS_TM_FUNNEL, *timeStamper, *tmStore, sdcMan, 80, 15);
*cfdpFunnel = new CfdpTmFunnel(objects::CFDP_TM_FUNNEL, config::EIVE_CFDP_APID, *tmStore, 50, 15,
*ipcStore);
*pusFunnel =
new PusTmFunnel(objects::PUS_TM_FUNNEL, *timeStamper, *tmStore, sdcMan, 80, 15, *ipcStore);
#if OBSW_ADD_TCPIP_SERVERS == 1
#if OBSW_ADD_TMTC_UDP_SERVER == 1
(*cfdpFunnel)->addDestination(*udpBridge, 0);

View File

@ -5,8 +5,10 @@
#include "fsfw/tmtcservices/TmTcMessage.h"
CfdpTmFunnel::CfdpTmFunnel(object_id_t objectId, uint16_t cfdpInCcsdsApid,
StorageManagerIF& tmStore, uint32_t tmMsgDepth, uint32_t tcMsgDepth)
: TmFunnelBase(objectId, tmStore, tmMsgDepth, tcMsgDepth), cfdpInCcsdsApid(cfdpInCcsdsApid) {}
StorageManagerIF& tmStore, uint32_t tmMsgDepth, uint32_t tcMsgDepth,
StorageManagerIF& ipcStore)
: TmFunnelBase(objectId, tmStore, tmMsgDepth, tcMsgDepth, ipcStore),
cfdpInCcsdsApid(cfdpInCcsdsApid) {}
const char* CfdpTmFunnel::getName() const { return "CFDP TM Funnel"; }

View File

@ -13,7 +13,7 @@
class CfdpTmFunnel : public TmFunnelBase {
public:
CfdpTmFunnel(object_id_t objectId, uint16_t cfdpInCcsdsApid, StorageManagerIF& tmStore,
uint32_t tmMsgDepth, uint32_t tcMsgDepth);
uint32_t tmMsgDepth, uint32_t tcMsgDepth, StorageManagerIF& ipcStore);
[[nodiscard]] const char* getName() const override;
ReturnValue_t performOperation(uint8_t opCode);
ReturnValue_t initialize() override;

View File

@ -9,8 +9,9 @@
#include "fsfw/tmtcpacket/pus/tm/PusTmZcWriter.h"
PusTmFunnel::PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, StorageManagerIF &tmStore,
SdCardMountedIF &sdcMan, uint32_t tmMsgDepth, uint32_t tcMsgDepth)
: TmFunnelBase(objectId, tmStore, tmMsgDepth, tcMsgDepth),
SdCardMountedIF &sdcMan, uint32_t tmMsgDepth, uint32_t tcMsgDepth,
StorageManagerIF &ipcStore)
: TmFunnelBase(objectId, tmStore, tmMsgDepth, tcMsgDepth, ipcStore),
timeReader(timeReader),
miscStore(objects::MISC_TM_STORE, "tm", "misc", RolloverInterval::HOURLY, 2, currentTv,
sdcMan),
@ -51,24 +52,43 @@ ReturnValue_t PusTmFunnel::performOperation(uint8_t) {
CommandMessage cmdMessage;
ReturnValue_t status = tcQueue->receiveMessage(&cmdMessage);
while (status == returnvalue::OK) {
if (cmdMessage.getCommand() == messagetypes::TM_STORE) {
if (cmdMessage.getMessageType() == messagetypes::TM_STORE) {
Command_t cmd = cmdMessage.getCommand();
object_id_t objectId = TmStoreMessage::getObjectId(&cmdMessage);
TmStore *tmStore = nullptr;
switch (objectId) {
case (objects::HK_TM_STORE): {
tmStore = &hkStore;
break;
}
case (objects::OK_TM_STORE): {
tmStore = &okStore;
break;
}
case (objects::NOT_OK_TM_STORE): {
tmStore = &notOkStore;
break;
}
case (objects::MISC_TM_STORE): {
tmStore = &miscStore;
break;
}
default: {
}
}
if (tmStore == nullptr) {
continue;
}
if (cmd == TmStoreMessage::DELETE_STORE_CONTENT_TIME) {
store_address_t storeId = TmStoreMessage::getStoreId(&cmdMessage);
auto accessor = ipcStore.getData(storeId);
uint32_t deleteUpToUnixSeconds = 0;
size_t size = accessor.second.size();
SerializeAdapter::deSerialize(&deleteUpToUnixSeconds, accessor.second.data(), &size,
SerializeIF::Endianness::NETWORK);
tmStore->deleteUpTo(deleteUpToUnixSeconds);
} else if (cmd == TmStoreMessage::DOWNLINK_STORE_CONTENT_TIME) {
}
}
}
TmTcMessage currentMessage;

View File

@ -23,7 +23,8 @@
class PusTmFunnel : public TmFunnelBase {
public:
explicit PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, StorageManagerIF &tmStore,
SdCardMountedIF &sdcMan, uint32_t tmMsgDepth, uint32_t tcMsgDepth);
SdCardMountedIF &sdcMan, uint32_t tmMsgDepth, uint32_t tcMsgDepth,
StorageManagerIF &ipcStore);
[[nodiscard]] const char *getName() const override;
~PusTmFunnel() override;

View File

@ -3,8 +3,8 @@
#include "fsfw/ipc/QueueFactory.h"
TmFunnelBase::TmFunnelBase(object_id_t objectId, StorageManagerIF &tmStore, uint32_t tmMsgDepth,
uint32_t tcMsgDepth)
: SystemObject(objectId), tmStore(tmStore) {
uint32_t tcMsgDepth, StorageManagerIF &ipcStore)
: SystemObject(objectId), tmStore(tmStore), ipcStore(ipcStore) {
tmQueue = QueueFactory::instance()->createMessageQueue(tmMsgDepth);
tcQueue = QueueFactory::instance()->createMessageQueue(tcMsgDepth);
}

View File

@ -13,7 +13,7 @@ class TmFunnelBase : public TmStoreFrontendSimpleIF,
public SystemObject {
public:
TmFunnelBase(object_id_t objectId, StorageManagerIF& tmStore, uint32_t tmMsgDepth,
uint32_t tcMsgDepth);
uint32_t tcMsgDepth, StorageManagerIF& ipcStore);
void addDestination(const AcceptsTelemetryIF& downlinkDestination, uint8_t vcid = 0);
[[nodiscard]] MessageQueueId_t getCommandQueue() const override;
@ -23,6 +23,7 @@ class TmFunnelBase : public TmStoreFrontendSimpleIF,
protected:
StorageManagerIF& tmStore;
StorageManagerIF& ipcStore;
std::vector<std::pair<MessageQueueId_t, uint8_t>> destinations;
MessageQueueIF* tcQueue = nullptr;
MessageQueueIF* tmQueue = nullptr;