eive-obsw/test/testtasks/TestTask.h

59 lines
1.4 KiB
C
Raw Normal View History

2020-09-16 16:22:36 +02:00
#ifndef TEST_TESTTASK_H_
#define TEST_TESTTASK_H_
#include <fsfw/tasks/ExecutableObjectIF.h>
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/parameters/HasParametersIF.h>
#include <fsfw/serialize/SerialBufferAdapter.h>
#include <fsfw/serialize/SerializeElement.h>
#include <fsfw/serialize/SerialLinkedListAdapter.h>
#include <fsfw/storagemanager/StorageManagerIF.h>
#include <cstddef>
/**
* @brief Test class for general C++ testing.
* @details
* Should not be used for board specific
* tests. Instead, a derived board test class should be used.
*/
class TestTask : public SystemObject,
public ExecutableObjectIF,
public HasReturnvaluesIF {
public:
TestTask(object_id_t objectId);
virtual ~TestTask();
virtual ReturnValue_t performOperation(uint8_t operationCode = 0);
protected:
virtual ReturnValue_t performOneShotAction();
virtual ReturnValue_t performPeriodicAction();
virtual ReturnValue_t performActionA();
virtual ReturnValue_t performActionB();
enum testModes: uint8_t {
A,
B
};
testModes testMode;
bool testFlag = false;
uint8_t counter { 1 };
uint8_t counterTrigger { 3 };
void performPusInjectorTest();
void examplePacketTest();
private:
// Actually, to be really thread-safe, a mutex should be used as well
// Let's keep it simple for now.
2021-02-22 18:46:45 +01:00
bool oneShotAction = true;
2020-09-16 16:22:36 +02:00
StorageManagerIF* IPCStore;
void performLwgpsTest();
2020-09-16 16:22:36 +02:00
};
#endif /* TESTTASK_H_ */