eive-obsw/linux/boardtest/UartTestClass.h
Irini Kosmidou 01d86a0c7b
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
huge progress
2022-04-08 19:12:21 +02:00

52 lines
1.2 KiB
C++

#ifndef LINUX_BOARDTEST_UARTTESTCLASS_H_
#define LINUX_BOARDTEST_UARTTESTCLASS_H_
#include <fsfw/globalfunctions/DleEncoder.h>
#include <fsfw_hal/linux/uart/UartCookie.h>
#include <termios.h> // Contains POSIX terminal control definitions
#include <array>
#include "lwgps/lwgps.h"
#include "test/testtasks/TestTask.h"
class ScexUartReader;
class UartTestClass : public TestTask {
public:
UartTestClass(object_id_t objectId, ScexUartReader* reader);
ReturnValue_t initialize() override;
ReturnValue_t performOneShotAction() override;
ReturnValue_t performPeriodicAction() override;
private:
enum TestModes {
GPS,
// Solar Cell Experiment
SCEX
};
enum ScexModes { SIMPLE, READER_TASK } scexMode;
void gpsInit();
void gpsPeriodic();
void scexInit();
void scexPeriodic();
int prepareScexPing(uint8_t* cmdBuf, size_t* len);
TestModes mode = TestModes::GPS;
DleEncoder dleEncoder = DleEncoder();
UartCookie* uartCookie = nullptr;
size_t encodedLen = 0;
lwgps_t gpsData = {};
struct termios tty = {};
int serialPort = 0;
std::array<uint8_t, 64> cmdBuf = {};
std::array<uint8_t, 4096> recBuf = {};
uint8_t recvCnt = 0;
ScexUartReader* reader = nullptr;
};
#endif /* LINUX_BOARDTEST_UARTTESTCLASS_H_ */