oem ibm: marker LID validation

This commit adds code for writing marker LID
from Host and also send a PlatformEventMessage
after validation.

This commit also subscribes for the interface added
signal to fetch the new image id and sends the relevant
sensor event to host

Change-Id: I92476beca18e6dd255f372dd82d6eaeca18e282c
Signed-off-by: Sampa Misra <sampmisr@in.ibm.com>
diff --git a/oem/ibm/libpldmresponder/inband_code_update.hpp b/oem/ibm/libpldmresponder/inband_code_update.hpp
index 77ada56..77f55f1 100644
--- a/oem/ibm/libpldmresponder/inband_code_update.hpp
+++ b/oem/ibm/libpldmresponder/inband_code_update.hpp
@@ -37,6 +37,8 @@
     {
         currBootSide = Tside;
         nextBootSide = Tside;
+        markerLidSensorId = PLDM_INVALID_EFFECTER_ID;
+        firmwareUpdateSensorId = PLDM_INVALID_EFFECTER_ID;
     }
 
     /* @brief Method to return the current boot side
@@ -115,6 +117,57 @@
      */
     int setRequestedActivation();
 
+    /* @brief Method to fetch the sensor id for marker lid
+     * validation PDR
+     * @return - sensor id
+     */
+    uint16_t getMarkerLidSensor()
+    {
+        return markerLidSensorId;
+    }
+
+    /* @brief Method to set the sensor id for marker lid
+     * validation
+     * @param[in] sensorId - sensor id for marker lid validation
+     */
+    void setMarkerLidSensor(uint16_t sensorId)
+    {
+        markerLidSensorId = sensorId;
+    }
+
+    /* @brief Method to set the sensor id for firmware update state
+     * @param[in] sensorId - sensor id for firmware update state
+     */
+    void setFirmwareUpdateSensor(uint16_t sensorId)
+    {
+        firmwareUpdateSensorId = sensorId;
+    }
+
+    /* @brief Method to fetch the sensor id for firmware update state
+     * @return - sensor id
+     */
+    uint16_t getFirmwareUpdateSensor()
+    {
+        return firmwareUpdateSensorId;
+    }
+
+    /* @brief Method to send a state sensor event to Host from CodeUpdate class
+     * @param[in] sensorId - sensor id for the event
+     * @param[in] sensorEventClass - sensor event class wrt DSP0248
+     * @param[in] sensorOffset - sensor offset
+     * @param[in] eventState - new event state
+     * @param[in] prevEventState - previous state
+     */
+    void sendStateSensorEvent(uint16_t sensorId,
+                              enum sensor_event_class_states sensorEventClass,
+                              uint8_t sensorOffset, uint8_t eventState,
+                              uint8_t prevEventState);
+
+    /* @brief Method to delete the image from non running side prior to
+     * an inband code update
+     */
+    void deleteImage();
+
     virtual ~CodeUpdate()
     {}
 
@@ -135,13 +188,14 @@
                          //!< new image
     pldm::responder::oem_platform::Handler*
         oemPlatformHandler; //!< oem platform handler
+    uint16_t markerLidSensorId;
+    uint16_t firmwareUpdateSensorId;
 
     /* @brief Method to take action when the subscribed D-Bus property is
      *        changed
      * @param[in] chProperties - list of properties which have changed
      * @return - none
      */
-
     void
         processPriorityChangeNotification(const DbusChangedProps& chProperties);
 };