#include "LibgpiodTest.h" #include #include #include LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie): TestTask(objectId) { gpioInterface = objectManager->get(gpioIfobjectId); if (gpioInterface == nullptr) { sif::error << "LibgpiodTest::LibgpiodTest: Invalid Gpio interface." << std::endl; } gpioInterface->initialize(gpioCookie); testCase = TestCases::READ; } LibgpiodTest::~LibgpiodTest() { } ReturnValue_t LibgpiodTest::performPeriodicAction() { int gpioState; ReturnValue_t result; switch(testCase) { case(testCase == TestCases::READ): { result = gpioInterface->readGpio(gpioIds::Test_ID, &gpioState); if (result != RETURN_OK) { sif::debug << "LibgpiodTest::performPeriodicAction: Failed to read gpio " << std::endl; return RETURN_FAILED; } else { sif::debug << "LibgpiodTest::performPeriodicAction: MIO 0 state = " << gpioState << std::endl; } break; } case(testCase == TestCases::LOOPBACK): { } } return RETURN_OK; }