Update GPIO API #76

Merged
meierj merged 3 commits from mueller/update-gpio-api into eive/develop 2022-05-04 14:03:29 +02:00
2 changed files with 4 additions and 3 deletions
Showing only changes of commit 8ee26f81f9 - Show all commits

View File

@ -301,8 +301,7 @@ ReturnValue_t LinuxLibgpioIF::readGpio(gpioId_t gpioId, gpio::Levels& gpioState)
}
gpioState = static_cast<gpio::Levels>(gpiod_line_get_value(regularGpio->lineHandle));
if (gpioState == gpio::Levels::FAILED) {
// TODO: Print error
return RETURN_FAILED;
return GPIO_GET_VALUE_FAILED;
}
} else {
auto gpioCallback = dynamic_cast<GpioCallback*>(gpioMapIter->second);

View File

@ -31,7 +31,9 @@ class LinuxLibgpioIF : public GpioIF, public SystemObject {
HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 5);
static constexpr ReturnValue_t GPIO_INIT_FAILED =
HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 6);
// Will be returned if getting the line value failed. Error type will be set to errno in this case
static constexpr ReturnValue_t GPIO_GET_VALUE_FAILED =
HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 7);
LinuxLibgpioIF(object_id_t objectId);
virtual ~LinuxLibgpioIF();