Persistent TM Store #320
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
//! When using the newlib nano library, C99 support for stdio facilities
|
//! When using the newlib nano library, C99 support for stdio facilities
|
||||||
//! will not be provided. This define should be set to 1 if this is the case.
|
//! will not be provided. This define should be set to 1 if this is the case.
|
||||||
#define FSFW_NO_C99_IO 1
|
#define FSFW_NO_C99_IO 0
|
||||||
|
|
||||||
//! Specify whether a special mode store is used for Subsystem components.
|
//! Specify whether a special mode store is used for Subsystem components.
|
||||||
#define FSFW_USE_MODESTORE 0
|
#define FSFW_USE_MODESTORE 0
|
||||||
|
@ -1,32 +1,14 @@
|
|||||||
#include "TmStore.h"
|
#include "TmStore.h"
|
||||||
|
#include <mission/memory/SdCardMountedIF.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace returnvalue;
|
using namespace returnvalue;
|
||||||
|
|
||||||
const char* TmStore::getName() const { return "TM Store Backend"; }
|
TmStore::TmStore(object_id_t objectId, SdCardMountedIF& sdcMan)
|
||||||
|
: SystemObject(objectId), sdcMan(sdcMan) {}
|
||||||
|
|
||||||
MessageQueueId_t TmStore::getReportReceptionQueue(uint8_t virtualChannel) const {
|
ReturnValue_t TmStore::passPacket(PusTmReader& reader) {
|
||||||
return MessageQueueIF::NO_QUEUE;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageQueueId_t TmStore::getCommandQueue() const { return MessageQueueIF::NO_QUEUE; }
|
MessageQueueId_t TmStore::getCommandQueue() { return MessageQueueIF::NO_QUEUE; }
|
||||||
|
|
||||||
TmStoreBackendIF* TmStore::getBackend() const { return nullptr; }
|
|
||||||
|
|
||||||
ReturnValue_t TmStore::packetRetrieved(PusTmReader* packet, uint32_t address) { return OK; }
|
|
||||||
|
|
||||||
void TmStore::noMorePacketsInStore() {}
|
|
||||||
|
|
||||||
void TmStore::handleRetrievalFailed(ReturnValue_t errorCode, uint32_t parameter1,
|
|
||||||
uint32_t parameter2) {}
|
|
||||||
|
|
||||||
ReturnValue_t TmStore::fetchPackets(ApidSsc start, ApidSsc end) { return OK; }
|
|
||||||
|
|
||||||
ReturnValue_t TmStore::deletePackets(ApidSsc upTo) { return OK; }
|
|
||||||
|
|
||||||
ReturnValue_t TmStore::checkPacket(SpacePacketReader* tmPacket) { return OK; }
|
|
||||||
|
|
||||||
void TmStore::setEnabled(bool enabled) {}
|
|
||||||
|
|
||||||
void TmStore::resetDownlinkedPacketCount() {}
|
|
||||||
|
|
||||||
ReturnValue_t TmStore::setDumpTarget(object_id_t dumpTarget) { return OK; }
|
|
||||||
|
@ -1,44 +1,38 @@
|
|||||||
#ifndef MISSION_TMTC_TMSTOREBACKEND_H_
|
#ifndef MISSION_TMTC_TMSTOREBACKEND_H_
|
||||||
#define MISSION_TMTC_TMSTOREBACKEND_H_
|
#define MISSION_TMTC_TMSTOREBACKEND_H_
|
||||||
|
|
||||||
|
#include <mission/memory/SdCardMountedIF.h>
|
||||||
|
|
||||||
|
#include <fsfw/objectmanager/SystemObject.h>
|
||||||
#include <fsfw/tmstorage/TmStoreFrontendIF.h>
|
#include <fsfw/tmstorage/TmStoreFrontendIF.h>
|
||||||
|
#include <fsfw/tmtcpacket/pus/tm/PusTmReader.h>
|
||||||
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
|
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
|
||||||
|
|
||||||
class TmStore : public TmStoreFrontendIF, public AcceptsTelemetryIF {
|
struct PacketFilter {
|
||||||
|
std::optional<uint16_t> apid;
|
||||||
|
std::optional<uint8_t> service;
|
||||||
|
std::optional<std::pair<uint8_t, uint8_t>> serviceSubservice;
|
||||||
|
};
|
||||||
|
|
||||||
|
class TmStore : public SystemObject {
|
||||||
public:
|
public:
|
||||||
[[nodiscard]] const char* getName() const override;
|
TmStore(object_id_t objectId, SdCardMountedIF& sdcMan);
|
||||||
[[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override;
|
|
||||||
|
ReturnValue_t passPacket(PusTmReader& reader);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* To get the queue where commands shall be sent.
|
* To get the queue where commands shall be sent.
|
||||||
* @return Id of command queue.
|
* @return Id of command queue.
|
||||||
*/
|
*/
|
||||||
MessageQueueId_t getCommandQueue() const override;
|
MessageQueueId_t getCommandQueue();
|
||||||
|
|
||||||
TmStoreBackendIF* getBackend() const override;
|
SdCardMountedIF& sdcMan;
|
||||||
|
|
||||||
/**
|
|
||||||
* 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, returnvalue::OK must be returned.
|
|
||||||
* Any other code stops fetching packets.
|
|
||||||
*/
|
|
||||||
ReturnValue_t packetRetrieved(PusTmReader* packet, uint32_t address) override;
|
|
||||||
void noMorePacketsInStore() override;
|
|
||||||
void handleRetrievalFailed(ReturnValue_t errorCode, uint32_t parameter1 = 0,
|
|
||||||
uint32_t parameter2 = 0) override;
|
|
||||||
|
|
||||||
ReturnValue_t fetchPackets(ApidSsc start, ApidSsc end) override;
|
std::vector<uint16_t> apidToStore;
|
||||||
ReturnValue_t deletePackets(ApidSsc upTo) override;
|
std::vector<uint8_t> servicesToStore;
|
||||||
ReturnValue_t checkPacket(SpacePacketReader* tmPacket) override;
|
std::vector<std::pair<uint8_t, uint8_t>> serviceSubserviceCombinationToStore;
|
||||||
bool isEnabled() const = 0;
|
|
||||||
void setEnabled(bool enabled) override;
|
|
||||||
void resetDownlinkedPacketCount() override;
|
|
||||||
ReturnValue_t setDumpTarget(object_id_t dumpTarget) override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */
|
#endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user