2020-12-14 21:30:39 +01:00
|
|
|
#ifndef FSFW_TMTCSERVICES_TMTCMESSAGE_H_
|
|
|
|
#define FSFW_TMTCSERVICES_TMTCMESSAGE_H_
|
2016-06-15 23:48:41 +02:00
|
|
|
|
2021-07-13 20:58:45 +02:00
|
|
|
#include "fsfw/ipc/MessageQueueMessage.h"
|
|
|
|
#include "fsfw/storagemanager/StorageManagerIF.h"
|
2016-06-15 23:48:41 +02:00
|
|
|
/**
|
|
|
|
* @brief This message class is used to pass Telecommand and Telemetry
|
|
|
|
* packets between tasks.
|
|
|
|
* @details Within such a packet, nothing is transported but the identifier of
|
|
|
|
* a packet stored in one of the IPC stores (typically a special TM and
|
|
|
|
* a special TC store). This makes passing commands very simple and
|
|
|
|
* efficient.
|
2020-12-14 21:30:39 +01:00
|
|
|
* @ingroup message_queue
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
class TmTcMessage : public MessageQueueMessage {
|
2022-02-02 10:29:30 +01:00
|
|
|
protected:
|
|
|
|
/**
|
|
|
|
* @brief This call always returns the same fixed size of the message.
|
|
|
|
* @return Returns HEADER_SIZE + @c sizeof(store_address_t).
|
|
|
|
*/
|
2022-07-26 16:49:46 +02:00
|
|
|
[[nodiscard]] size_t getMinimumMessageSize() const override;
|
2022-02-02 10:29:30 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief In the default constructor, only the message_size is set.
|
|
|
|
*/
|
|
|
|
TmTcMessage();
|
|
|
|
/**
|
|
|
|
* @brief With this constructor, the passed packet id is directly put
|
|
|
|
* into the message.
|
|
|
|
* @param packet_id The packet id to put into the message.
|
|
|
|
*/
|
2022-07-26 16:49:46 +02:00
|
|
|
explicit TmTcMessage(store_address_t packetId);
|
2022-02-02 10:29:30 +01:00
|
|
|
/**
|
|
|
|
* @brief The class's destructor is empty.
|
|
|
|
*/
|
2022-07-26 16:49:46 +02:00
|
|
|
~TmTcMessage() override;
|
2022-02-02 10:29:30 +01:00
|
|
|
/**
|
|
|
|
* @brief This getter returns the packet id in the correct format.
|
|
|
|
* @return Returns the packet id.
|
|
|
|
*/
|
|
|
|
store_address_t getStorageId();
|
|
|
|
/**
|
|
|
|
* @brief In some cases it might be useful to have a setter for packet id
|
|
|
|
* as well.
|
|
|
|
* @param packetId The packet id to put into the message.
|
|
|
|
*/
|
|
|
|
void setStorageId(store_address_t packetId);
|
2016-06-15 23:48:41 +02:00
|
|
|
};
|
|
|
|
|
2020-12-14 21:30:39 +01:00
|
|
|
#endif /* FSFW_TMTCSERVICES_TMTCMESSAGE_H_ */
|