2022-07-20 11:43:16 +02:00
|
|
|
#ifndef FSFW_TMTCSERVICES_STOREHELPER_H
|
|
|
|
#define FSFW_TMTCSERVICES_STOREHELPER_H
|
|
|
|
|
|
|
|
#include "fsfw/internalerror/InternalErrorReporterIF.h"
|
|
|
|
#include "fsfw/ipc/MessageQueueMessageIF.h"
|
|
|
|
#include "fsfw/storagemanager/StorageManagerIF.h"
|
2022-09-05 14:44:35 +02:00
|
|
|
#include "fsfw/timemanager/TimeWriterIF.h"
|
2022-07-20 11:43:16 +02:00
|
|
|
#include "fsfw/tmtcpacket/pus/tm/PusTmCreator.h"
|
|
|
|
|
|
|
|
class TmStoreHelper {
|
|
|
|
public:
|
2022-07-25 10:50:52 +02:00
|
|
|
explicit TmStoreHelper(uint16_t defaultApid);
|
|
|
|
TmStoreHelper(uint16_t defaultApid, StorageManagerIF& tmStore);
|
2022-09-05 14:44:35 +02:00
|
|
|
TmStoreHelper(uint16_t defaultApid, StorageManagerIF& tmStore, TimeWriterIF& timeStamper);
|
2022-07-20 22:21:15 +02:00
|
|
|
|
2022-07-27 11:41:06 +02:00
|
|
|
void disableCrcCalculation();
|
|
|
|
[[nodiscard]] bool crcCalculationEnabled() const;
|
|
|
|
|
2022-07-20 22:21:15 +02:00
|
|
|
ReturnValue_t preparePacket(uint8_t service, uint8_t subservice, uint16_t counter);
|
|
|
|
|
2022-07-25 11:15:45 +02:00
|
|
|
PusTmCreator& getCreatorRef();
|
2022-07-25 13:39:07 +02:00
|
|
|
|
2022-09-05 14:44:35 +02:00
|
|
|
void setTimeStamper(TimeWriterIF& timeStamper);
|
|
|
|
[[nodiscard]] TimeWriterIF* getTimeStamper() const;
|
2022-07-25 13:39:07 +02:00
|
|
|
|
|
|
|
[[nodiscard]] StorageManagerIF* getTmStore() const;
|
|
|
|
void setTmStore(StorageManagerIF& store);
|
|
|
|
|
|
|
|
void setApid(uint16_t apid);
|
|
|
|
[[nodiscard]] uint16_t getApid() const;
|
|
|
|
|
2022-07-20 22:21:15 +02:00
|
|
|
[[nodiscard]] const store_address_t& getCurrentAddr() const;
|
2022-07-26 11:14:40 +02:00
|
|
|
void setService(uint8_t service);
|
|
|
|
void setSubservice(uint8_t subservice);
|
2022-07-25 11:24:13 +02:00
|
|
|
ReturnValue_t setSourceDataRaw(const uint8_t* data, size_t len);
|
2022-07-25 11:26:45 +02:00
|
|
|
ReturnValue_t setSourceDataSerializable(SerializeIF& serializable);
|
2022-07-25 13:39:07 +02:00
|
|
|
|
2022-07-20 22:21:15 +02:00
|
|
|
ReturnValue_t addPacketToStore();
|
|
|
|
ReturnValue_t deletePacket();
|
2022-07-20 11:43:16 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
PusTmCreator creator;
|
|
|
|
store_address_t currentAddr{};
|
|
|
|
StorageManagerIF* tmStore;
|
|
|
|
};
|
|
|
|
#endif // FSFW_TMTCSERVICES_STOREHELPER_H
|