blob: e3d23890fa6a201bb3ca9735282834f59dcf15c4 [file] [log] [blame]
Matthew Barth293477d2017-02-17 15:39:36 -06001#include <vector>
2#include <sdbusplus/bus.hpp>
Matthew Barthb8034452017-02-17 16:39:46 -06003#include "fan_enclosure.hpp"
4#include "fan_detect_defs.hpp"
5
Matthew Barth293477d2017-02-17 15:39:36 -06006
7int main(void)
8{
9 auto bus = sdbusplus::bus::new_default();
10
Matthew Barthb8034452017-02-17 16:39:46 -060011 std::vector<std::unique_ptr<phosphor::fan::presence::FanEnclosure>> fans;
12
13 for (auto const& detectMap: fanDetectMap)
14 {
15 if (detectMap.first == "tach")
16 {
17 for (auto const& fanProp: detectMap.second)
18 {
19 auto fan = std::make_unique<
20 phosphor::fan::presence::FanEnclosure>(bus,
21 fanProp);
22 // TODO Add sensors to fan object
23 fans.push_back(std::move(fan));
24 }
25 }
26 }
27
Matthew Barth293477d2017-02-17 15:39:36 -060028 while (true)
29 {
30 // Respond to dbus signals
31 bus.process_discard();
32 bus.wait();
33 }
34 return 0;
35}