Fix interface usage for OperatingSystemState
OperatingSystemState property of
xyz.openbmc_project.State.OperatingSystem.Status should be PDI enum of
type OSStatus. This commit fixes the OperatingSystemState values to
be compatible with PDI.
Tested:
Confirmed that the OperatingSystemState check returns true when the
system resets and OperatingSystemState changes to the full enum
string of "xyz...Inactive".
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
Change-Id: I8bac5456905aaecd77e44f96fccb72699a1c128b
diff --git a/service/src/mainapp.cpp b/service/src/mainapp.cpp
index 8a91dab..5560d5f 100644
--- a/service/src/mainapp.cpp
+++ b/service/src/mainapp.cpp
@@ -524,8 +524,16 @@
std::get_if<std::string>(&it->second);
if (state != nullptr)
{
+ // The short strings "BootComplete" and "Standby" are
+ // deprecated in favor of the full enum strings
+ // Support for the short strings will be removed in the
+ // future.
if (((*state == "BootComplete") ||
- (*state == "Inactive")) &&
+ (*state == "xyz.openbmc_project.State.OperatingSystem."
+ "Status.OSStatus.BootComplete") ||
+ (*state == "Inactive") ||
+ (*state == "xyz.openbmc_project.State.OperatingSystem."
+ "Status.OSStatus.Inactive")) &&
(stateTimerRunning))
{
stateTimer->cancel();