BMC RR : Read and update the status for BMC reset

This commit reads the status of the host owned sensors by
sending a getStateSensorReading command and then
updates the D-Bus backend for BMC reset.

This commit also updates the TLPDR from the host
based on the valid bit in the TLPDR.

Earlier the PDR record handles where assigned in an incremental order
starting from 0, now the numbering has been decided
to be within the specified range as below
BMC: 0x00000001 to 0x00FFFFFF (0x00000000 is reserved per PLDM spec)
Hostboot: 0x01000000 to 0x01FFFFFF
PHYP: 0x02000000 to 0x02FFFFFF
Reserved: 0x03000000 to 0xFFFFFFFF

This commit handles the numbering of the PDR record handles.

Tested the following scenarios on a rainier system
1. restart pldmd when Host is not running
2. restart pldmd when Host is running
3. restart pldmd when Host is not running and then ipl

Using pldmtool the DBus backened is verified.

Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
Change-Id: Idb9eb642dbf766bb587a3a4075e4dce2c9da2de5
diff --git a/host-bmc/host_pdr_handler.hpp b/host-bmc/host_pdr_handler.hpp
index 96c0226..dc539ce 100644
--- a/host-bmc/host_pdr_handler.hpp
+++ b/host-bmc/host_pdr_handler.hpp
@@ -53,6 +53,18 @@
     }
 };
 
+/* @struct TerminusLocatorInfo
+ * Contains validity, eid, terminus_id and terminus handle
+ * of a terminus locator PDR.
+ */
+struct TlInfo
+{
+    uint8_t valid;
+    uint8_t eid;
+    uint8_t tid;
+    uint16_t terminusHandle;
+};
+
 using HostStateSensorMap = std::map<SensorEntry, pdr::SensorInfo>;
 using PDRList = std::vector<std::vector<uint8_t>>;
 
@@ -155,6 +167,14 @@
      */
     void setHostState();
 
+    /** @brief set HostSensorStates when pldmd starts or restarts
+     *  and updates the D-Bus property
+     *  @param[in] stateSensorPDRs - host state sensor PDRs
+     *  @param[in] tlinfo - vector of struct TlInfo
+     */
+    void setHostSensorState(const PDRList& stateSensorPDRs,
+                            const std::vector<TlInfo>& tlinfo);
+
     /** @brief check whether Host is running when pldmd starts
      */
     bool isHostUp();