added FSFW test task

This commit is contained in:
Robin Müller 2021-11-19 14:12:12 +01:00
parent cf97d690fe
commit f193608c38
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 34 additions and 0 deletions

View File

@ -2,4 +2,5 @@ target_sources(${TARGET_NAME} PRIVATE
FsfwReaderTask.cpp
FsfwExampleTask.cpp
MutexExample.cpp
FsfwTestTask.cpp
)

View File

@ -0,0 +1,12 @@
#include "FsfwTestTask.h"
FsfwTestTask::FsfwTestTask(object_id_t objectId, bool periodicEvent):
TestTask(objectId), periodicEvent(periodicEvent) {
}
ReturnValue_t FsfwTestTask::performPeriodicAction() {
if(periodicEvent) {
triggerEvent(TEST_EVENT, 0x1234, 0x4321);
}
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -0,0 +1,21 @@
#ifndef EXAMPLE_COMMON_EXAMPLE_TEST_FSFWTESTTASK_H_
#define EXAMPLE_COMMON_EXAMPLE_TEST_FSFWTESTTASK_H_
#include "fsfw_tests/integration/task/TestTask.h"
#include "fsfw/events/Event.h"
#include "events/subsystemIdRanges.h"
class FsfwTestTask: public TestTask {
public:
FsfwTestTask(object_id_t objectId, bool periodicEvent);
ReturnValue_t performPeriodicAction() override;
private:
bool periodicEvent = false;
static constexpr uint8_t subsystemId = SUBSYSTEM_ID::TEST_TASK_ID;
static constexpr Event TEST_EVENT = event::makeEvent(subsystemId, 0, severity::INFO);
};
#endif /* EXAMPLE_COMMON_EXAMPLE_TEST_FSFWTESTTASK_H_ */