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

50 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 canInterface_ The CAN interface to use. E.g. "can0" or "can1".
* @param cspAddress_ The CSP address of the target device.
*/
P60DockCookie(char* canInterface_, uint8_t cspAddress_);
virtual ~P60DockCookie();
uint8_t getCspAddress();
char* getCanIf();
int getBitrate();
void setPingMessage();
void setRebootMessage();
void setReadModuleCfgMessage();
MessageType_t getMessageType();
/* 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;
private:
char* canInterface;
uint8_t cspAddress;
int bitrate = 1000;
MessageType_t nextMessage = MESSAGE_NONE;
};
#endif /* BSP_LINUX_COMIF_COOKIES_P60DockCookie_H_ */