IPMI set CurrentHostState property
Register an IPMI handler to receive the command from BIC
netFn: 0x38 cmd: 0x0C
BIC sends the GPIO value for host power state to BMC
On: 0x1
Off: 0x0
This handler starts the corresponding target to set
"CurrentHostState" property
On: obmc-host-startmin@$slot.target
Off: obmc-host-stop@@$slot.target
Test Case:
Set "RequestedHostTransition" property on phosphor-state-manager
to On/Off/Reboot/ForceWarmReboot and check the host status
Signed-off-by: Bonnie Lo <Bonnie_Lo@wiwynn.com>
Change-Id: I891f38d7e836238fa3ba8287df5a855cf2d9a8d9
diff --git a/include/biccommands.hpp b/include/biccommands.hpp
index e8742d1..8702380 100644
--- a/include/biccommands.hpp
+++ b/include/biccommands.hpp
@@ -4,8 +4,19 @@
CMD_OEM_BIC_INFO = 0x1,
CMD_OEM_GET_BIC_GPIO_STATE = 0x3,
CMD_OEM_SEND_POST_BUFFER_TO_BMC = 0x8,
+ CMD_OEM_SET_HOST_POWER_STATE = 0x0C,
};
const char* dbusObj = "/xyz/openbmc_project/state/boot/raw";
const char* dbusService = "xyz.openbmc_project.State.Boot.Raw";
+
+constexpr auto systemdService = "org.freedesktop.systemd1";
+constexpr auto systemdObjPath = "/org/freedesktop/systemd1";
+constexpr auto systemdInterface = "org.freedesktop.systemd1.Manager";
+
+enum class HostPowerState : uint8_t
+{
+ HOST_POWER_OFF = 0x0,
+ HOST_POWER_ON = 0x1,
+};