56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <fsfw/objectmanager/SystemObject.h>
|
|
#include <fsfw/storagemanager/StorageManagerIF.h>
|
|
|
|
#include <map>
|
|
|
|
#include "AcceptsTelemetryIF.h"
|
|
#include "FsfwProtocols.h"
|
|
|
|
// TODO handle VCs and backpressure
|
|
|
|
class TmManager : public SystemObject {
|
|
public:
|
|
struct protocolInformation {
|
|
neither_type protocol;
|
|
size_t offset;
|
|
MessageQueueId_t reportingQueue;
|
|
};
|
|
|
|
|
|
TmManager(object_id_t setObjectId);
|
|
|
|
virtual ~TmManager() = default;
|
|
|
|
ReturnValue_t initialize() override;
|
|
|
|
/**
|
|
* returns the offset which the application data should start at, using the same network layer as
|
|
* the tc, as well as the protocol type which should be the first byte of the tm
|
|
*
|
|
*/
|
|
ReturnValue_t getProtocolInformation(store_address_t tc, protocolInformation *information) const;
|
|
|
|
/**
|
|
* If tm is unrequested, get Default path
|
|
*/
|
|
ReturnValue_t getDefaultProtocolInformation(protocolInformation *information) const;
|
|
|
|
/**
|
|
* Offset is where application data should start in a preset zero-copy packet. If no fixed value,
|
|
* report 0 and allocate and copy yourself
|
|
*/
|
|
ReturnValue_t registerNetworkProtocolInterface(AcceptsTelemetryIF2 *object, neither_type protocol,
|
|
size_t offset);
|
|
|
|
protected:
|
|
struct ProtocolInformation {
|
|
MessageQueueId_t queue;
|
|
size_t offset;
|
|
};
|
|
|
|
StorageManagerIF *IPCStore;
|
|
|
|
std::map<neither_type, ProtocolInformation> protocolMap;
|
|
}; |