Add Fan Redundancy Support
This adds fan redundancy support to passive sensors.
If there are redundancy interfaces on dbus, we'll fail
a sensor if the status is set to failed.
Tested: Set Redundancy to Failed On Dbus, saw all fans
in collection boost. Then restarted swampd, came up
and still boosted. Set redundancy OK, and they all slowed
down.
Change-Id: I8879bef1471bbc168435d6b22dd20006b9dca133
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/dbus/dbuspassive.hpp b/dbus/dbuspassive.hpp
index ebc831d..f00a2ea 100644
--- a/dbus/dbuspassive.hpp
+++ b/dbus/dbuspassive.hpp
@@ -1,6 +1,7 @@
#pragma once
#include "conf.hpp"
+#include "dbuspassiveredundancy.hpp"
#include "interfaces.hpp"
#include "util.hpp"
@@ -34,14 +35,17 @@
class DbusPassive : public ReadInterface
{
public:
- static std::unique_ptr<ReadInterface>
- createDbusPassive(sdbusplus::bus::bus& bus, const std::string& type,
- const std::string& id, DbusHelperInterface* helper,
- const conf::SensorConfig* info);
+ static std::unique_ptr<ReadInterface> createDbusPassive(
+ sdbusplus::bus::bus& bus, const std::string& type,
+ const std::string& id, DbusHelperInterface* helper,
+ const conf::SensorConfig* info,
+ const std::shared_ptr<DbusPassiveRedundancy>& redundancy);
DbusPassive(sdbusplus::bus::bus& bus, const std::string& type,
const std::string& id, DbusHelperInterface* helper,
- const struct SensorProperties& settings, bool failed);
+ const struct SensorProperties& settings, bool failed,
+ const std::string& path,
+ const std::shared_ptr<DbusPassiveRedundancy>& redundancy);
ReadReturn read(void) override;
bool getFailed(void) const override;
@@ -65,6 +69,9 @@
double _max = 0;
double _min = 0;
bool _failed = false;
+
+ std::string path;
+ std::shared_ptr<DbusPassiveRedundancy> redundancy;
/* The last time the value was refreshed, not necessarily changed. */
std::chrono::high_resolution_clock::time_point _updated;
};