summaryrefslogtreecommitdiffstats
path: root/bmc_state_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bmc_state_manager.cpp')
-rw-r--r--bmc_state_manager.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/bmc_state_manager.cpp b/bmc_state_manager.cpp
index 6eeec58..c739ae0 100644
--- a/bmc_state_manager.cpp
+++ b/bmc_state_manager.cpp
@@ -1,4 +1,5 @@
#include <iostream>
+#include <log.hpp>
#include "bmc_state_manager.hpp"
namespace phosphor
@@ -8,6 +9,45 @@ namespace state
namespace manager
{
+// When you see server:: you know we're referencing our base class
+namespace server = sdbusplus::xyz::openbmc_project::State::server;
+
+using namespace phosphor::logging;
+
+constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1";
+constexpr auto SYSTEMD_OBJ_PATH = "/org/freedesktop/systemd1";
+constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager";
+
+void BMC::subscribeToSystemdSignals()
+{
+ auto method = this->bus.new_method_call(SYSTEMD_SERVICE,
+ SYSTEMD_OBJ_PATH,
+ SYSTEMD_INTERFACE,
+ "Subscribe");
+ this->bus.call(method);
+
+ return;
+}
+
+BMC::Transition BMC::requestedBMCTransition(Transition value)
+{
+ log<level::INFO>(
+ "Setting the RequestedBMCTransition field",
+ entry("REQUESTED_BMC_TRANSITION=0x%s",
+ convertForMessage(value).c_str()));
+ return server::BMC::requestedBMCTransition(value);
+}
+
+BMC::BMCState BMC::currentBMCState(BMCState value)
+{
+ log<level::INFO>(
+ "Setting the BMCState field",
+ entry("CURRENT_BMC_STATE=0x%s",
+ convertForMessage(value).c_str()));
+ return server::BMC::currentBMCState(value);
+}
+
+
} // namespace manager
} // namespace state
} // namepsace phosphor
OpenPOWER on IntegriCloud