blob: b8a5adb897f91c576a837745a3374c7ed5afe562 [file] [log] [blame]
Lei YU2f9c0cc2017-01-20 14:02:03 +08001#include <sdbusplus/bus.hpp>
2
3#include "config.h"
Lei YU96232822017-01-20 14:05:46 +08004#include "bmc_epoch.hpp"
Lei YUaf5abc52017-03-07 17:49:17 +08005#include "host_epoch.hpp"
Lei YU415b9642017-02-09 11:37:26 +08006#include "manager.hpp"
Lei YU2f9c0cc2017-01-20 14:02:03 +08007
8int main()
9{
10 auto bus = sdbusplus::bus::new_default();
Lei YU415b9642017-02-09 11:37:26 +080011
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 YU96232822017-01-20 14:05:46 +080017 phosphor::time::BmcEpoch bmc(bus, OBJPATH_BMC);
Lei YUaf5abc52017-03-07 17:49:17 +080018 phosphor::time::HostEpoch host(bus,OBJPATH_HOST);
Lei YU2f9c0cc2017-01-20 14:02:03 +080019
Lei YU415b9642017-02-09 11:37:26 +080020 manager.addListener(&bmc);
21 manager.addListener(&host);
22
Lei YU2f9c0cc2017-01-20 14:02:03 +080023 bus.request_name(BUSNAME);
24
25 while (true)
26 {
27 bus.process_discard();
28 bus.wait();
29 }
30 return 0;
31}