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/meson.build b/meson.build
index f4eb4bb..5359c5e 100644
--- a/meson.build
+++ b/meson.build
@@ -31,6 +31,8 @@
'POH_COUNTER_PERSIST_PATH', get_option('poh-counter-persist-path'))
conf.set_quoted(
'CHASSIS_STATE_CHANGE_PERSIST_PATH', get_option('chassis-state-change-persist-path'))
+conf.set_quoted(
+ 'SCHEDULED_HOST_TRANSITION_BUSNAME', get_option('scheduled-host-transition-busname'))
conf.set(
'BOOT_COUNT_MAX_ALLOWED', get_option('boot-count-max-allowed'))
conf.set(
@@ -109,6 +111,16 @@
install: true
)
+executable('phosphor-scheduled-host-transition',
+ 'scheduled_host_transition_main.cpp',
+ 'scheduled_host_transition.cpp',
+ dependencies: [
+ sdbusplus, sdeventplus, phosphorlogging
+ ],
+ implicit_include_directories: true,
+ install: true
+)
+
install_data('obmcutil',
install_mode: 'rwxr-xr-x',
install_dir: get_option('bindir')