continue rework
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
2023-03-09 11:46:13 +01:00
parent 21899d663e
commit e5636f0b6c
16 changed files with 176 additions and 148 deletions

View File

@ -86,18 +86,21 @@ ReturnValue_t PusTmFunnel::handleTmPacket(TmTcMessage &message) {
sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT;
packet.updateErrorControl();
// TODO: 1. Send packet to persistent TM store when applicable.
// 2. Send packet to live TM VC
// 3. Send packet to TCP/IP destination
return sendPacketToDestinations(origStoreId, message, packetData, size);
// timeval currentUptime{};
// Clock::getUptime(&currentUptime);
// if (currentUptime.tv_sec - lastTvUpdate.tv_sec >
// static_cast<signed int>(TV_UPDATE_INTERVAL_SECS)) {
// Clock::getClock_timeval(&currentTv);
// lastTvUpdate = currentUptime;
// }
// Send to persistent TM store if the packet matches some filter.
MessageQueueId_t destination;
if (persistentTmMap.packetMatches(packet, destination)) {
store_address_t storageId;
TmTcMessage msg(storageId);
result = tmStore.addData(&storageId, packetData, size);
if (result != returnvalue::OK) {
sif::error << "PusLiveDemux::handlePacket: Store too full to create data copy" << std::endl;
} else {
tmQueue->sendMessage(destination, &msg);
}
}
return demultiplexLivePackets(origStoreId, packetData, size);
// TODO: Will be moved to own thread.
// bool sdcUsable = sdcMan.isSdCardUsable(std::nullopt);
// initStoresIfPossible(sdcUsable);
// if (sdcUsable) {
@ -111,6 +114,7 @@ ReturnValue_t PusTmFunnel::handleTmPacket(TmTcMessage &message) {
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();
@ -126,5 +130,5 @@ ReturnValue_t PusTmFunnel::initialize() {
}
void PusTmFunnel::addPersistentTmStoreRouting(PusPacketFilter filter, MessageQueueId_t dest) {
router.addRouting(filter, dest);
persistentTmMap.addRouting(filter, dest);
}