#include "LibgpiodTest.h" #include "devices/gpioIds.h" #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); } LibgpiodTest::~LibgpiodTest() { } ReturnValue_t LibgpiodTest::performPeriodicAction() { int gpioState; ReturnValue_t result; 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; } return RETURN_OK; }