2021-03-04 18:29:28 +01:00
|
|
|
#ifndef LINUX_BOARDTEST_UARTTESTCLASS_H_
|
|
|
|
#define LINUX_BOARDTEST_UARTTESTCLASS_H_
|
|
|
|
|
2022-01-17 13:48:55 +01:00
|
|
|
#include <termios.h> // Contains POSIX terminal control definitions
|
2021-06-16 18:38:06 +02:00
|
|
|
|
|
|
|
#include <array>
|
2021-03-04 18:29:28 +01:00
|
|
|
|
2022-01-17 13:48:55 +01:00
|
|
|
#include "lwgps/lwgps.h"
|
|
|
|
#include "test/testtasks/TestTask.h"
|
2021-03-04 18:29:28 +01:00
|
|
|
|
2022-01-17 13:48:55 +01:00
|
|
|
class UartTestClass : public TestTask {
|
|
|
|
public:
|
|
|
|
UartTestClass(object_id_t objectId);
|
2021-03-04 18:29:28 +01:00
|
|
|
|
2022-01-17 13:48:55 +01:00
|
|
|
ReturnValue_t initialize() override;
|
|
|
|
ReturnValue_t performOneShotAction() override;
|
|
|
|
ReturnValue_t performPeriodicAction() override;
|
2021-06-16 18:38:06 +02:00
|
|
|
|
2022-01-17 13:48:55 +01:00
|
|
|
private:
|
2022-02-03 13:37:48 +01:00
|
|
|
enum TestModes {
|
|
|
|
GPS,
|
|
|
|
// Solar Cell Experiment
|
2022-02-04 17:48:05 +01:00
|
|
|
SCEX
|
2022-02-03 13:37:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
void gpsInit();
|
|
|
|
void gpsPeriodic();
|
2022-02-04 17:48:05 +01:00
|
|
|
|
|
|
|
void scexInit();
|
|
|
|
void scexPeriodic();
|
2022-02-03 13:37:48 +01:00
|
|
|
TestModes mode = TestModes::GPS;
|
2022-01-17 13:48:55 +01:00
|
|
|
lwgps_t gpsData = {};
|
|
|
|
struct termios tty = {};
|
|
|
|
int serialPort = 0;
|
2022-02-04 17:48:05 +01:00
|
|
|
std::array<uint8_t, 64> cmdBuf = {};
|
|
|
|
std::array<uint8_t, 4096> recBuf = {};
|
2022-01-17 13:48:55 +01:00
|
|
|
uint8_t recvCnt = 0;
|
2021-03-04 18:29:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* LINUX_BOARDTEST_UARTTESTCLASS_H_ */
|