restructured objectfactory and init_mission for libgpio test on te0720
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
LibgpioTest.cpp
|
||||
LibgpiodTest.cpp
|
||||
TestTask.cpp
|
||||
)
|
||||
|
||||
|
@ -1,33 +1,34 @@
|
||||
#include "LibgpioTest.h"
|
||||
#include "LibgpiodTest.h"
|
||||
|
||||
#include "devices/gpioIds.h"
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||
|
||||
LibgpioTest::LibgpioTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie) :
|
||||
LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie) :
|
||||
TestTask(objectId) {
|
||||
|
||||
gpioInterface = objectManager->get<GpioIF>(gpioIfobjectId);
|
||||
if (gpioInterface == nullptr) {
|
||||
sif::error << "LibgpioTest::LibgpioTest: Invalid Gpio interface." << std::endl;
|
||||
sif::error << "LibgpiodTest::LibgpiodTest: Invalid Gpio interface." << std::endl;
|
||||
}
|
||||
gpioInterface->initialize(gpioCookie);
|
||||
}
|
||||
|
||||
LibgpioTest::~LibgpioTest() {
|
||||
LibgpiodTest::~LibgpiodTest() {
|
||||
}
|
||||
|
||||
ReturnValue_t LibgpioTest::performPeriodicAction() {
|
||||
ReturnValue_t LibgpiodTest::performPeriodicAction() {
|
||||
int gpioState;
|
||||
ReturnValue_t result;
|
||||
|
||||
result = gpioInterface->readGpio(gpioIds::Test_ID, &gpioState);
|
||||
if (result != RETURN_OK) {
|
||||
sif::debug << "LibgpioTest::performPeriodicAction: Failed to read gpio "
|
||||
sif::debug << "LibgpiodTest::performPeriodicAction: Failed to read gpio "
|
||||
<< std::endl;
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
else {
|
||||
sif::debug << "LibgpioTest::performPeriodicAction: MIO 0 state = " << gpioState
|
||||
sif::debug << "LibgpiodTest::performPeriodicAction: MIO 0 state = " << gpioState
|
||||
<< std::endl;
|
||||
}
|
||||
return RETURN_OK;
|
@ -1,5 +1,5 @@
|
||||
#ifndef TEST_TESTTASKS_LIBGPIOTEST_H_
|
||||
#define TEST_TESTTASKS_LIBGPIOTEST_H_
|
||||
#ifndef TEST_TESTTASKS_LIBGPIODTEST_H_
|
||||
#define TEST_TESTTASKS_LIBGPIODTEST_H_
|
||||
|
||||
#include "TestTask.h"
|
||||
#include "GpioIF.h"
|
||||
@ -10,10 +10,10 @@
|
||||
* @brief Test for the GPIO read implementation of the LinuxLibgpioIF.
|
||||
* @author J. Meier
|
||||
*/
|
||||
class LibgpioTest: public TestTask {
|
||||
class LibgpiodTest: public TestTask {
|
||||
public:
|
||||
LibgpioTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie);
|
||||
virtual ~LibgpioTest();
|
||||
LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie);
|
||||
virtual ~LibgpiodTest();
|
||||
|
||||
protected:
|
||||
virtual ReturnValue_t performPeriodicAction() override;
|
||||
@ -22,4 +22,4 @@ private:
|
||||
GpioIF* gpioInterface;
|
||||
};
|
||||
|
||||
#endif /* TEST_TESTTASKS_LIBGPIOTEST_H_ */
|
||||
#endif /* TEST_TESTTASKS_LIBGPIODTEST_H_ */
|
Reference in New Issue
Block a user