diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2017-02-17 16:39:46 -0600 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2017-03-15 12:17:32 -0500 |
commit | b803445f7095c9b1e2ab40dc37526b15e7006393 (patch) | |
tree | f590d6b285ad1e7379a4f61dd32491758ade065e /tach_detect.cpp | |
parent | 681c98db43500d34cb93739fc97e6da05450f75c (diff) | |
download | phosphor-fan-presence-b803445f7095c9b1e2ab40dc37526b15e7006393.tar.gz phosphor-fan-presence-b803445f7095c9b1e2ab40dc37526b15e7006393.zip |
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>
Diffstat (limited to 'tach_detect.cpp')
-rw-r--r-- | tach_detect.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tach_detect.cpp b/tach_detect.cpp index 9b2ccd1..e3d2389 100644 --- a/tach_detect.cpp +++ b/tach_detect.cpp @@ -1,10 +1,30 @@ #include <vector> #include <sdbusplus/bus.hpp> +#include "fan_enclosure.hpp" +#include "fan_detect_defs.hpp" + int main(void) { auto bus = sdbusplus::bus::new_default(); + std::vector<std::unique_ptr<phosphor::fan::presence::FanEnclosure>> fans; + + for (auto const& detectMap: fanDetectMap) + { + if (detectMap.first == "tach") + { + for (auto const& fanProp: detectMap.second) + { + auto fan = std::make_unique< + phosphor::fan::presence::FanEnclosure>(bus, + fanProp); + // TODO Add sensors to fan object + fans.push_back(std::move(fan)); + } + } + } + while (true) { // Respond to dbus signals |