fsfw/src/fsfw/rmap/RMAPCookie.h

57 lines
1.4 KiB
C
Raw Permalink Normal View History

2020-12-13 22:12:57 +01:00
#ifndef FSFW_RMAP_RMAPCOOKIE_H_
#define FSFW_RMAP_RMAPCOOKIE_H_
2022-02-02 10:29:30 +01:00
#include <cstddef>
#include "fsfw/devicehandlers/CookieIF.h"
2021-07-19 18:26:54 +02:00
#include "rmapConf.h"
2020-08-13 20:53:35 +02:00
#include "rmapStructs.h"
class RMAPChannelIF;
2020-04-18 14:10:38 +02:00
class RMAPCookie : public CookieIF {
2022-02-02 10:29:30 +01:00
public:
// To Uli: Sorry, I need an empty ctor to initialize an array of cookies.
RMAPCookie();
2022-02-02 10:29:30 +01:00
RMAPCookie(uint32_t set_address, uint8_t set_extended_address, RMAPChannelIF *set_channel,
uint8_t set_command_mask, size_t maxReplyLen = 0);
virtual ~RMAPCookie();
2022-02-02 10:29:30 +01:00
void setAddress(uint32_t address);
uint32_t getAddress();
2018-07-13 18:28:26 +02:00
2022-02-02 10:29:30 +01:00
void setExtendedAddress(uint8_t);
uint8_t getExtendedAddress();
2018-07-13 18:28:26 +02:00
2022-02-02 10:29:30 +01:00
void setChannel(RMAPChannelIF *channel);
RMAPChannelIF *getChannel();
2018-07-13 18:28:26 +02:00
2022-02-02 10:29:30 +01:00
void setCommandMask(uint8_t commandMask);
uint8_t getCommandMask();
2018-07-13 18:28:26 +02:00
2022-02-02 10:29:30 +01:00
size_t getMaxReplyLen() const;
void setMaxReplyLen(size_t maxReplyLen);
2022-02-02 10:29:30 +01:00
uint16_t getTransactionIdentifier() const;
void setTransactionIdentifier(uint16_t id_);
2018-07-13 18:28:26 +02:00
2022-02-02 10:29:30 +01:00
RMAPStructs::rmap_cmd_header *getHeader();
2018-07-13 18:28:26 +02:00
2022-02-02 10:29:30 +01:00
uint32_t getDataLength() const;
void setDataLength(uint32_t lenght_);
2018-07-13 18:28:26 +02:00
2022-02-02 10:29:30 +01:00
uint8_t getDataCrc() const { return dataCRC; }
2018-07-13 18:28:26 +02:00
2022-02-02 10:29:30 +01:00
void setDataCrc(uint8_t dataCrc) { dataCRC = dataCrc; }
2022-02-02 10:29:30 +01:00
protected:
RMAPStructs::rmap_cmd_header header;
RMAPChannelIF *channel;
uint8_t command_mask;
uint32_t maxReplyLen;
uint8_t dataCRC;
};
2020-12-13 22:12:57 +01:00
#endif /* FSFW_RMAP_RMAPCOOKIE_H_ */