summaryrefslogtreecommitdiffstats
path: root/presence/gpio.hpp
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-10-19 17:29:46 -0700
committerWilliam A. Kennington III <wak@google.com>2018-10-29 15:59:03 -0700
commit1cfc2f11b13412a15f8478cebc35e50e6feb13a2 (patch)
tree05986154355a3d6c0667368c12cf34d7ad97d4cd /presence/gpio.hpp
parent5882e0c0593edaf464eea960f1ab7b2f5cd10240 (diff)
downloadphosphor-fan-presence-1cfc2f11b13412a15f8478cebc35e50e6feb13a2.zip
phosphor-fan-presence-1cfc2f11b13412a15f8478cebc35e50e6feb13a2.tar.gz
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 <wak@google.com>
Diffstat (limited to 'presence/gpio.hpp')
-rw-r--r--presence/gpio.hpp11
1 files changed, 5 insertions, 6 deletions
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 <memory>
+#include <sdeventplus/source/io.hpp>
+#include <optional>
#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<sdevent::event::io::IO> callback;
+ /** sdevent io handle. */
+ std::optional<sdeventplus::source::IO> source;
};
} // namespace presence
OpenPOWER on IntegriCloud