eive-obsw/bsp_linux/comIF/cookies/P60DockCookie.h

52 lines
1.4 KiB
C++

#ifndef BSP_LINUX_COMIF_COOKIES_P60DockCookie_H_
#define BSP_LINUX_COMIF_COOKIES_P60DockCookie_H_
#include <fsfw/devicehandlers/CookieIF.h>
typedef uint32_t MessageType_t;
/**
* @brief This is the cookie for the communication interface to the cubesat
* space protocol (CSP) implementation of gomspace. The communication
* interface uses CAN as the physical layer. Therefore the cookie also
* holds the CAN instance to use.
* @author Jakob Meier
*/
class P60DockCookie: public CookieIF {
public:
/**
* Constructor for the CSP cookie
* @param cspAddress_ The CSP address of the target device.
*/
P60DockCookie(uint8_t cspAddress_);
virtual ~P60DockCookie();
uint8_t getCspAddress();
char* getCanIf();
int getBitrate();
void setPingMessage();
void setRebootMessage();
void setReadModuleCfgMessage();
void setReadHkMessage();
MessageType_t getMessageType();
void resetMessageType();
/* Message type defines the type of the next data transfer between the
* CSP device and the OBC. */
static const MessageType_t MESSAGE_NONE = 0x0;
static const MessageType_t PING = 0x1;
static const MessageType_t REBOOT = 0x4;
static const MessageType_t READ_MODULE_CONFIG = 0x71;
static const MessageType_t READ_HK = 0x74;
private:
char canInterface[5] = "can0";
uint8_t cspAddress;
int bitrate = 1000;
MessageType_t nextMessage = MESSAGE_NONE;
};
#endif /* BSP_LINUX_COMIF_COOKIES_P60DockCookie_H_ */