eive-obsw/mission/tmtc/TmStoreTaskBase.h

37 lines
1.0 KiB
C
Raw Normal View History

2023-03-09 19:42:20 +01:00
#ifndef MISSION_TMTC_TMSTORETASKBASE_H_
#define MISSION_TMTC_TMSTORETASKBASE_H_
#include <fsfw/timemanager/Countdown.h>
2023-03-09 19:42:20 +01:00
#include <mission/tmtc/PersistentTmStoreWithTmQueue.h>
#include <mission/tmtc/VirtualChannel.h>
class TmStoreTaskBase : public SystemObject {
public:
TmStoreTaskBase(object_id_t objectId, StorageManagerIF& ipcStore, VirtualChannel& channel,
SdCardMountedIF& sdcMan);
protected:
2023-03-09 19:42:20 +01:00
/**
* Handling for one store. Returns if anything was done.
* @param store
* @return
*/
bool handleOneStore(PersistentTmStoreWithTmQueue& store);
/**
* 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;
2023-03-09 19:42:20 +01:00
StorageManagerIF& ipcStore;
Countdown sdCardCheckCd = Countdown(800);
2023-03-09 19:42:20 +01:00
VirtualChannel& channel;
bool storesInitialized = false;
SdCardMountedIF& sdcMan;
2023-03-09 19:42:20 +01:00
};
#endif /* MISSION_TMTC_TMSTORETASKBASE_H_ */