Create fan enclosure objects
For tach feedback based presence detected fans, a fan enclosure object
is created from the properties given within the yaml file.
Change-Id: I698dd7c8d05863aaaab4dcb5d4c696b15fdf941d
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/fan_enclosure.hpp b/fan_enclosure.hpp
index a94ffe7..f214f18 100644
--- a/fan_enclosure.hpp
+++ b/fan_enclosure.hpp
@@ -1,5 +1,8 @@
#pragma once
+#include <sdbusplus/bus.hpp>
+#include "fan_properties.hpp"
+
namespace phosphor
{
@@ -15,10 +18,25 @@
FanEnclosure(const FanEnclosure&) = delete;
FanEnclosure(FanEnclosure&&) = default;
FanEnclosure& operator=(const FanEnclosure&) = delete;
- FanEnclosure& operator=(FanEnclosure&&) = default;
+ FanEnclosure& operator=(FanEnclosure&&) = delete;
~FanEnclosure() = default;
+ FanEnclosure(sdbusplus::bus::bus& bus,
+ const phosphor::fan::Properties& fanProp) :
+ bus(bus),
+ invPath(std::get<0>(fanProp)),
+ fanDesc(std::get<1>(fanProp))
+ {
+ //Add this fan to inventory
+ addInventory();
+ }
+
private:
+ sdbusplus::bus::bus& bus;
+ const std::string invPath;
+ const std::string fanDesc;
+
+ void addInventory();
};