From 1cfc2f11b13412a15f8478cebc35e50e6feb13a2 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Fri, 19 Oct 2018 17:29:46 -0700 Subject: Switch sd_event loops to sdeventplus This change is mostly focused around plumbing the sdeventplus::Event object everywhere and using the member functions provided for the event. No migration to the timer utility is performed yet. Change-Id: I912ab82bc081239d3b7c3cf7c5caca6742ef9c87 Signed-off-by: William A. Kennington III --- presence/gpio.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'presence/gpio.hpp') diff --git a/presence/gpio.hpp b/presence/gpio.hpp index 978fdd9..2829bea 100644 --- a/presence/gpio.hpp +++ b/presence/gpio.hpp @@ -1,9 +1,8 @@ #pragma once -#include +#include +#include #include "evdevpp/evdev.hpp" -#include "sdevent/io.hpp" -#include "sdevent/source.hpp" #include "psensor.hpp" #include "utility.hpp" @@ -85,7 +84,7 @@ class Gpio : public PresenceSensor virtual RedundancyPolicy& getPolicy() = 0; /** @brief sdevent io callback. */ - void ioCallback(sdevent::source::Source& source); + void ioCallback(); /** The current state of the sensor. */ bool currentState; @@ -102,8 +101,8 @@ class Gpio : public PresenceSensor /** Gpio pin number. */ unsigned int pin; - /** sdevent io callback handle. */ - std::unique_ptr callback; + /** sdevent io handle. */ + std::optional source; }; } // namespace presence -- cgit v1.2.1