#ifndef LINUX_BOARDTEST_UARTTESTCLASS_H_ #define LINUX_BOARDTEST_UARTTESTCLASS_H_ #include #include #include // Contains POSIX terminal control definitions #include #include "lwgps/lwgps.h" #include "mission/devices/devicedefinitions/SCEXDefinitions.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 prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, uint8_t* cmdBuf, size_t* len); void scexSimplePeriodic(); void scexSimpleInit(); scex::ScexCmds currCmd = scex::ScexCmds::PING; 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 cmdBuf = {}; std::array recBuf = {}; uint8_t recvCnt = 0; ScexUartReader* reader = nullptr; }; #endif /* LINUX_BOARDTEST_UARTTESTCLASS_H_ */