eive-obsw/bsp_linux/comIF/P60DockComIF.h

60 lines
1.8 KiB
C++

/*
* P60DockComIF.h
*
* Created on: 01.12.2020
* Author: jakob
*/
#ifndef BSP_LINUX_COMIF_P60DOCKCOMIF_H_
#define BSP_LINUX_COMIF_P60DOCKCOMIF_H_
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
#include <gomspace/libcsp/include/csp/csp_types.h>
#include <gomspace/libcsp/include/csp/csp_error.h>
#include <gomspace/libparam_client/include/gs/param/types.h>
#include <gs/param/internal/types.h>
#include <p60dock.h>
/**
* @brief This is the communication interface to the cubesat space protocol
* stack. The physical layer used for this implementation is CAN.
* @author Jakob Meier
*/
class P60DockComIF: public DeviceCommunicationIF, public SystemObject {
public:
static const uint8_t maxReplyLength = 188;
P60DockComIF(object_id_t objectId);
virtual ~P60DockComIF();
ReturnValue_t initializeInterface(CookieIF * cookie) override;
ReturnValue_t sendMessage(CookieIF *cookie, const uint8_t * sendData,
size_t sendLen) override;
ReturnValue_t getSendSuccess(CookieIF *cookie) override;
ReturnValue_t requestReceiveMessage(CookieIF *cookie,
size_t requestLen) override;
ReturnValue_t readReceivedMessage(CookieIF *cookie,
uint8_t **readData, size_t *readLen) override;
private:
/* Interface struct for csp protocol stack */
csp_iface_t csp_if;
/* Table definitions. According to gomspace software documentation there
* exist four tables each identified by a number*/
uint8_t boardConfigTableNum = 0;
uint8_t moduleCfgTableNum = 1;
uint8_t calibrationParamTableNum = 2;
uint8_t tmTableNum = 4;
unsigned int moduleConfigTableRows = 32;
uint8_t moduleCfgTableSize = 188;
uint8_t tmTableSize = 188;
uint8_t replyBuffer[188];
gs_param_table_instance_t tmData;
};
#endif /* BSP_LINUX_COMIF_P60DOCKCOMIF_H_ */