eive-obsw/mission/power/CspCookie.h

39 lines
968 B
C
Raw Normal View History

#ifndef LINUX_CSP_CSPCOOKIE_H_
#define LINUX_CSP_CSPCOOKIE_H_
2020-12-14 08:42:48 +01:00
#include <fsfw/devicehandlers/CookieIF.h>
2023-03-26 16:13:54 +02:00
#include <mission/power/gsDefs.h>
2022-08-26 14:28:06 +02:00
2022-08-26 03:20:44 +02:00
#include <cstddef>
2022-08-26 14:28:06 +02:00
#include <cstdint>
2020-12-14 08:42:48 +01:00
/**
* @brief This is the cookie for devices supporting the CSP (CubeSat Space
* Protocol).
* @author J. Meier
*/
2022-01-17 15:58:27 +01:00
class CspCookie : public CookieIF {
public:
2022-08-26 03:20:44 +02:00
CspCookie(uint16_t maxReplyLength_, uint8_t cspAddress_, uint32_t timeoutMs);
2022-01-17 15:58:27 +01:00
virtual ~CspCookie();
2020-12-14 08:42:48 +01:00
2022-08-26 03:20:44 +02:00
void setCspPort(uint8_t port);
uint8_t getCspPort() const;
2022-01-17 15:58:27 +01:00
uint16_t getMaxReplyLength();
GOMSPACE::SpecialRequestTypes getRequest() const;
void setRequest(GOMSPACE::SpecialRequestTypes request, size_t replyLen);
2022-08-26 03:20:44 +02:00
size_t getReplyLen() const;
2022-01-17 15:58:27 +01:00
uint8_t getCspAddress();
2022-08-26 03:20:44 +02:00
uint32_t getTimeout() const;
2020-12-14 08:42:48 +01:00
2022-01-17 15:58:27 +01:00
private:
2022-08-31 22:52:32 +02:00
uint8_t cspPort = 0;
2022-01-17 15:58:27 +01:00
uint16_t maxReplyLength;
uint8_t cspAddress;
2022-08-26 03:20:44 +02:00
size_t replyLen = 0;
uint32_t timeoutMs;
GOMSPACE::SpecialRequestTypes reqType;
2020-12-14 08:42:48 +01:00
};
#endif /* LINUX_CSP_CSPCOOKIE_H_ */