fsfw/src/fsfw/tmtcservices/TmStoreHelper.h

44 lines
1.4 KiB
C
Raw Normal View History

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-07-20 22:21:15 +02:00
#include "fsfw/timemanager/TimeStamperIF.h"
2022-07-20 11:43:16 +02:00
#include "fsfw/tmtcpacket/pus/tm/PusTmCreator.h"
class TmStoreHelper {
public:
explicit TmStoreHelper(uint16_t defaultApid);
TmStoreHelper(uint16_t defaultApid, StorageManagerIF& tmStore);
TmStoreHelper(uint16_t defaultApid, StorageManagerIF& tmStore, TimeStamperIF& timeStamper);
2022-07-20 22:21:15 +02:00
ReturnValue_t preparePacket(uint8_t service, uint8_t subservice, uint16_t counter);
PusTmCreator& getCreatorRef();
2022-07-25 13:39:07 +02:00
void setTimeStamper(TimeStamperIF& timeStamper);
2022-07-25 13:39:07 +02:00
[[nodiscard]] TimeStamperIF* getTimeStamper() const;
[[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;
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