eive-obsw/mission/tmtc/PersistentLogTmStoreTask.h

37 lines
1.3 KiB
C
Raw Normal View History

2023-03-09 17:44:05 +01:00
#ifndef MISSION_TMTC_PERSISTENTLOGTMSTORETASK_H_
#define MISSION_TMTC_PERSISTENTLOGTMSTORETASK_H_
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/storagemanager/StorageManagerIF.h>
#include <fsfw/tasks/ExecutableObjectIF.h>
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
2023-03-09 19:42:20 +01:00
#include <mission/core/GenericFactory.h>
2023-03-09 17:44:05 +01:00
#include <mission/tmtc/PersistentTmStore.h>
#include <mission/tmtc/PersistentTmStoreWithTmQueue.h>
2023-03-09 19:42:20 +01:00
#include <mission/tmtc/TmStoreTaskBase.h>
2023-03-09 17:44:05 +01:00
#include <mission/tmtc/VirtualChannelWithQueue.h>
struct LogStores {
2023-03-09 19:42:20 +01:00
LogStores(PersistentTmStores& stores)
: okStore(*stores.okStore), notOkStore(*stores.notOkStore), miscStore(*stores.miscStore) {}
2023-03-09 17:44:05 +01:00
PersistentTmStoreWithTmQueue& okStore;
PersistentTmStoreWithTmQueue& notOkStore;
PersistentTmStoreWithTmQueue& miscStore;
};
2023-03-09 19:42:20 +01:00
class PersistentLogTmStoreTask : public TmStoreTaskBase, public ExecutableObjectIF {
2023-03-09 17:44:05 +01:00
public:
PersistentLogTmStoreTask(object_id_t objectId, StorageManagerIF& ipcStore, LogStores tmStore,
VirtualChannel& channel, SdCardMountedIF& sdcMan);
2023-03-09 19:42:20 +01:00
ReturnValue_t performOperation(uint8_t opCode) override;
2023-03-09 17:44:05 +01:00
private:
2023-03-09 19:42:20 +01:00
LogStores stores;
2023-03-10 02:05:51 +01:00
Countdown tcHandlingCd = Countdown(400);
2023-03-10 02:05:51 +01:00
bool initStoresIfPossible();
2023-03-09 17:44:05 +01:00
};
#endif /* MISSION_TMTC_PERSISTENTLOGTMSTORETASK_H_ */