2020-11-19 18:24:03 +01:00
|
|
|
/*
|
|
|
|
* P60DockTestTask.h
|
|
|
|
*
|
|
|
|
* Created on: 18.11.2020
|
2020-11-26 10:24:23 +01:00
|
|
|
* Author: Jakob Meier
|
2020-11-19 18:24:03 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TEST_TESTTASKS_P60DOCKTESTTASK_H_
|
|
|
|
#define TEST_TESTTASKS_P60DOCKTESTTASK_H_
|
|
|
|
|
2020-11-23 11:42:22 +01:00
|
|
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
|
|
|
#include <fsfw/tasks/ExecutableObjectIF.h>
|
|
|
|
#include <fsfw/objectmanager/SystemObject.h>
|
|
|
|
|
2020-11-28 13:41:30 +01:00
|
|
|
#include <p60dock.h>
|
|
|
|
#include <gs/param/internal/types.h>
|
2020-11-19 18:24:03 +01:00
|
|
|
#include <csp/csp.h>
|
|
|
|
#include <csp/interfaces/csp_if_can.h>
|
|
|
|
|
|
|
|
|
2020-11-23 11:42:22 +01:00
|
|
|
class P60DockTestTask: public SystemObject,
|
|
|
|
public ExecutableObjectIF,
|
|
|
|
public HasReturnvaluesIF {
|
2020-11-19 18:24:03 +01:00
|
|
|
public:
|
2020-11-23 11:42:22 +01:00
|
|
|
P60DockTestTask(object_id_t objectId_);
|
2020-11-19 18:24:03 +01:00
|
|
|
virtual ~P60DockTestTask();
|
|
|
|
|
|
|
|
virtual ReturnValue_t performOperation(uint8_t operationCode = 0);
|
|
|
|
|
|
|
|
private:
|
|
|
|
/* Interface struct for csp protocol stack */
|
|
|
|
csp_iface_t csp_if;
|
2020-12-04 14:14:08 +01:00
|
|
|
/* CSP address of P60 dock */
|
2020-11-23 11:42:22 +01:00
|
|
|
uint8_t p60dockAddress = 4;
|
2020-12-04 14:14:08 +01:00
|
|
|
/* Client CSP address */
|
|
|
|
uint8_t cspClientAddress = 1;
|
|
|
|
/* CAN interface used by CSP */
|
2020-11-23 11:42:22 +01:00
|
|
|
const char* canIf = "can0";
|
|
|
|
int bitrate = 1000; // bitrate of can
|
|
|
|
int promisc = 0; // set to 0 to enable filter mode
|
2020-12-04 14:14:08 +01:00
|
|
|
/* P60 Dock houskeeping parameters will be stored in this buffer */
|
|
|
|
uint8_t hkMem[P60DOCK_HK_SIZE];
|
2020-11-28 13:41:30 +01:00
|
|
|
gs_param_table_instance_t node_hk;
|
2020-12-04 14:14:08 +01:00
|
|
|
/* Port of CSP ping requests on P60 dock */
|
|
|
|
uint8_t CSP_PING = 1;
|
2020-11-26 10:24:23 +01:00
|
|
|
|
2020-12-04 14:14:08 +01:00
|
|
|
/* Sends ping request and receives ping reply */
|
|
|
|
ReturnValue_t pingP60dock(void);
|
2020-11-23 11:42:22 +01:00
|
|
|
ReturnValue_t initializeCSPStack(void);
|
2020-12-04 14:14:08 +01:00
|
|
|
/* Temperature and raw battery voltage are read from the P60 dock by this
|
|
|
|
* function */
|
2020-11-26 10:24:23 +01:00
|
|
|
ReturnValue_t getParameters(void);
|
2020-11-19 18:24:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* TEST_TESTTASKS_P60DOCKTESTTASK_H_ */
|