host-bmc: Process host TL PDR

Process host TL PDR and build TLPDRMap for easy lookup based on
PLDMTerminusHandle, the parsing of the host state sensors is done
after the TL PDR's are processed.

Tested:

Tested on Rainier simics and sensor event from host is handled
and the D-Bus object is updated.

Change-Id: I3b5903c4e6a071465ac84cedb9723019dc6d06fa
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Signed-off-by: Sampa Misra <sampmisr@in.ibm.com>
diff --git a/host-bmc/host_pdr_handler.hpp b/host-bmc/host_pdr_handler.hpp
index fbb206c..9377cb6 100644
--- a/host-bmc/host_pdr_handler.hpp
+++ b/host-bmc/host_pdr_handler.hpp
@@ -51,6 +51,7 @@
 };
 
 using HostStateSensorMap = std::map<SensorEntry, pdr::SensorInfo>;
+using PDRList = std::vector<std::vector<uint8_t>>;
 
 /** @class HostPDRHandler
  *  @brief This class can fetch and process PDRs from host firmware
@@ -71,6 +72,8 @@
     HostPDRHandler& operator=(HostPDRHandler&&) = delete;
     ~HostPDRHandler() = default;
 
+    using TLPDRMap = std::map<pdr::TerminusHandle, pdr::TerminusID>;
+
     /** @brief Constructor
      *  @param[in] mctp_fd - fd of MCTP communications socket
      *  @param[in] mctp_eid - MCTP EID of host firmware
@@ -112,6 +115,16 @@
         return sensorMap.at(entry);
     }
 
+    /** @brief Parse state sensor PDRs and populate the sensorMap lookup data
+     *         structure
+     *
+     *  @param[in] stateSensorPDRs - host state sensor PDRs
+     *  @param[in] tlpdrInfo - terminus locator PDRs info
+     *
+     */
+    void parseStateSensorPDRs(const PDRList& stateSensorPDRs,
+                              const TLPDRMap& tlpdrInfo);
+
   private:
     /** @brief fetchPDR schedules work on the event loop, this method does the
      *  actual work. This is so that the PDR exchg with the host is async.