build: use phosphor-dbus-interfaces directly
Change-Id: I03c12767b554cfd90760dc17f1ce159cd2b8a962
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/Makefile.am b/Makefile.am
index baef5a6..a3ed36b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,19 +7,24 @@
phosphor_host_state_manager_SOURCES = \
host_state_manager.cpp \
- xyz.openbmc_project.State.Host.cpp \
host_state_manager_main.cpp
phosphor_chassis_state_manager_SOURCES = \
chassis_state_manager.cpp \
- xyz.openbmc_project.State.Chassis.cpp \
chassis_state_manager_main.cpp
phosphor_bmc_state_manager_SOURCES = \
bmc_state_manager.cpp \
- xyz.openbmc_project.State.BMC.cpp \
bmc_state_manager_main.cpp
-phosphor_host_state_manager_LDFLAGS = $(SYSTEMD_LIBS)
-phosphor_chassis_state_manager_LDFLAGS = $(SYSTEMD_LIBS)
-phosphor_bmc_state_manager_LDFLAGS = $(SYSTEMD_LIBS)
+generic_cxxflags = $(SYSTEMD_CFLAGS) $(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
+generic_ldflags = $(SYSTEMD_LIBS) $(PHOSPHOR_DBUS_INTERFACES_LIBS)
+
+phosphor_host_state_manager_CXXFLAGS = $(generic_cxxflags)
+phosphor_host_state_manager_LDFLAGS = $(generic_ldflags)
+
+phosphor_chassis_state_manager_CXXFLAGS = $(generic_cxxflags)
+phosphor_chassis_state_manager_LDFLAGS = $(generic_ldflags)
+
+phosphor_bmc_state_manager_CXXFLAGS = $(generic_cxxflags)
+phosphor_bmc_state_manager_LDFLAGS = $(generic_ldflags)
diff --git a/configure.ac b/configure.ac
index e976bff..e439154 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,8 @@
# Check for libraries
PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
+PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
+ AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
# Checks for typedefs, structures, and compiler characteristics.
AX_CXX_COMPILE_STDCXX_14([noext])
diff --git a/xyz.openbmc_project.State.BMC.cpp b/xyz.openbmc_project.State.BMC.cpp
deleted file mode 100644
index 6495d52..0000000
--- a/xyz.openbmc_project.State.BMC.cpp
+++ /dev/null
@@ -1,271 +0,0 @@
-#include <algorithm>
-#include <sdbusplus/server.hpp>
-#include <sdbusplus/exception.hpp>
-#include <xyz/openbmc_project/State/BMC/server.hpp>
-
-namespace sdbusplus
-{
-namespace xyz
-{
-namespace openbmc_project
-{
-namespace State
-{
-namespace server
-{
-
-BMC::BMC(bus::bus& bus, const char* path)
- : _xyz_openbmc_project_State_BMC_interface(
- bus, path, _interface, _vtable, this)
-{
-}
-
-
-
-auto BMC::requestedBMCTransition() const ->
- Transition
-{
- return _requestedBMCTransition;
-}
-
-int BMC::_callback_get_RequestedBMCTransition(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* reply, void* context,
- sd_bus_error* error)
-{
- using sdbusplus::server::binding::details::convertForMessage;
-
- try
- {
- auto m = message::message(sd_bus_message_ref(reply));
-
- auto o = static_cast<BMC*>(context);
- m.append(convertForMessage(o->requestedBMCTransition()));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-auto BMC::requestedBMCTransition(Transition value) ->
- Transition
-{
- if (_requestedBMCTransition != value)
- {
- _requestedBMCTransition = value;
- _xyz_openbmc_project_State_BMC_interface.property_changed("RequestedBMCTransition");
- }
-
- return _requestedBMCTransition;
-}
-
-int BMC::_callback_set_RequestedBMCTransition(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* value, void* context,
- sd_bus_error* error)
-{
- try
- {
- auto m = message::message(sd_bus_message_ref(value));
-
- auto o = static_cast<BMC*>(context);
-
- std::string v{};
- m.read(v);
- o->requestedBMCTransition(convertTransitionFromString(v));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-namespace details
-{
-namespace BMC
-{
-static const auto _property_RequestedBMCTransition =
- utility::tuple_to_array(message::types::type_id<
- std::string>());
-}
-}
-auto BMC::currentBMCState() const ->
- BMCState
-{
- return _currentBMCState;
-}
-
-int BMC::_callback_get_CurrentBMCState(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* reply, void* context,
- sd_bus_error* error)
-{
- using sdbusplus::server::binding::details::convertForMessage;
-
- try
- {
- auto m = message::message(sd_bus_message_ref(reply));
-
- auto o = static_cast<BMC*>(context);
- m.append(convertForMessage(o->currentBMCState()));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-auto BMC::currentBMCState(BMCState value) ->
- BMCState
-{
- if (_currentBMCState != value)
- {
- _currentBMCState = value;
- _xyz_openbmc_project_State_BMC_interface.property_changed("CurrentBMCState");
- }
-
- return _currentBMCState;
-}
-
-int BMC::_callback_set_CurrentBMCState(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* value, void* context,
- sd_bus_error* error)
-{
- try
- {
- auto m = message::message(sd_bus_message_ref(value));
-
- auto o = static_cast<BMC*>(context);
-
- std::string v{};
- m.read(v);
- o->currentBMCState(convertBMCStateFromString(v));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-namespace details
-{
-namespace BMC
-{
-static const auto _property_CurrentBMCState =
- utility::tuple_to_array(message::types::type_id<
- std::string>());
-}
-}
-
-
-namespace
-{
-/** String to enum mapping for BMC::Transition */
-static const std::tuple<const char*, BMC::Transition> mappingBMCTransition[] =
- {
- std::make_tuple( "xyz.openbmc_project.State.BMC.Transition.Reboot", BMC::Transition::Reboot ),
- std::make_tuple( "xyz.openbmc_project.State.BMC.Transition.None", BMC::Transition::None ),
- };
-
-} // anonymous namespace
-
-auto BMC::convertTransitionFromString(std::string& s) ->
- Transition
-{
- auto i = std::find_if(
- std::begin(mappingBMCTransition),
- std::end(mappingBMCTransition),
- [&s](auto& e){ return 0 == strcmp(s.c_str(), std::get<0>(e)); } );
- if (std::end(mappingBMCTransition) == i)
- {
- throw sdbusplus::exception::InvalidEnumString();
- }
- else
- {
- return std::get<1>(*i);
- }
-}
-
-std::string convertForMessage(BMC::Transition v)
-{
- auto i = std::find_if(
- std::begin(mappingBMCTransition),
- std::end(mappingBMCTransition),
- [v](auto& e){ return v == std::get<1>(e); });
- return std::get<0>(*i);
-}
-
-namespace
-{
-/** String to enum mapping for BMC::BMCState */
-static const std::tuple<const char*, BMC::BMCState> mappingBMCBMCState[] =
- {
- std::make_tuple( "xyz.openbmc_project.State.BMC.BMCState.Ready", BMC::BMCState::Ready ),
- std::make_tuple( "xyz.openbmc_project.State.BMC.BMCState.NotReady", BMC::BMCState::NotReady ),
- };
-
-} // anonymous namespace
-
-auto BMC::convertBMCStateFromString(std::string& s) ->
- BMCState
-{
- auto i = std::find_if(
- std::begin(mappingBMCBMCState),
- std::end(mappingBMCBMCState),
- [&s](auto& e){ return 0 == strcmp(s.c_str(), std::get<0>(e)); } );
- if (std::end(mappingBMCBMCState) == i)
- {
- throw sdbusplus::exception::InvalidEnumString();
- }
- else
- {
- return std::get<1>(*i);
- }
-}
-
-std::string convertForMessage(BMC::BMCState v)
-{
- auto i = std::find_if(
- std::begin(mappingBMCBMCState),
- std::end(mappingBMCBMCState),
- [v](auto& e){ return v == std::get<1>(e); });
- return std::get<0>(*i);
-}
-
-const vtable::vtable_t BMC::_vtable[] = {
- vtable::start(),
- vtable::property("RequestedBMCTransition",
- details::BMC::_property_RequestedBMCTransition
- .data(),
- _callback_get_RequestedBMCTransition,
- _callback_set_RequestedBMCTransition,
- vtable::property_::emits_change),
- vtable::property("CurrentBMCState",
- details::BMC::_property_CurrentBMCState
- .data(),
- _callback_get_CurrentBMCState,
- _callback_set_CurrentBMCState,
- vtable::property_::emits_change),
- vtable::end()
-};
-
-} // namespace server
-} // namespace State
-} // namespace openbmc_project
-} // namespace xyz
-} // namespace sdbusplus
-
diff --git a/xyz.openbmc_project.State.Chassis.cpp b/xyz.openbmc_project.State.Chassis.cpp
deleted file mode 100644
index 21c4343..0000000
--- a/xyz.openbmc_project.State.Chassis.cpp
+++ /dev/null
@@ -1,271 +0,0 @@
-#include <algorithm>
-#include <sdbusplus/server.hpp>
-#include <sdbusplus/exception.hpp>
-#include <xyz/openbmc_project/State/Chassis/server.hpp>
-
-namespace sdbusplus
-{
-namespace xyz
-{
-namespace openbmc_project
-{
-namespace State
-{
-namespace server
-{
-
-Chassis::Chassis(bus::bus& bus, const char* path)
- : _xyz_openbmc_project_State_Chassis_interface(
- bus, path, _interface, _vtable, this)
-{
-}
-
-
-
-auto Chassis::requestedPowerTransition() const ->
- Transition
-{
- return _requestedPowerTransition;
-}
-
-int Chassis::_callback_get_RequestedPowerTransition(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* reply, void* context,
- sd_bus_error* error)
-{
- using sdbusplus::server::binding::details::convertForMessage;
-
- try
- {
- auto m = message::message(sd_bus_message_ref(reply));
-
- auto o = static_cast<Chassis*>(context);
- m.append(convertForMessage(o->requestedPowerTransition()));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-auto Chassis::requestedPowerTransition(Transition value) ->
- Transition
-{
- if (_requestedPowerTransition != value)
- {
- _requestedPowerTransition = value;
- _xyz_openbmc_project_State_Chassis_interface.property_changed("RequestedPowerTransition");
- }
-
- return _requestedPowerTransition;
-}
-
-int Chassis::_callback_set_RequestedPowerTransition(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* value, void* context,
- sd_bus_error* error)
-{
- try
- {
- auto m = message::message(sd_bus_message_ref(value));
-
- auto o = static_cast<Chassis*>(context);
-
- std::string v{};
- m.read(v);
- o->requestedPowerTransition(convertTransitionFromString(v));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-namespace details
-{
-namespace Chassis
-{
-static const auto _property_RequestedPowerTransition =
- utility::tuple_to_array(message::types::type_id<
- std::string>());
-}
-}
-auto Chassis::currentPowerState() const ->
- PowerState
-{
- return _currentPowerState;
-}
-
-int Chassis::_callback_get_CurrentPowerState(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* reply, void* context,
- sd_bus_error* error)
-{
- using sdbusplus::server::binding::details::convertForMessage;
-
- try
- {
- auto m = message::message(sd_bus_message_ref(reply));
-
- auto o = static_cast<Chassis*>(context);
- m.append(convertForMessage(o->currentPowerState()));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-auto Chassis::currentPowerState(PowerState value) ->
- PowerState
-{
- if (_currentPowerState != value)
- {
- _currentPowerState = value;
- _xyz_openbmc_project_State_Chassis_interface.property_changed("CurrentPowerState");
- }
-
- return _currentPowerState;
-}
-
-int Chassis::_callback_set_CurrentPowerState(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* value, void* context,
- sd_bus_error* error)
-{
- try
- {
- auto m = message::message(sd_bus_message_ref(value));
-
- auto o = static_cast<Chassis*>(context);
-
- std::string v{};
- m.read(v);
- o->currentPowerState(convertPowerStateFromString(v));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-namespace details
-{
-namespace Chassis
-{
-static const auto _property_CurrentPowerState =
- utility::tuple_to_array(message::types::type_id<
- std::string>());
-}
-}
-
-
-namespace
-{
-/** String to enum mapping for Chassis::Transition */
-static const std::tuple<const char*, Chassis::Transition> mappingChassisTransition[] =
- {
- std::make_tuple( "xyz.openbmc_project.State.Chassis.Transition.Off", Chassis::Transition::Off ),
- std::make_tuple( "xyz.openbmc_project.State.Chassis.Transition.On", Chassis::Transition::On ),
- };
-
-} // anonymous namespace
-
-auto Chassis::convertTransitionFromString(std::string& s) ->
- Transition
-{
- auto i = std::find_if(
- std::begin(mappingChassisTransition),
- std::end(mappingChassisTransition),
- [&s](auto& e){ return 0 == strcmp(s.c_str(), std::get<0>(e)); } );
- if (std::end(mappingChassisTransition) == i)
- {
- throw sdbusplus::exception::InvalidEnumString();
- }
- else
- {
- return std::get<1>(*i);
- }
-}
-
-std::string convertForMessage(Chassis::Transition v)
-{
- auto i = std::find_if(
- std::begin(mappingChassisTransition),
- std::end(mappingChassisTransition),
- [v](auto& e){ return v == std::get<1>(e); });
- return std::get<0>(*i);
-}
-
-namespace
-{
-/** String to enum mapping for Chassis::PowerState */
-static const std::tuple<const char*, Chassis::PowerState> mappingChassisPowerState[] =
- {
- std::make_tuple( "xyz.openbmc_project.State.Chassis.PowerState.Off", Chassis::PowerState::Off ),
- std::make_tuple( "xyz.openbmc_project.State.Chassis.PowerState.On", Chassis::PowerState::On ),
- };
-
-} // anonymous namespace
-
-auto Chassis::convertPowerStateFromString(std::string& s) ->
- PowerState
-{
- auto i = std::find_if(
- std::begin(mappingChassisPowerState),
- std::end(mappingChassisPowerState),
- [&s](auto& e){ return 0 == strcmp(s.c_str(), std::get<0>(e)); } );
- if (std::end(mappingChassisPowerState) == i)
- {
- throw sdbusplus::exception::InvalidEnumString();
- }
- else
- {
- return std::get<1>(*i);
- }
-}
-
-std::string convertForMessage(Chassis::PowerState v)
-{
- auto i = std::find_if(
- std::begin(mappingChassisPowerState),
- std::end(mappingChassisPowerState),
- [v](auto& e){ return v == std::get<1>(e); });
- return std::get<0>(*i);
-}
-
-const vtable::vtable_t Chassis::_vtable[] = {
- vtable::start(),
- vtable::property("RequestedPowerTransition",
- details::Chassis::_property_RequestedPowerTransition
- .data(),
- _callback_get_RequestedPowerTransition,
- _callback_set_RequestedPowerTransition,
- vtable::property_::emits_change),
- vtable::property("CurrentPowerState",
- details::Chassis::_property_CurrentPowerState
- .data(),
- _callback_get_CurrentPowerState,
- _callback_set_CurrentPowerState,
- vtable::property_::emits_change),
- vtable::end()
-};
-
-} // namespace server
-} // namespace State
-} // namespace openbmc_project
-} // namespace xyz
-} // namespace sdbusplus
-
diff --git a/xyz.openbmc_project.State.Host.cpp b/xyz.openbmc_project.State.Host.cpp
deleted file mode 100644
index 490d171..0000000
--- a/xyz.openbmc_project.State.Host.cpp
+++ /dev/null
@@ -1,272 +0,0 @@
-#include <algorithm>
-#include <sdbusplus/server.hpp>
-#include <sdbusplus/exception.hpp>
-#include <xyz/openbmc_project/State/Host/server.hpp>
-
-namespace sdbusplus
-{
-namespace xyz
-{
-namespace openbmc_project
-{
-namespace State
-{
-namespace server
-{
-
-Host::Host(bus::bus& bus, const char* path)
- : _xyz_openbmc_project_State_Host_interface(
- bus, path, _interface, _vtable, this)
-{
-}
-
-
-
-auto Host::requestedHostTransition() const ->
- Transition
-{
- return _requestedHostTransition;
-}
-
-int Host::_callback_get_RequestedHostTransition(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* reply, void* context,
- sd_bus_error* error)
-{
- using sdbusplus::server::binding::details::convertForMessage;
-
- try
- {
- auto m = message::message(sd_bus_message_ref(reply));
-
- auto o = static_cast<Host*>(context);
- m.append(convertForMessage(o->requestedHostTransition()));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-auto Host::requestedHostTransition(Transition value) ->
- Transition
-{
- if (_requestedHostTransition != value)
- {
- _requestedHostTransition = value;
- _xyz_openbmc_project_State_Host_interface.property_changed("RequestedHostTransition");
- }
-
- return _requestedHostTransition;
-}
-
-int Host::_callback_set_RequestedHostTransition(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* value, void* context,
- sd_bus_error* error)
-{
- try
- {
- auto m = message::message(sd_bus_message_ref(value));
-
- auto o = static_cast<Host*>(context);
-
- std::string v{};
- m.read(v);
- o->requestedHostTransition(convertTransitionFromString(v));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-namespace details
-{
-namespace Host
-{
-static const auto _property_RequestedHostTransition =
- utility::tuple_to_array(message::types::type_id<
- std::string>());
-}
-}
-auto Host::currentHostState() const ->
- HostState
-{
- return _currentHostState;
-}
-
-int Host::_callback_get_CurrentHostState(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* reply, void* context,
- sd_bus_error* error)
-{
- using sdbusplus::server::binding::details::convertForMessage;
-
- try
- {
- auto m = message::message(sd_bus_message_ref(reply));
-
- auto o = static_cast<Host*>(context);
- m.append(convertForMessage(o->currentHostState()));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-auto Host::currentHostState(HostState value) ->
- HostState
-{
- if (_currentHostState != value)
- {
- _currentHostState = value;
- _xyz_openbmc_project_State_Host_interface.property_changed("CurrentHostState");
- }
-
- return _currentHostState;
-}
-
-int Host::_callback_set_CurrentHostState(
- sd_bus* bus, const char* path, const char* interface,
- const char* property, sd_bus_message* value, void* context,
- sd_bus_error* error)
-{
- try
- {
- auto m = message::message(sd_bus_message_ref(value));
-
- auto o = static_cast<Host*>(context);
-
- std::string v{};
- m.read(v);
- o->currentHostState(convertHostStateFromString(v));
- }
- catch(sdbusplus::internal_exception_t& e)
- {
- sd_bus_error_set_const(error, e.name(), e.description());
- return -EINVAL;
- }
-
- return true;
-}
-
-namespace details
-{
-namespace Host
-{
-static const auto _property_CurrentHostState =
- utility::tuple_to_array(message::types::type_id<
- std::string>());
-}
-}
-
-
-namespace
-{
-/** String to enum mapping for Host::Transition */
-static const std::tuple<const char*, Host::Transition> mappingHostTransition[] =
- {
- std::make_tuple( "xyz.openbmc_project.State.Host.Transition.Off", Host::Transition::Off ),
- std::make_tuple( "xyz.openbmc_project.State.Host.Transition.On", Host::Transition::On ),
- std::make_tuple( "xyz.openbmc_project.State.Host.Transition.Reboot", Host::Transition::Reboot ),
- };
-
-} // anonymous namespace
-
-auto Host::convertTransitionFromString(std::string& s) ->
- Transition
-{
- auto i = std::find_if(
- std::begin(mappingHostTransition),
- std::end(mappingHostTransition),
- [&s](auto& e){ return 0 == strcmp(s.c_str(), std::get<0>(e)); } );
- if (std::end(mappingHostTransition) == i)
- {
- throw sdbusplus::exception::InvalidEnumString();
- }
- else
- {
- return std::get<1>(*i);
- }
-}
-
-std::string convertForMessage(Host::Transition v)
-{
- auto i = std::find_if(
- std::begin(mappingHostTransition),
- std::end(mappingHostTransition),
- [v](auto& e){ return v == std::get<1>(e); });
- return std::get<0>(*i);
-}
-
-namespace
-{
-/** String to enum mapping for Host::HostState */
-static const std::tuple<const char*, Host::HostState> mappingHostHostState[] =
- {
- std::make_tuple( "xyz.openbmc_project.State.Host.HostState.Off", Host::HostState::Off ),
- std::make_tuple( "xyz.openbmc_project.State.Host.HostState.Running", Host::HostState::Running ),
- };
-
-} // anonymous namespace
-
-auto Host::convertHostStateFromString(std::string& s) ->
- HostState
-{
- auto i = std::find_if(
- std::begin(mappingHostHostState),
- std::end(mappingHostHostState),
- [&s](auto& e){ return 0 == strcmp(s.c_str(), std::get<0>(e)); } );
- if (std::end(mappingHostHostState) == i)
- {
- throw sdbusplus::exception::InvalidEnumString();
- }
- else
- {
- return std::get<1>(*i);
- }
-}
-
-std::string convertForMessage(Host::HostState v)
-{
- auto i = std::find_if(
- std::begin(mappingHostHostState),
- std::end(mappingHostHostState),
- [v](auto& e){ return v == std::get<1>(e); });
- return std::get<0>(*i);
-}
-
-const vtable::vtable_t Host::_vtable[] = {
- vtable::start(),
- vtable::property("RequestedHostTransition",
- details::Host::_property_RequestedHostTransition
- .data(),
- _callback_get_RequestedHostTransition,
- _callback_set_RequestedHostTransition,
- vtable::property_::emits_change),
- vtable::property("CurrentHostState",
- details::Host::_property_CurrentHostState
- .data(),
- _callback_get_CurrentHostState,
- _callback_set_CurrentHostState,
- vtable::property_::emits_change),
- vtable::end()
-};
-
-} // namespace server
-} // namespace State
-} // namespace openbmc_project
-} // namespace xyz
-} // namespace sdbusplus
-
diff --git a/xyz/openbmc_project/State/BMC/server.hpp b/xyz/openbmc_project/State/BMC/server.hpp
deleted file mode 100644
index b66fbf2..0000000
--- a/xyz/openbmc_project/State/BMC/server.hpp
+++ /dev/null
@@ -1,132 +0,0 @@
-#pragma once
-#include <tuple>
-#include <systemd/sd-bus.h>
-#include <sdbusplus/server.hpp>
-
-namespace sdbusplus
-{
-namespace xyz
-{
-namespace openbmc_project
-{
-namespace State
-{
-namespace server
-{
-
-class BMC
-{
- public:
- /* Define all of the basic class operations:
- * Not allowed:
- * - Default constructor to avoid nullptrs.
- * - Copy operations due to internal unique_ptr.
- * - Move operations due to 'this' being registered as the
- * 'context' with sdbus.
- * Allowed:
- * - Destructor.
- */
- BMC() = delete;
- BMC(const BMC&) = delete;
- BMC& operator=(const BMC&) = delete;
- BMC(BMC&&) = delete;
- BMC& operator=(BMC&&) = delete;
- virtual ~BMC() = default;
-
- /** @brief Constructor to put object onto bus at a dbus path.
- * @param[in] bus - Bus to attach to.
- * @param[in] path - Path to attach at.
- */
- BMC(bus::bus& bus, const char* path);
-
- enum class Transition
- {
- Reboot,
- None,
- };
- enum class BMCState
- {
- Ready,
- NotReady,
- };
-
-
-
- /** Get value of RequestedBMCTransition */
- virtual Transition requestedBMCTransition() const;
- /** Set value of RequestedBMCTransition */
- virtual Transition requestedBMCTransition(Transition value);
- /** Get value of CurrentBMCState */
- virtual BMCState currentBMCState() const;
- /** Set value of CurrentBMCState */
- virtual BMCState currentBMCState(BMCState value);
-
- /** @brief Convert a string to an appropriate enum value.
- * @param[in] s - The string to convert in the form of
- * "xyz.openbmc_project.State.BMC.<value name>"
- * @return - The enum value.
- */
- static Transition convertTransitionFromString(std::string& s);
- /** @brief Convert a string to an appropriate enum value.
- * @param[in] s - The string to convert in the form of
- * "xyz.openbmc_project.State.BMC.<value name>"
- * @return - The enum value.
- */
- static BMCState convertBMCStateFromString(std::string& s);
-
- private:
-
- /** @brief sd-bus callback for get-property 'RequestedBMCTransition' */
- static int _callback_get_RequestedBMCTransition(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
- /** @brief sd-bus callback for set-property 'RequestedBMCTransition' */
- static int _callback_set_RequestedBMCTransition(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
-
- /** @brief sd-bus callback for get-property 'CurrentBMCState' */
- static int _callback_get_CurrentBMCState(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
- /** @brief sd-bus callback for set-property 'CurrentBMCState' */
- static int _callback_set_CurrentBMCState(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
-
-
- static constexpr auto _interface = "xyz.openbmc_project.State.BMC";
- static const vtable::vtable_t _vtable[];
- sdbusplus::server::interface::interface
- _xyz_openbmc_project_State_BMC_interface;
-
- Transition _requestedBMCTransition = Transition::None;
- BMCState _currentBMCState{};
-
-};
-
-/* Specialization of sdbusplus::server::bindings::details::convertForMessage
- * for enum-type BMC::Transition.
- *
- * This converts from the enum to a constant c-string representing the enum.
- *
- * @param[in] e - Enum value to convert.
- * @return C-string representing the name for the enum value.
- */
-std::string convertForMessage(BMC::Transition e);
-/* Specialization of sdbusplus::server::bindings::details::convertForMessage
- * for enum-type BMC::BMCState.
- *
- * This converts from the enum to a constant c-string representing the enum.
- *
- * @param[in] e - Enum value to convert.
- * @return C-string representing the name for the enum value.
- */
-std::string convertForMessage(BMC::BMCState e);
-
-} // namespace server
-} // namespace State
-} // namespace openbmc_project
-} // namespace xyz
-} // namespace sdbusplus
-
diff --git a/xyz/openbmc_project/State/Chassis/server.hpp b/xyz/openbmc_project/State/Chassis/server.hpp
deleted file mode 100644
index b823b7f..0000000
--- a/xyz/openbmc_project/State/Chassis/server.hpp
+++ /dev/null
@@ -1,132 +0,0 @@
-#pragma once
-#include <tuple>
-#include <systemd/sd-bus.h>
-#include <sdbusplus/server.hpp>
-
-namespace sdbusplus
-{
-namespace xyz
-{
-namespace openbmc_project
-{
-namespace State
-{
-namespace server
-{
-
-class Chassis
-{
- public:
- /* Define all of the basic class operations:
- * Not allowed:
- * - Default constructor to avoid nullptrs.
- * - Copy operations due to internal unique_ptr.
- * - Move operations due to 'this' being registered as the
- * 'context' with sdbus.
- * Allowed:
- * - Destructor.
- */
- Chassis() = delete;
- Chassis(const Chassis&) = delete;
- Chassis& operator=(const Chassis&) = delete;
- Chassis(Chassis&&) = delete;
- Chassis& operator=(Chassis&&) = delete;
- virtual ~Chassis() = default;
-
- /** @brief Constructor to put object onto bus at a dbus path.
- * @param[in] bus - Bus to attach to.
- * @param[in] path - Path to attach at.
- */
- Chassis(bus::bus& bus, const char* path);
-
- enum class Transition
- {
- Off,
- On,
- };
- enum class PowerState
- {
- Off,
- On,
- };
-
-
-
- /** Get value of RequestedPowerTransition */
- virtual Transition requestedPowerTransition() const;
- /** Set value of RequestedPowerTransition */
- virtual Transition requestedPowerTransition(Transition value);
- /** Get value of CurrentPowerState */
- virtual PowerState currentPowerState() const;
- /** Set value of CurrentPowerState */
- virtual PowerState currentPowerState(PowerState value);
-
- /** @brief Convert a string to an appropriate enum value.
- * @param[in] s - The string to convert in the form of
- * "xyz.openbmc_project.State.Chassis.<value name>"
- * @return - The enum value.
- */
- static Transition convertTransitionFromString(std::string& s);
- /** @brief Convert a string to an appropriate enum value.
- * @param[in] s - The string to convert in the form of
- * "xyz.openbmc_project.State.Chassis.<value name>"
- * @return - The enum value.
- */
- static PowerState convertPowerStateFromString(std::string& s);
-
- private:
-
- /** @brief sd-bus callback for get-property 'RequestedPowerTransition' */
- static int _callback_get_RequestedPowerTransition(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
- /** @brief sd-bus callback for set-property 'RequestedPowerTransition' */
- static int _callback_set_RequestedPowerTransition(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
-
- /** @brief sd-bus callback for get-property 'CurrentPowerState' */
- static int _callback_get_CurrentPowerState(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
- /** @brief sd-bus callback for set-property 'CurrentPowerState' */
- static int _callback_set_CurrentPowerState(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
-
-
- static constexpr auto _interface = "xyz.openbmc_project.State.Chassis";
- static const vtable::vtable_t _vtable[];
- sdbusplus::server::interface::interface
- _xyz_openbmc_project_State_Chassis_interface;
-
- Transition _requestedPowerTransition = Transition::Off;
- PowerState _currentPowerState{};
-
-};
-
-/* Specialization of sdbusplus::server::bindings::details::convertForMessage
- * for enum-type Chassis::Transition.
- *
- * This converts from the enum to a constant c-string representing the enum.
- *
- * @param[in] e - Enum value to convert.
- * @return C-string representing the name for the enum value.
- */
-std::string convertForMessage(Chassis::Transition e);
-/* Specialization of sdbusplus::server::bindings::details::convertForMessage
- * for enum-type Chassis::PowerState.
- *
- * This converts from the enum to a constant c-string representing the enum.
- *
- * @param[in] e - Enum value to convert.
- * @return C-string representing the name for the enum value.
- */
-std::string convertForMessage(Chassis::PowerState e);
-
-} // namespace server
-} // namespace State
-} // namespace openbmc_project
-} // namespace xyz
-} // namespace sdbusplus
-
diff --git a/xyz/openbmc_project/State/Host/server.hpp b/xyz/openbmc_project/State/Host/server.hpp
deleted file mode 100644
index 149baa0..0000000
--- a/xyz/openbmc_project/State/Host/server.hpp
+++ /dev/null
@@ -1,133 +0,0 @@
-#pragma once
-#include <tuple>
-#include <systemd/sd-bus.h>
-#include <sdbusplus/server.hpp>
-
-namespace sdbusplus
-{
-namespace xyz
-{
-namespace openbmc_project
-{
-namespace State
-{
-namespace server
-{
-
-class Host
-{
- public:
- /* Define all of the basic class operations:
- * Not allowed:
- * - Default constructor to avoid nullptrs.
- * - Copy operations due to internal unique_ptr.
- * - Move operations due to 'this' being registered as the
- * 'context' with sdbus.
- * Allowed:
- * - Destructor.
- */
- Host() = delete;
- Host(const Host&) = delete;
- Host& operator=(const Host&) = delete;
- Host(Host&&) = delete;
- Host& operator=(Host&&) = delete;
- virtual ~Host() = default;
-
- /** @brief Constructor to put object onto bus at a dbus path.
- * @param[in] bus - Bus to attach to.
- * @param[in] path - Path to attach at.
- */
- Host(bus::bus& bus, const char* path);
-
- enum class Transition
- {
- Off,
- On,
- Reboot,
- };
- enum class HostState
- {
- Off,
- Running,
- };
-
-
-
- /** Get value of RequestedHostTransition */
- virtual Transition requestedHostTransition() const;
- /** Set value of RequestedHostTransition */
- virtual Transition requestedHostTransition(Transition value);
- /** Get value of CurrentHostState */
- virtual HostState currentHostState() const;
- /** Set value of CurrentHostState */
- virtual HostState currentHostState(HostState value);
-
- /** @brief Convert a string to an appropriate enum value.
- * @param[in] s - The string to convert in the form of
- * "xyz.openbmc_project.State.Host.<value name>"
- * @return - The enum value.
- */
- static Transition convertTransitionFromString(std::string& s);
- /** @brief Convert a string to an appropriate enum value.
- * @param[in] s - The string to convert in the form of
- * "xyz.openbmc_project.State.Host.<value name>"
- * @return - The enum value.
- */
- static HostState convertHostStateFromString(std::string& s);
-
- private:
-
- /** @brief sd-bus callback for get-property 'RequestedHostTransition' */
- static int _callback_get_RequestedHostTransition(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
- /** @brief sd-bus callback for set-property 'RequestedHostTransition' */
- static int _callback_set_RequestedHostTransition(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
-
- /** @brief sd-bus callback for get-property 'CurrentHostState' */
- static int _callback_get_CurrentHostState(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
- /** @brief sd-bus callback for set-property 'CurrentHostState' */
- static int _callback_set_CurrentHostState(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
-
-
- static constexpr auto _interface = "xyz.openbmc_project.State.Host";
- static const vtable::vtable_t _vtable[];
- sdbusplus::server::interface::interface
- _xyz_openbmc_project_State_Host_interface;
-
- Transition _requestedHostTransition = Transition::Off;
- HostState _currentHostState{};
-
-};
-
-/* Specialization of sdbusplus::server::bindings::details::convertForMessage
- * for enum-type Host::Transition.
- *
- * This converts from the enum to a constant c-string representing the enum.
- *
- * @param[in] e - Enum value to convert.
- * @return C-string representing the name for the enum value.
- */
-std::string convertForMessage(Host::Transition e);
-/* Specialization of sdbusplus::server::bindings::details::convertForMessage
- * for enum-type Host::HostState.
- *
- * This converts from the enum to a constant c-string representing the enum.
- *
- * @param[in] e - Enum value to convert.
- * @return C-string representing the name for the enum value.
- */
-std::string convertForMessage(Host::HostState e);
-
-} // namespace server
-} // namespace State
-} // namespace openbmc_project
-} // namespace xyz
-} // namespace sdbusplus
-