1 #include <cstdlib>
2 #include <exception>
3 #include <sdbusplus/bus.hpp>
4 #include "config.h"
5 #include "scheduled_host_transition.hpp"
6 
7 int main()
8 {
9     // Get a default event loop
10     auto event = sdeventplus::Event::get_default();
11 
12     // Get a handle to system dbus
13     auto bus = sdbusplus::bus::new_default();
14 
15     // For now, we only have one instance of the host
16     auto objPathInst = std::string{HOST_OBJPATH} + '0';
17 
18     // Add sdbusplus ObjectManager.
19     sdbusplus::server::manager::manager objManager(bus, objPathInst.c_str());
20 
21     phosphor::state::manager::ScheduledHostTransition manager(
22         bus, objPathInst.c_str(), event);
23 
24     bus.request_name(SCHEDULED_HOST_TRANSITION_BUSNAME);
25 
26     // Attach the bus to sd_event to service user requests
27     bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL);
28     event.loop();
29 
30     return 0;
31 }
32