eive-obsw/linux/boardtest/UartTestClass.h
Robin Mueller 398277ca08
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
EIVE/eive-obsw/pipeline/head This commit looks good
this fixes SCEX ping for RPi
2022-02-22 20:13:16 +01:00

45 lines
1023 B
C++

#ifndef LINUX_BOARDTEST_UARTTESTCLASS_H_
#define LINUX_BOARDTEST_UARTTESTCLASS_H_
#include <fsfw/globalfunctions/DleEncoder.h>
#include <termios.h> // Contains POSIX terminal control definitions
#include <array>
#include "lwgps/lwgps.h"
#include "test/testtasks/TestTask.h"
class UartTestClass : public TestTask {
public:
UartTestClass(object_id_t objectId);
ReturnValue_t initialize() override;
ReturnValue_t performOneShotAction() override;
ReturnValue_t performPeriodicAction() override;
private:
enum TestModes {
GPS,
// Solar Cell Experiment
SCEX
};
void gpsInit();
void gpsPeriodic();
void scexInit();
void scexPeriodic();
int prepareScexPing();
TestModes mode = TestModes::GPS;
DleEncoder dleEncoder = DleEncoder();
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;
};
#endif /* LINUX_BOARDTEST_UARTTESTCLASS_H_ */