eive-obsw/bsp_linux/comIF/P60DockComIF.h

59 lines
1.8 KiB
C
Raw Normal View History

2020-12-04 14:14:08 +01:00
/*
* 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>
2020-12-04 20:08:58 +01:00
#include <p60dock.h>
2020-12-04 14:14:08 +01:00
/**
* @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:
2020-12-10 10:01:45 +01:00
static const uint16_t maxReplyLength = 412;
2020-12-04 14:14:08 +01:00
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:
2020-12-10 10:01:45 +01:00
/* This is the CSP address of the OBC. */
uint8_t cspClientAddress = 1;
2020-12-04 14:14:08 +01:00
/* 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 moduleCfgTableNum = 1;
uint8_t calibrationParamTableNum = 2;
uint8_t tmTableNum = 4;
2020-12-10 10:01:45 +01:00
/* Replies of P60 dock are written to this buffer */
uint8_t replyBuffer[P60DockComIF::maxReplyLength];
gs_param_table_instance_t table;
2020-12-04 14:14:08 +01:00
};
#endif /* BSP_LINUX_COMIF_P60DOCKCOMIF_H_ */