improvements

This commit is contained in:
Robin Müller 2020-12-22 15:57:43 +01:00
parent 83458c851e
commit 021b9b8c50
5 changed files with 43 additions and 15 deletions

View File

@ -1,5 +1,5 @@
#ifndef PLATFORM_TMTCSERVICES_TMSTOREBACKENDIF_H_
#define PLATFORM_TMTCSERVICES_TMSTOREBACKENDIF_H_
#ifndef FSFW_TMTCSERVICES_TMSTOREBACKENDIF_H_
#define FSFW_TMTCSERVICES_TMSTOREBACKENDIF_H_
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../objectmanager/SystemObjectIF.h"
@ -49,14 +49,33 @@ public:
static const Event AUTO_CATALOGS_SENDING_FAILED = MAKE_EVENT(15, severity::INFO);//!< Info that the a auto catalog report failed
virtual ~TmStoreBackendIF() {}
/**
* SHOULDDO: Specification on what has to be implemented here
* @param opCode
* @return
*/
virtual ReturnValue_t performOperation(uint8_t opCode) = 0;
virtual ReturnValue_t initialize() = 0;
/**
* Implement the storage of TM packets to mass memory
* @param tmPacket
* @return
*/
virtual ReturnValue_t storePacket(TmPacketMinimal* tmPacket) = 0;
virtual ReturnValue_t setFetchLimitTime(const timeval* loverLimit, const timeval* upperLimit) = 0;
virtual ReturnValue_t setFetchLimitBlocks(uint32_t startAddress, uint32_t endAddress) = 0;
virtual ReturnValue_t fetchPackets(bool fromBegin = false) = 0;
virtual ReturnValue_t initializeStore(object_id_t dumpTarget) = 0;
virtual ReturnValue_t dumpIndex(store_address_t* storeId) = 0;
/**
* SHOULDDO: Adapt for file management system?
* @param startAddress
* @param endAddress
* @return
*/
virtual ReturnValue_t deleteBlocks(uint32_t startAddress, uint32_t endAddress) = 0;
virtual ReturnValue_t deleteTime(const timeval* timeUntil,
uint32_t* deletedPackets) = 0;
@ -73,4 +92,4 @@ public:
#endif /* PLATFORM_TMTCSERVICES_TMSTOREBACKENDIF_H_ */
#endif /* FSFW_TMTCSERVICES_TMSTOREBACKENDIF_H_ */

View File

@ -1,9 +1,10 @@
#ifndef PLATFORM_TMTCSERVICES_TMSTOREFRONTENDIF_H_
#define PLATFORM_TMTCSERVICES_TMSTOREFRONTENDIF_H_
#ifndef FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_
#define FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_
#include "../returnvalues/HasReturnvaluesIF.h"
#include "TmStorePackets.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../ipc/MessageQueueSenderIF.h"
class TmPacketMinimal;
class SpacePacketBase;
class TmStoreBackendIF;
@ -11,6 +12,14 @@ class TmStoreBackendIF;
class TmStoreFrontendIF {
public:
virtual TmStoreBackendIF* getBackend() const = 0;
/**
* What do I need to implement here?
* This is propably used by PUS Service 15 so we should propably check for messages..
* Provide base implementation?
* @param opCode
* @return
*/
virtual ReturnValue_t performOperation(uint8_t opCode) = 0;
/**
* Callback from the back-end to indicate a certain packet was received.
@ -52,4 +61,4 @@ public:
#endif /* PLATFORM_TMTCSERVICES_TMSTOREFRONTENDIF_H_ */
#endif /* FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_ */

View File

@ -1,5 +1,5 @@
#include "../objectmanager/ObjectManagerIF.h"
#include "TmStoreMessage.h"
#include "../tmstorage/TmStoreMessage.h"
TmStoreMessage::~TmStoreMessage() {
@ -74,7 +74,7 @@ void TmStoreMessage::clear(CommandMessage* cmd) {
case DELETE_STORE_CONTENT_BLOCKS:
case DOWNLINK_STORE_CONTENT_BLOCKS:
case REPORT_INDEX_REQUEST:
cmd->setCommand(UNKNOWN_COMMAND);
cmd->setCommand(CommandMessage::UNKNOWN_COMMAND);
cmd->setParameter(0);
cmd->setParameter2(0);
break;

View File

@ -3,9 +3,9 @@
#include "../ipc/CommandMessage.h"
#include "../storagemanager/StorageManagerIF.h"
#include "TmStorePackets.h"
#include "../tmstorage/TmStorePackets.h"
#include "../objectmanager/SystemObjectIF.h"
class TmStoreMessage: public CommandMessage {
class TmStoreMessage {
public:
static ReturnValue_t setEnableStoringMessage(CommandMessage* cmd,
bool setEnabled);

View File

@ -140,8 +140,8 @@ public:
if(packet->isValid()){
timeval packetTime = {0,0};
size_t foundlen = 0;
CCSDSTime::convertFromCcsds(&packetTime,
&packet->rawTimestamp[0],&foundlen,sizeof(rawTimestamp));
CCSDSTime::convertFromCcsds(&packetTime,&packet->rawTimestamp[0],
&foundlen,sizeof(rawTimestamp));
if(packetTime <= *cmpTime){
return true;
}
@ -154,7 +154,7 @@ public:
timeval packetTime = {0,0};
size_t foundlen = 0;
CCSDSTime::convertFromCcsds(&packetTime,&packet->rawTimestamp[0],
&foundlen,sizeof(rawTimestamp));
&foundlen,sizeof(rawTimestamp));
if(packetTime >= *cmpTime){
return true;
}
@ -208,7 +208,7 @@ public:
timeval packetTime = {0,0};
size_t foundlen = 0;
CCSDSTime::convertFromCcsds(&packetTime, &this->rawTimestamp[0],
&foundlen,sizeof(rawTimestamp));
&foundlen, sizeof(rawTimestamp));
return packetTime;
}