oem-ibm: Implement SetEffecter actions corresponding to code
update actions
This commit defines the actions taken corresponding to the code
update actions.
Code update actions include- START, END, ABORT, ACCEPT and REJECT
Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com>
Change-Id: I2e86177efe4c8924069cc400b79e4fc4b8983df4
diff --git a/oem/ibm/libpldmresponder/inband_code_update.cpp b/oem/ibm/libpldmresponder/inband_code_update.cpp
index 7055c46..bb06882 100644
--- a/oem/ibm/libpldmresponder/inband_code_update.cpp
+++ b/oem/ibm/libpldmresponder/inband_code_update.cpp
@@ -13,7 +13,6 @@
#include <exception>
#include <fstream>
-
namespace pldm
{
namespace responder
@@ -96,6 +95,53 @@
return PLDM_SUCCESS;
}
+int CodeUpdate::setRequestedApplyTime()
+{
+ int rc = PLDM_SUCCESS;
+ pldm::utils::PropertyValue value =
+ "xyz.openbmc_project.Software.ApplyTime.RequestedApplyTimes.OnReset";
+ DBusMapping dbusMapping;
+ dbusMapping.objectPath = "/xyz/openbmc_project/software/apply_time";
+ dbusMapping.interface = "xyz.openbmc_project.Software.ApplyTime";
+ dbusMapping.propertyName = "RequestedApplyTime";
+ dbusMapping.propertyType = "string";
+ try
+ {
+ pldm::utils::DBusHandler().setDbusProperty(dbusMapping, value);
+ }
+ catch (const std::exception& e)
+ {
+ std::cerr << "Failed To set RequestedApplyTime property "
+ << "ERROR=" << e.what() << std::endl;
+ rc = PLDM_ERROR;
+ }
+ return rc;
+}
+
+int CodeUpdate::setRequestedActivation()
+{
+ int rc = PLDM_SUCCESS;
+ pldm::utils::PropertyValue value =
+ "xyz.openbmc_project.Software.Activation.RequestedActivations.Active";
+ DBusMapping dbusMapping;
+ dbusMapping.objectPath = newImageId;
+ dbusMapping.interface = "xyz.openbmc_project.Software.Activation";
+ dbusMapping.propertyName = "RequestedActivation";
+ dbusMapping.propertyType = "string";
+ try
+ {
+ pldm::utils::DBusHandler().setDbusProperty(dbusMapping, value);
+ }
+ catch (const std::exception& e)
+ {
+ std::cerr << "Failed To set RequestedActivation property"
+ << "ERROR=" << e.what() << std::endl;
+ rc = PLDM_ERROR;
+ }
+ newImageId.clear();
+ return rc;
+}
+
void CodeUpdate::setVersions()
{
static constexpr auto mapperService = "xyz.openbmc_project.ObjectMapper";