blob: 922c341525ae93750d271858cc5aed8cb4ca3175 [file] [log] [blame]
Jayanth Othayoth13c57ad2021-07-16 06:02:21 -05001#include "fw_update_watch.hpp"
2
3#include <fmt/format.h>
4
5#include <phosphor-logging/elog-errors.hpp>
6#include <sdeventplus/event.hpp>
7
8int main()
9{
10 auto eventRet = 0;
11
12 try
13 {
14 auto bus = sdbusplus::bus::new_default();
15
16 auto event = sdeventplus::Event::get_default();
17
18 // create watch for interface added in software update.
19 openpower::phal::fwupdate::Watch eWatch(bus);
20
21 bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL);
22
23 // Watch for software update
24 eventRet = event.loop();
25 }
26 catch (std::exception& e)
27 {
28 using namespace phosphor::logging;
29 log<level::ERR>(
30 fmt::format("Exception reported: [{}]", e.what()).c_str());
31 }
32
33 return eventRet;
34}