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:
@ -69,14 +69,14 @@ ReturnValue_t PersistentTmStore::handleCommandQueue(StorageManagerIF& ipcStore,
|
||||
SerializeIF::Endianness::NETWORK);
|
||||
SerializeAdapter::deSerialize(&dumpUntilUnixSeconds, accessor.second.data() + 4, &size,
|
||||
SerializeIF::Endianness::NETWORK);
|
||||
dumpFromUpTo(dumpFromUnixSeconds, dumpUntilUnixSeconds, tmFunnel);
|
||||
dumpFromUpTo(dumpFromUnixSeconds, dumpUntilUnixSeconds);
|
||||
}
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void PersistentTmStore::dumpFrom(uint32_t fromUnixSeconds, TmFunnelBase& tmFunnel) {
|
||||
return dumpFromUpTo(fromUnixSeconds, currentTv.tv_sec, tmFunnel);
|
||||
void PersistentTmStore::dumpFrom(uint32_t fromUnixSeconds) {
|
||||
return dumpFromUpTo(fromUnixSeconds, currentTv.tv_sec);
|
||||
}
|
||||
|
||||
ReturnValue_t PersistentTmStore::storePacket(PusTmReader& reader) {
|
||||
@ -166,8 +166,7 @@ void PersistentTmStore::deleteUpTo(uint32_t unixSeconds) {
|
||||
}
|
||||
}
|
||||
|
||||
void PersistentTmStore::dumpFromUpTo(uint32_t fromUnixSeconds, uint32_t upToUnixSeconds,
|
||||
TmFunnelBase& funnel) {
|
||||
void PersistentTmStore::dumpFromUpTo(uint32_t fromUnixSeconds, uint32_t upToUnixSeconds) {
|
||||
using namespace std::filesystem;
|
||||
for (auto const& file : directory_iterator(basePath)) {
|
||||
if (file.is_directory()) {
|
||||
@ -180,7 +179,7 @@ void PersistentTmStore::dumpFromUpTo(uint32_t fromUnixSeconds, uint32_t upToUnix
|
||||
}
|
||||
auto fileEpoch = static_cast<uint32_t>(timegm(&fileTime));
|
||||
if ((fileEpoch > fromUnixSeconds) and (fileEpoch + rolloverDiffSeconds <= upToUnixSeconds)) {
|
||||
fileToPackets(file, fileEpoch, funnel);
|
||||
fileToPackets(file, fileEpoch);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -195,8 +194,7 @@ ReturnValue_t PersistentTmStore::pathToTm(const std::filesystem::path& path, str
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void PersistentTmStore::fileToPackets(const std::filesystem::path& path, uint32_t unixStamp,
|
||||
TmFunnelBase& funnel) {
|
||||
void PersistentTmStore::fileToPackets(const std::filesystem::path& path, uint32_t unixStamp) {
|
||||
store_address_t storeId;
|
||||
TmTcMessage message;
|
||||
size_t size = std::filesystem::file_size(path);
|
||||
@ -212,12 +210,13 @@ void PersistentTmStore::fileToPackets(const std::filesystem::path& path, uint32_
|
||||
// CRC check to fully ensure this is a valid TM
|
||||
ReturnValue_t result = reader.parseDataWithCrcCheck();
|
||||
if (result == returnvalue::OK) {
|
||||
result = tmStore.addData(&storeId, fileBuf.data() + currentIdx, reader.getFullPacketLen());
|
||||
if (result != returnvalue::OK) {
|
||||
continue;
|
||||
}
|
||||
funnel.sendPacketToDestinations(storeId, message, fileBuf.data() + currentIdx,
|
||||
reader.getFullPacketLen());
|
||||
// TODO: Blow the data out to the VC directly. Use IF function to do this.
|
||||
// result = tmStore.addData(&storeId, fileBuf.data() + currentIdx,
|
||||
// reader.getFullPacketLen()); if (result != returnvalue::OK) {
|
||||
// continue;
|
||||
// }
|
||||
// funnel.sendPacketToLiveDestinations(storeId, message, fileBuf.data() + currentIdx,
|
||||
// reader.getFullPacketLen());
|
||||
currentIdx += reader.getFullPacketLen();
|
||||
} else {
|
||||
sif::error << "Parsing of PUS TM failed with code " << result << std::endl;
|
||||
|
Reference in New Issue
Block a user