Matthew Barth | 293477d | 2017-02-17 15:39:36 -0600 | [diff] [blame] | 1 | #include <vector> |
| 2 | #include <sdbusplus/bus.hpp> |
Matthew Barth | b803445 | 2017-02-17 16:39:46 -0600 | [diff] [blame^] | 3 | #include "fan_enclosure.hpp" |
| 4 | #include "fan_detect_defs.hpp" |
| 5 | |
Matthew Barth | 293477d | 2017-02-17 15:39:36 -0600 | [diff] [blame] | 6 | |
| 7 | int main(void) |
| 8 | { |
| 9 | auto bus = sdbusplus::bus::new_default(); |
| 10 | |
Matthew Barth | b803445 | 2017-02-17 16:39:46 -0600 | [diff] [blame^] | 11 | 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 Barth | 293477d | 2017-02-17 15:39:36 -0600 | [diff] [blame] | 28 | while (true) |
| 29 | { |
| 30 | // Respond to dbus signals |
| 31 | bus.process_discard(); |
| 32 | bus.wait(); |
| 33 | } |
| 34 | return 0; |
| 35 | } |