2021-09-22 16:54:55 +02:00
|
|
|
#ifndef VIRTUALCHANNEL_H_
|
|
|
|
#define VIRTUALCHANNEL_H_
|
|
|
|
|
|
|
|
#include <fsfw/ipc/MessageQueueIF.h>
|
2022-11-02 10:26:45 +01:00
|
|
|
#include <linux/ipcore/PtmeIF.h>
|
2021-09-22 16:54:55 +02:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
#include "OBSWConfig.h"
|
2022-08-24 17:27:47 +02:00
|
|
|
#include "fsfw/returnvalues/returnvalue.h"
|
2022-01-17 15:58:27 +01:00
|
|
|
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
|
|
|
|
|
2022-01-17 15:57:52 +01:00
|
|
|
class StorageManagerIF;
|
|
|
|
|
2021-09-22 16:54:55 +02:00
|
|
|
/**
|
2021-09-26 08:29:30 +02:00
|
|
|
* @brief This class represents a virtual channel. Sending a tm message to an object of this class
|
|
|
|
* will forward the tm packet to the respective virtual channel of the PTME IP Core.
|
2021-09-22 16:54:55 +02:00
|
|
|
*
|
|
|
|
* @author J. Meier
|
|
|
|
*/
|
2022-08-24 17:27:47 +02:00
|
|
|
class VirtualChannel : public AcceptsTelemetryIF {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param vcId The virtual channel id assigned to this object
|
|
|
|
* @param tmQueueDepth Queue depth of queue receiving telemetry from other objects
|
|
|
|
*/
|
2022-02-22 20:27:13 +01:00
|
|
|
VirtualChannel(uint8_t vcId, uint32_t tmQueueDepth, object_id_t ownerId);
|
2022-01-17 15:58:27 +01:00
|
|
|
|
|
|
|
ReturnValue_t initialize();
|
2022-10-21 11:31:38 +02:00
|
|
|
MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) const override;
|
2022-01-17 15:58:27 +01:00
|
|
|
ReturnValue_t performOperation();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Sets the PTME object which handles access to the PTME IP Core.
|
|
|
|
*
|
|
|
|
* @param ptme Pointer to ptme object
|
|
|
|
*/
|
|
|
|
void setPtmeObject(PtmeIF* ptme_);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Can be used by the owner to set the link state. Packets will be discarded if link
|
|
|
|
* to ground station is down.
|
|
|
|
*/
|
|
|
|
void setLinkState(bool linkIsUp_);
|
2022-09-16 11:43:11 +02:00
|
|
|
const char* getName() const override;
|
2022-01-17 15:58:27 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
PtmeIF* ptme = nullptr;
|
|
|
|
MessageQueueIF* tmQueue = nullptr;
|
2022-04-27 16:44:03 +02:00
|
|
|
uint8_t vcId = 0;
|
2022-09-16 11:43:11 +02:00
|
|
|
std::string vcName;
|
2022-01-17 15:58:27 +01:00
|
|
|
|
|
|
|
bool linkIsUp = false;
|
|
|
|
|
|
|
|
StorageManagerIF* tmStore = nullptr;
|
2021-09-22 16:54:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* VIRTUALCHANNEL_H_ */
|