diff options
-rw-r--r-- | presence/fallback.cpp | 2 | ||||
-rw-r--r-- | presence/fallback.hpp | 3 | ||||
-rw-r--r-- | presence/gpio.cpp | 2 | ||||
-rw-r--r-- | presence/rpolicy.hpp | 5 | ||||
-rw-r--r-- | presence/tach.cpp | 2 |
5 files changed, 9 insertions, 5 deletions
diff --git a/presence/fallback.cpp b/presence/fallback.cpp index 625d74a..7550c34 100644 --- a/presence/fallback.cpp +++ b/presence/fallback.cpp @@ -26,7 +26,7 @@ namespace fan namespace presence { -void Fallback::stateChanged(bool present) +void Fallback::stateChanged(bool present, PresenceSensor& sensor) { if (!present) { diff --git a/presence/fallback.hpp b/presence/fallback.hpp index a1a5b29..280ef1c 100644 --- a/presence/fallback.hpp +++ b/presence/fallback.hpp @@ -55,8 +55,9 @@ class Fallback : public RedundancyPolicy * * @param[in] present - The new presence state according * to the active sensor. + * @param[in] sensor - The sensor that changed state. */ - void stateChanged(bool present) override; + void stateChanged(bool present, PresenceSensor& sensor) override; /** * @brief monitor diff --git a/presence/gpio.cpp b/presence/gpio.cpp index dfd72db..28db46e 100644 --- a/presence/gpio.cpp +++ b/presence/gpio.cpp @@ -89,7 +89,7 @@ void Gpio::ioCallback(sdevent::source::Source& source) if (currentState != newState) { - getPolicy().stateChanged(newState); + getPolicy().stateChanged(newState, *this); currentState = newState; } } diff --git a/presence/rpolicy.hpp b/presence/rpolicy.hpp index 34beb77..8f7db3e 100644 --- a/presence/rpolicy.hpp +++ b/presence/rpolicy.hpp @@ -9,6 +9,8 @@ namespace fan namespace presence { +class PresenceSensor; + /** * @class RedundancyPolicy * @brief Redundancy policy interface. @@ -44,8 +46,9 @@ class RedundancyPolicy * the inventory and execute their policy logic. * * @param[in] present - The new state of the sensor. + * @param[in] sensor - The sensor that changed state. */ - virtual void stateChanged(bool present) = 0; + virtual void stateChanged(bool present, PresenceSensor& sensor) = 0; /** * @brief monitor diff --git a/presence/tach.cpp b/presence/tach.cpp index deed040..0d96ce5 100644 --- a/presence/tach.cpp +++ b/presence/tach.cpp @@ -137,7 +137,7 @@ void Tach::propertiesChanged( if (currentState != newState) { - getPolicy().stateChanged(newState); + getPolicy().stateChanged(newState, *this); currentState = newState; } } |