George Liu | ee1c19e | 2021-04-01 15:02:57 +0800 | [diff] [blame] | 1 | #include "config.h" |
| 2 | |
| 3 | #ifdef MONITOR_OPERATIONAL_STATUS |
| 4 | #include "operational-status-monitor.hpp" |
| 5 | #else |
Dhruvaraj Subhashchandran | 59b86cd | 2017-04-13 00:19:44 -0500 | [diff] [blame] | 6 | #include "fru-fault-monitor.hpp" |
George Liu | ee1c19e | 2021-04-01 15:02:57 +0800 | [diff] [blame] | 7 | #endif |
Dhruvaraj Subhashchandran | 59b86cd | 2017-04-13 00:19:44 -0500 | [diff] [blame] | 8 | |
| 9 | int main(void) |
| 10 | { |
| 11 | /** @brief Dbus constructs used by Fault Monitor */ |
Patrick Williams | 3e073ba | 2022-07-22 19:26:52 -0500 | [diff] [blame] | 12 | sdbusplus::bus_t bus = sdbusplus::bus::new_default(); |
Dhruvaraj Subhashchandran | 59b86cd | 2017-04-13 00:19:44 -0500 | [diff] [blame] | 13 | |
George Liu | ee1c19e | 2021-04-01 15:02:57 +0800 | [diff] [blame] | 14 | #ifdef MONITOR_OPERATIONAL_STATUS |
| 15 | phosphor::led::Operational::status::monitor::Monitor monitor(bus); |
| 16 | #else |
Dhruvaraj Subhashchandran | 59b86cd | 2017-04-13 00:19:44 -0500 | [diff] [blame] | 17 | phosphor::led::fru::fault::monitor::Add monitor(bus); |
George Liu | ee1c19e | 2021-04-01 15:02:57 +0800 | [diff] [blame] | 18 | #endif |
Dhruvaraj Subhashchandran | 59b86cd | 2017-04-13 00:19:44 -0500 | [diff] [blame] | 19 | /** @brief Wait for client requests */ |
| 20 | while (true) |
| 21 | { |
| 22 | /** @brief process dbus calls / signals discarding unhandled */ |
| 23 | bus.process_discard(); |
| 24 | bus.wait(); |
| 25 | } |
| 26 | return 0; |
| 27 | } |