blob: 92b332d2b64ee092bb8b276c1f245e0ef849d239 [file] [log] [blame]
George Liuee1c19e2021-04-01 15:02:57 +08001#include "config.h"
2
3#ifdef MONITOR_OPERATIONAL_STATUS
4#include "operational-status-monitor.hpp"
5#else
Dhruvaraj Subhashchandran59b86cd2017-04-13 00:19:44 -05006#include "fru-fault-monitor.hpp"
George Liuee1c19e2021-04-01 15:02:57 +08007#endif
Dhruvaraj Subhashchandran59b86cd2017-04-13 00:19:44 -05008
9int main(void)
10{
11 /** @brief Dbus constructs used by Fault Monitor */
Patrick Williams3e073ba2022-07-22 19:26:52 -050012 sdbusplus::bus_t bus = sdbusplus::bus::new_default();
Dhruvaraj Subhashchandran59b86cd2017-04-13 00:19:44 -050013
George Liuee1c19e2021-04-01 15:02:57 +080014#ifdef MONITOR_OPERATIONAL_STATUS
15 phosphor::led::Operational::status::monitor::Monitor monitor(bus);
16#else
Dhruvaraj Subhashchandran59b86cd2017-04-13 00:19:44 -050017 phosphor::led::fru::fault::monitor::Add monitor(bus);
George Liuee1c19e2021-04-01 15:02:57 +080018#endif
Dhruvaraj Subhashchandran59b86cd2017-04-13 00:19:44 -050019 /** @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}