continue rework
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -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(¤tUptime);
|
||||
// if (currentUptime.tv_sec - lastTvUpdate.tv_sec >
|
||||
// static_cast<signed int>(TV_UPDATE_INTERVAL_SECS)) {
|
||||
// Clock::getClock_timeval(¤tTv);
|
||||
// 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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user