sched-host-tran: add base interfaces for Scheduled Host Transition
Implement interfaces to get/set scheduledTime and requestedTransition.
Tested:
1. Check scheduledTime
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime
t 0
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime t 1
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime
t 1
2. Check requestedTransition
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition RequestedTransition
s "xyz.openbmc_project.State.Host.Transition.On"
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition RequestedTransition \
s "xyz.openbmc_project.State.Host.Transition.Off"
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition RequestedTransition
s "xyz.openbmc_project.State.Host.Transition.Off"
Change-Id: Ie7da8034d37c1069db043772f35982ca821826ae
Signed-off-by: Carol Wang <wangkair@cn.ibm.com>
diff --git a/scheduled_host_transition.cpp b/scheduled_host_transition.cpp
new file mode 100644
index 0000000..e636579
--- /dev/null
+++ b/scheduled_host_transition.cpp
@@ -0,0 +1,20 @@
+#include "scheduled_host_transition.hpp"
+
+namespace phosphor
+{
+namespace state
+{
+namespace manager
+{
+
+using HostTransition =
+ sdbusplus::xyz::openbmc_project::State::server::ScheduledHostTransition;
+
+uint64_t ScheduledHostTransition::scheduledTime(uint64_t value)
+{
+ return HostTransition::scheduledTime(value);
+}
+
+} // namespace manager
+} // namespace state
+} // namespace phosphor