added loopback test mode
This commit is contained in:
parent
97a752120a
commit
7435ce903a
@ -13,6 +13,7 @@ LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId,
|
||||
sif::error << "LibgpiodTest::LibgpiodTest: Invalid Gpio interface." << std::endl;
|
||||
}
|
||||
gpioInterface->initialize(gpioCookie);
|
||||
testCase = TestCases::READ;
|
||||
}
|
||||
|
||||
LibgpiodTest::~LibgpiodTest() {
|
||||
@ -22,6 +23,8 @@ 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 "
|
||||
@ -32,6 +35,14 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() {
|
||||
sif::debug << "LibgpiodTest::performPeriodicAction: MIO 0 state = " << gpioState
|
||||
<< std::endl;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case(testCase == TestCases::LOOPBACK): {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,13 @@
|
||||
*/
|
||||
class LibgpiodTest: public TestTask {
|
||||
public:
|
||||
enum TestCases {
|
||||
READ = 0,
|
||||
LOOPBACK = 1
|
||||
};
|
||||
|
||||
TestCases testCase;
|
||||
|
||||
LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie);
|
||||
virtual ~LibgpiodTest();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user