#include "gpiomanager.h" #include GpioManager::GpioManager(QObject *parent) : InputManager(parent) { } GpioManager::~GpioManager() { } bool GpioManager::init(const QVariant &pins) { if (!wiringPiSetupPhys()) return false; auto list = pins.toList(); foreach (auto pin, list) pinMode(pin.toInt(), INPUT); return true; } QVariant GpioManager::read(const QVariant &pin) { return digitalRead(pin.toInt()); }