Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 1 | #include <cstdlib> |
| 2 | #include <iostream> |
| 3 | #include <exception> |
| 4 | #include <sdbusplus/bus.hpp> |
| 5 | #include "config.h" |
| 6 | #include "host_state_manager.hpp" |
| 7 | |
| 8 | int main(int argc, char *argv[]) |
| 9 | { |
| 10 | auto bus = sdbusplus::bus::new_default(); |
| 11 | |
Andrew Geissler | 1cb8b70 | 2016-12-13 13:33:06 -0600 | [diff] [blame] | 12 | // For now, we only have one instance of the host |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 13 | auto objPathInst = std::string{HOST_OBJPATH} + '0'; |
Andrew Geissler | 1cb8b70 | 2016-12-13 13:33:06 -0600 | [diff] [blame] | 14 | |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 15 | // Add sdbusplus ObjectManager. |
Andrew Geissler | 1cb8b70 | 2016-12-13 13:33:06 -0600 | [diff] [blame] | 16 | sdbusplus::server::manager::manager objManager(bus, objPathInst.c_str()); |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 17 | |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 18 | phosphor::state::manager::Host manager(bus, |
| 19 | HOST_BUSNAME, |
| 20 | objPathInst.c_str()); |
| 21 | |
| 22 | bus.request_name(HOST_BUSNAME); |
Andrew Geissler | 3652902 | 2016-11-29 15:23:54 -0600 | [diff] [blame] | 23 | |
| 24 | while(true) |
| 25 | { |
| 26 | bus.process_discard(); |
| 27 | bus.wait(); |
| 28 | } |
| 29 | return 0; |
| 30 | } |