fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h

60 lines
2.4 KiB
C
Raw Normal View History

2020-12-22 15:57:43 +01:00
#ifndef FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_
#define FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_
2020-08-13 20:53:35 +02:00
#include "TmStorePackets.h"
2021-07-19 18:26:54 +02:00
#include "fsfw/ipc/MessageQueueSenderIF.h"
2022-08-16 12:48:22 +02:00
#include "fsfw/returnvalues/returnvalue.h"
2022-02-02 10:29:30 +01:00
#include "tmStorageConf.h"
2020-12-22 15:57:43 +01:00
2022-10-24 10:56:01 +02:00
class PusTmReader;
class SpacePacketReader;
class TmStoreBackendIF;
class TmStoreFrontendIF {
2022-02-02 10:29:30 +01:00
public:
2022-10-24 10:56:01 +02:00
static const uint8_t INTERFACE_ID = CLASS_ID::TM_STORE_FRONTEND_IF;
static const ReturnValue_t BUSY = MAKE_RETURN_CODE(1);
static const ReturnValue_t LAST_PACKET_FOUND = MAKE_RETURN_CODE(2);
static const ReturnValue_t STOP_FETCH = MAKE_RETURN_CODE(3);
static const ReturnValue_t TIMEOUT = MAKE_RETURN_CODE(4);
static const ReturnValue_t TM_CHANNEL_FULL = MAKE_RETURN_CODE(5);
static const ReturnValue_t NOT_STORED = MAKE_RETURN_CODE(6);
static const ReturnValue_t ALL_DELETED = MAKE_RETURN_CODE(7);
static const ReturnValue_t INVALID_DATA = MAKE_RETURN_CODE(8);
static const ReturnValue_t NOT_READY = MAKE_RETURN_CODE(9);
virtual ~TmStoreFrontendIF() = default;
2020-12-22 15:57:43 +01:00
2022-02-02 10:29:30 +01:00
/**
2022-10-24 10:56:01 +02:00
* To get the queue where commands shall be sent.
* @return Id of command queue.
2022-02-02 10:29:30 +01:00
*/
2022-10-24 10:56:01 +02:00
virtual MessageQueueId_t getCommandQueue() const = 0;
virtual TmStoreBackendIF* getBackend() const = 0;
2022-02-02 10:29:30 +01:00
/**
* Callback from the back-end to indicate a certain packet was received.
* front-end takes care of discarding/downloading the packet.
* @param packet Pointer to the newly received Space Packet.
* @param address Start address of the packet found
* @param isLastPacket Indicates if no more packets can be fetched.
2022-08-16 12:12:21 +02:00
* @return If more packets shall be fetched, returnvalue::OK must be returned.
2022-02-02 10:29:30 +01:00
* Any other code stops fetching packets.
*/
2022-10-24 10:56:01 +02:00
virtual ReturnValue_t packetRetrieved(PusTmReader* packet, uint32_t address) = 0;
2022-02-02 10:29:30 +01:00
virtual void noMorePacketsInStore() = 0;
virtual void handleRetrievalFailed(ReturnValue_t errorCode, uint32_t parameter1 = 0,
uint32_t parameter2 = 0) = 0;
2022-10-24 10:56:01 +02:00
2022-02-02 10:29:30 +01:00
virtual ReturnValue_t fetchPackets(ApidSsc start, ApidSsc end) = 0;
virtual ReturnValue_t deletePackets(ApidSsc upTo) = 0;
2022-10-24 10:56:01 +02:00
virtual ReturnValue_t checkPacket(SpacePacketReader* tmPacket) = 0;
2022-02-02 10:29:30 +01:00
virtual bool isEnabled() const = 0;
virtual void setEnabled(bool enabled) = 0;
virtual void resetDownlinkedPacketCount() = 0;
virtual ReturnValue_t setDumpTarget(object_id_t dumpTarget) = 0;
};
2020-12-22 15:57:43 +01:00
#endif /* FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_ */