added missing store initialization code
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
2023-03-09 20:16:00 +01:00
parent e6aa582fcb
commit d50cbe9e5b
8 changed files with 82 additions and 22 deletions

View File

@ -1,12 +1,16 @@
#ifndef MISSION_TMTC_TMSTORETASKBASE_H_
#define MISSION_TMTC_TMSTORETASKBASE_H_
#include <fsfw/timemanager/Countdown.h>
#include <mission/tmtc/PersistentTmStoreWithTmQueue.h>
#include <mission/tmtc/VirtualChannel.h>
class TmStoreTaskBase : public SystemObject {
public:
TmStoreTaskBase(object_id_t objectId, StorageManagerIF& ipcStore, VirtualChannel& channel);
TmStoreTaskBase(object_id_t objectId, StorageManagerIF& ipcStore, VirtualChannel& channel,
SdCardMountedIF& sdcMan);
protected:
/**
* Handling for one store. Returns if anything was done.
* @param store
@ -14,9 +18,19 @@ class TmStoreTaskBase : public SystemObject {
*/
bool handleOneStore(PersistentTmStoreWithTmQueue& store);
private:
/**
* Occasionally check whether SD card is okay to be used. If not, poll whether it is ready to
* be used again and re-initialize stores. Returns whether store is okay to be used.
*/
bool cyclicStoreCheck();
virtual void initStoresIfPossible() = 0;
StorageManagerIF& ipcStore;
Countdown sdCardCheckCd = Countdown(800);
VirtualChannel& channel;
bool storesInitialized = false;
SdCardMountedIF& sdcMan;
};
#endif /* MISSION_TMTC_TMSTORETASKBASE_H_ */