absolutely magnificent
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2022-12-19 14:40:27 +01:00
parent b9753dc5ba
commit d9453c3b83
5 changed files with 52 additions and 36 deletions

View File

@ -98,7 +98,7 @@ ReturnValue_t PusTmFunnel::performOperation(uint8_t) {
SerializeAdapter::deSerialize(&dumpUntilUnixSeconds, accessor.second.data(), &size,
SerializeIF::Endianness::NETWORK);
// TODO: TM store missing, and maybe there is a better way to do this?
tmStore->dumpFromUpTo(dumpFromUnixSeconds, dumpUntilUnixSeconds, destinations, tmQueue);
tmStore->dumpFromUpTo(dumpFromUnixSeconds, dumpUntilUnixSeconds, *this);
}
}
}
@ -149,36 +149,7 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) {
miscStore.passPacket(packet);
okStore.passPacket(packet);
}
for (unsigned int idx = 0; idx < destinations.size(); idx++) {
const auto &destVcidPair = destinations[idx];
if (destinations.size() > 1) {
if (idx < destinations.size() - 1) {
// Create copy of data to ensure each TM recipient has its own copy. That way, we don't need
// to bother with send order and where the data is deleted.
store_address_t storeId;
result = tmStore.addData(&storeId, packetData, size);
if (result == returnvalue::OK) {
message.setStorageId(storeId);
} else {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "PusTmFunnel::handlePacket: Store too full to create data copy"
<< std::endl;
#endif
}
} else {
message.setStorageId(origStoreId);
}
}
result = tmQueue->sendMessage(destVcidPair.first, &message);
if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "PusTmFunnel::handlePacket: Error sending TM to downlink handler" << std::endl;
#endif
tmStore.deleteData(message.getStorageId());
}
}
return result;
return sendPacketToDestinations(origStoreId, message, packetData, size);
}
const char *PusTmFunnel::getName() const { return "PUS TM Funnel"; }