allow minutely rollover as well
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit Details

This commit is contained in:
Robin Müller 2022-12-13 15:34:13 +01:00
parent 8c10cbe37b
commit 283b897ae7
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 5 additions and 3 deletions

View File

@ -86,7 +86,9 @@ ReturnValue_t TmStore::storePacket(PusTmReader& reader) {
MessageQueueId_t TmStore::getCommandQueue() { return MessageQueueIF::NO_QUEUE; }
void TmStore::calcDiffSeconds(RolloverInterval intervalUnit, uint32_t intervalCount) {
if (intervalUnit == RolloverInterval::HOURLY) {
if (intervalUnit == RolloverInterval::MINUTELY) {
rolloverDiffSeconds = 60 * intervalCount;
} else if (intervalUnit == RolloverInterval::HOURLY) {
rolloverDiffSeconds = 60 * 60 * intervalCount;
} else if (intervalUnit == RolloverInterval::DAILY) {
rolloverDiffSeconds = 60 * 60 * 24 * intervalCount;

View File

@ -15,7 +15,7 @@ struct PacketFilter {
std::optional<std::vector<std::pair<uint8_t, uint8_t>>> serviceSubservices;
};
enum class RolloverInterval { HOURLY, DAILY };
enum class RolloverInterval { MINUTELY, HOURLY, DAILY };
class TmStore : public SystemObject {
public:
@ -41,7 +41,7 @@ class TmStore : public SystemObject {
std::string baseName;
std::filesystem::path baseDir;
uint32_t rolloverDiffSeconds = 0;
std::array<uint8_t, 8192> fileBuf{};
std::array<uint8_t, MAX_FILESIZE> fileBuf{};
timeval& currentTv;
std::optional<timeval> mostRecentTv;
std::optional<std::filesystem::path> mostRecentFile;