blob: 2b34ea859b101b03478e923471508d10e7cb087a [file] [log] [blame]
Josh D. Kingbdd9cb72016-12-19 11:13:43 -06001#include "config.h"
Andrew Geisslere426b582020-05-28 12:40:55 -05002
Josh D. Kingbdd9cb72016-12-19 11:13:43 -06003#include "bmc_state_manager.hpp"
4
Andrew Geisslere426b582020-05-28 12:40:55 -05005#include <sdbusplus/bus.hpp>
6
Amithash Prasasdf566c962024-07-22 20:28:42 -07007using BMCState = sdbusplus::server::xyz::openbmc_project::state::BMC;
8
Andrew Geissler769a62f2019-12-06 13:36:08 -06009int main()
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060010{
11 auto bus = sdbusplus::bus::new_default();
12
13 // For now, we only have one instance of the BMC
14 // 0 is for the current instance
Amithash Prasasdf566c962024-07-22 20:28:42 -070015 const auto* BMCName = BMCState::namespace_path::bmc;
16 const auto* objPath = BMCState::namespace_path::value;
17 std::string objPathInst =
18 sdbusplus::message::object_path(objPath) / BMCName;
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060019
20 // Add sdbusplus ObjectManager.
Amithash Prasasd2eb60292024-08-13 19:19:07 -070021 sdbusplus::server::manager_t objManager(bus, objPath);
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060022
Andrew Geissler58a18012018-01-19 19:36:05 -080023 phosphor::state::manager::BMC manager(bus, objPathInst.c_str());
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060024
Amithash Prasasdf566c962024-07-22 20:28:42 -070025 bus.request_name(BMCState::interface);
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060026
Andrew Geissler58a18012018-01-19 19:36:05 -080027 while (true)
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060028 {
29 bus.process_discard();
30 bus.wait();
31 }
32
33 exit(EXIT_SUCCESS);
Josh D. Kingbdd9cb72016-12-19 11:13:43 -060034}