2016-06-15 23:48:41 +02:00
|
|
|
#ifndef PLATFORM_TMTCSERVICES_TMSTOREFRONTENDIF_H_
|
|
|
|
#define PLATFORM_TMTCSERVICES_TMSTOREFRONTENDIF_H_
|
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "../returnvalues/HasReturnvaluesIF.h"
|
|
|
|
#include "TmStorePackets.h"
|
|
|
|
#include "../ipc/MessageQueueSenderIF.h"
|
2016-06-15 23:48:41 +02:00
|
|
|
class TmPacketMinimal;
|
|
|
|
class SpacePacketBase;
|
|
|
|
class TmStoreBackendIF;
|
|
|
|
|
|
|
|
class TmStoreFrontendIF {
|
|
|
|
public:
|
|
|
|
virtual TmStoreBackendIF* getBackend() const = 0;
|
2018-07-12 16:29:32 +02:00
|
|
|
virtual ReturnValue_t performOperation(uint8_t opCode) = 0;
|
2016-06-15 23:48:41 +02: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.
|
|
|
|
* @return If more packets shall be fetched, RETURN_OK must be returned.
|
|
|
|
* Any other code stops fetching packets.
|
|
|
|
*/
|
2018-07-12 16:29:32 +02:00
|
|
|
virtual ReturnValue_t packetRetrieved(TmPacketMinimal* packet, uint32_t address) = 0;
|
|
|
|
virtual void noMorePacketsInStore() = 0;
|
2016-06-15 23:48:41 +02:00
|
|
|
virtual void handleRetrievalFailed(ReturnValue_t errorCode, uint32_t parameter1 = 0, uint32_t parameter2 = 0) = 0;
|
|
|
|
/**
|
|
|
|
* To get the queue where commands shall be sent.
|
|
|
|
* @return Id of command queue.
|
|
|
|
*/
|
2018-07-12 16:29:32 +02:00
|
|
|
virtual MessageQueueId_t getCommandQueue() const = 0;
|
2016-06-15 23:48:41 +02:00
|
|
|
virtual ReturnValue_t fetchPackets(ApidSsc start, ApidSsc end) = 0;
|
|
|
|
virtual ReturnValue_t deletePackets(ApidSsc upTo) = 0;
|
|
|
|
virtual ReturnValue_t checkPacket(SpacePacketBase* tmPacket) = 0;
|
|
|
|
virtual bool isEnabled() const = 0;
|
|
|
|
virtual void setEnabled(bool enabled) = 0;
|
2018-07-12 16:29:32 +02:00
|
|
|
virtual void resetDownlinkedPacketCount() = 0;
|
|
|
|
virtual ReturnValue_t setDumpTarget(object_id_t dumpTarget) = 0;
|
|
|
|
static const uint8_t INTERFACE_ID = CLASS_ID::TM_STORE_FRONTEND_IF;
|
2016-06-15 23:48:41 +02:00
|
|
|
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);
|
2018-07-12 16:29:32 +02:00
|
|
|
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);
|
2016-06-15 23:48:41 +02:00
|
|
|
virtual ~TmStoreFrontendIF() {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* PLATFORM_TMTCSERVICES_TMSTOREFRONTENDIF_H_ */
|