Lei YU | 2f9c0cc | 2017-01-20 14:02:03 +0800 | [diff] [blame] | 1 | #include <sdbusplus/bus.hpp> |
| 2 | |
| 3 | #include "config.h" |
Lei YU | 9623282 | 2017-01-20 14:05:46 +0800 | [diff] [blame] | 4 | #include "bmc_epoch.hpp" |
Lei YU | af5abc5 | 2017-03-07 17:49:17 +0800 | [diff] [blame] | 5 | #include "host_epoch.hpp" |
Lei YU | 415b964 | 2017-02-09 11:37:26 +0800 | [diff] [blame^] | 6 | #include "manager.hpp" |
Lei YU | 2f9c0cc | 2017-01-20 14:02:03 +0800 | [diff] [blame] | 7 | |
| 8 | int main() |
| 9 | { |
| 10 | auto bus = sdbusplus::bus::new_default(); |
Lei YU | 415b964 | 2017-02-09 11:37:26 +0800 | [diff] [blame^] | 11 | |
| 12 | // Add sdbusplus ObjectManager |
| 13 | sdbusplus::server::manager::manager bmcEpochObjManager(bus, OBJPATH_BMC); |
| 14 | sdbusplus::server::manager::manager hostEpochObjManager(bus, OBJPATH_HOST); |
| 15 | |
| 16 | phosphor::time::Manager manager(bus); |
Lei YU | 9623282 | 2017-01-20 14:05:46 +0800 | [diff] [blame] | 17 | phosphor::time::BmcEpoch bmc(bus, OBJPATH_BMC); |
Lei YU | af5abc5 | 2017-03-07 17:49:17 +0800 | [diff] [blame] | 18 | phosphor::time::HostEpoch host(bus,OBJPATH_HOST); |
Lei YU | 2f9c0cc | 2017-01-20 14:02:03 +0800 | [diff] [blame] | 19 | |
Lei YU | 415b964 | 2017-02-09 11:37:26 +0800 | [diff] [blame^] | 20 | manager.addListener(&bmc); |
| 21 | manager.addListener(&host); |
| 22 | |
Lei YU | 2f9c0cc | 2017-01-20 14:02:03 +0800 | [diff] [blame] | 23 | bus.request_name(BUSNAME); |
| 24 | |
| 25 | while (true) |
| 26 | { |
| 27 | bus.process_discard(); |
| 28 | bus.wait(); |
| 29 | } |
| 30 | return 0; |
| 31 | } |