Refactor TM handling #450

Merged
muellerr merged 47 commits from refactor_tm_handling into develop 2023-03-11 15:05:22 +01:00
2 changed files with 2 additions and 52 deletions
Showing only changes of commit fd943a99b6 - Show all commits

View File

@ -19,30 +19,6 @@ PusTmFunnel::~PusTmFunnel() = default;
ReturnValue_t PusTmFunnel::performOperation(uint8_t) {
CommandMessage cmdMessage;
ReturnValue_t result;
/*
try {
result = okStore.handleCommandQueue(ipcStore, *this);
if (result != returnvalue::OK) {
sif::error << "PusTmFunnel::performOperation: Issue handling OK store command" << std::endl;
}
result = notOkStore.handleCommandQueue(ipcStore, *this);
if (result != returnvalue::OK) {
sif::error << "PusTmFunnel::performOperation: Issue handling NOT OK store command"
<< std::endl;
}
result = hkStore.handleCommandQueue(ipcStore, *this);
if (result != returnvalue::OK) {
sif::error << "PusTmFunnel::performOperation: Issue handling HK store command" << std::endl;
}
result = miscStore.handleCommandQueue(ipcStore, *this);
if (result != returnvalue::OK) {
sif::error << "PusTmFunnel::performOperation: Issue handling MISC store command" << std::endl;
}
} catch (const std::bad_optional_access &e) {
sif::error << e.what() << "when handling TM store command" << std::endl;
}
*/
TmTcMessage currentMessage;
unsigned int count = 0;
result = tmQueue->receiveMessage(&currentMessage);
@ -53,7 +29,7 @@ ReturnValue_t PusTmFunnel::performOperation(uint8_t) {
break;
}
count++;
if (count == 500) {
if (count == 1000) {
sif::error << "PusTmFunnel: Possible message storm detected" << std::endl;
break;
}
@ -99,36 +75,12 @@ ReturnValue_t PusTmFunnel::handleTmPacket(TmTcMessage &message) {
}
}
// Send to registered live targets.
return demultiplexLivePackets(origStoreId, packetData, size);
// TODO: Will be moved to own thread.
// bool sdcUsable = sdcMan.isSdCardUsable(std::nullopt);
// initStoresIfPossible(sdcUsable);
// if (sdcUsable) {
// miscStore.passPacket(packet);
// okStore.passPacket(packet);
// notOkStore.passPacket(packet);
// hkStore.passPacket(packet);
// }
}
const char *PusTmFunnel::getName() const { return "PUS TM Funnel"; }
void PusTmFunnel::initStoresIfPossible(bool sdCardUsable) {
// TODO: Those will be moved to own thread.
if (not storesInitialized and sdCardUsable and sdcMan.getCurrentMountPrefix() != nullptr) {
// miscStore.initializeTmStore();
// okStore.initializeTmStore();
// hkStore.initializeTmStore();
// notOkStore.initializeTmStore();
storesInitialized = true;
}
}
ReturnValue_t PusTmFunnel::initialize() {
// initStoresIfPossible(sdcMan.isSdCardUsable(std::nullopt));
return returnvalue::OK;
}
void PusTmFunnel::addPersistentTmStoreRouting(PusPacketFilter filter, MessageQueueId_t dest) {
persistentTmMap.addRouting(filter, dest);
}

View File

@ -42,8 +42,6 @@ class PusTmFunnel : public TmFunnelBase {
PusTmRouteByFilterHelper persistentTmMap;
ReturnValue_t handleTmPacket(TmTcMessage &message);
void initStoresIfPossible(bool sdCardUsable);
ReturnValue_t initialize() override;
};
#endif // FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H