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/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index 53c1bfc..1c6b3fd 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -3,8 +3,9 @@
#include "libpldm/entity.h"
#include "libpldm/requester/pldm.h"
+#include "file_io_type_lid.hpp"
+#include "libpldmresponder/file_io.hpp"
#include "libpldmresponder/pdr_utils.hpp"
-
namespace pldm
{
namespace responder
@@ -58,6 +59,37 @@
rc = setBootSide(entityInstance, currState, stateField,
codeUpdate);
}
+ else if (entityType == PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE &&
+ stateSetId == PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE)
+ {
+ if (stateField[currState].effecter_state ==
+ uint8_t(CodeUpdateState::START))
+ {
+ codeUpdate->setCodeUpdateProgress(true);
+ rc = codeUpdate->setRequestedApplyTime();
+ }
+ else if (stateField[currState].effecter_state ==
+ uint8_t(CodeUpdateState::END))
+ {
+ codeUpdate->setCodeUpdateProgress(false);
+ }
+ else if (stateField[currState].effecter_state ==
+ uint8_t(CodeUpdateState::ABORT))
+ {
+ codeUpdate->setCodeUpdateProgress(false);
+ codeUpdate->clearDirPath(LID_STAGING_DIR);
+ }
+ else if (stateField[currState].effecter_state ==
+ uint8_t(CodeUpdateState::ACCEPT))
+ {
+ // TODO Set new Dbus property provided by code update app
+ }
+ else if (stateField[currState].effecter_state ==
+ uint8_t(CodeUpdateState::REJECT))
+ {
+ // TODO Set new Dbus property provided by code update app
+ }
+ }
else
{
rc = PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE;