2020-12-04 14:14:08 +01:00
|
|
|
#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.
|
|
|
|
*/
|
2020-12-05 14:52:18 +01:00
|
|
|
P60DockCookie(uint8_t cspAddress_);
|
2020-12-04 14:14:08 +01:00
|
|
|
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:
|
|
|
|
|
2020-12-05 14:52:18 +01:00
|
|
|
char canInterface[5] = "can0";
|
2020-12-04 14:14:08 +01:00
|
|
|
uint8_t cspAddress;
|
|
|
|
int bitrate = 1000;
|
|
|
|
MessageType_t nextMessage = MESSAGE_NONE;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* BSP_LINUX_COMIF_COOKIES_P60DockCookie_H_ */
|