1 #include "config.h" 2 3 #include "bmc_state_manager.hpp" 4 5 #include <sdbusplus/bus.hpp> 6 7 using BMCState = sdbusplus::server::xyz::openbmc_project::state::BMC; 8 main()9int main() 10 { 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 15 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; 19 20 // Add sdbusplus ObjectManager. 21 sdbusplus::server::manager_t objManager(bus, objPath); 22 23 phosphor::state::manager::BMC manager(bus, objPathInst.c_str()); 24 25 bus.request_name(BMCState::interface); 26 27 while (true) 28 { 29 bus.process_discard(); 30 bus.wait(); 31 } 32 33 exit(EXIT_SUCCESS); 34 } 35