pldm_events: Implement support for state sensorEvents

PLDM supports platform event message by which events can be generated
by a PLDM entity and can be processed by event receiver like BMC. This
patch adds support for remote state sensors which sends PlatformEventMessage
command with sensorEvent type. The sensor is mapped to a D-Bus property
and the eventState is mapped to a D-Bus property value.

Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Change-Id: I50dea23eccbdf29ad1b4cf2c9ab5700d74c12c68
diff --git a/libpldmresponder/platform.hpp b/libpldmresponder/platform.hpp
index 1982031..a21502e 100644
--- a/libpldmresponder/platform.hpp
+++ b/libpldmresponder/platform.hpp
@@ -2,6 +2,7 @@
 
 #include "config.h"
 
+#include "event_parser.hpp"
 #include "handler.hpp"
 #include "host_pdr_handler.hpp"
 #include "libpldmresponder/pdr.hpp"
@@ -53,13 +54,13 @@
 class Handler : public CmdHandler
 {
   public:
-    Handler(const std::string& dir, pldm_pdr* repo,
-            HostPDRHandler* hostPDRHandler,
+    Handler(const std::string& pdrJsonsDir, const std::string& eventsJsonsDir,
+            pldm_pdr* repo, HostPDRHandler* hostPDRHandler,
             const std::optional<EventMap>& addOnHandlersMap = std::nullopt) :
         pdrRepo(repo),
-        hostPDRHandler(hostPDRHandler)
+        hostPDRHandler(hostPDRHandler), stateSensorHandler(eventsJsonsDir)
     {
-        generate(dir, pdrRepo);
+        generate(pdrJsonsDir, pdrRepo);
 
         handlers.emplace(PLDM_GET_PDR,
                          [this](const pldm_msg* request, size_t payloadLength) {
@@ -394,6 +395,7 @@
     uint16_t nextEffecterId{};
     DbusObjMaps dbusObjMaps{};
     HostPDRHandler* hostPDRHandler;
+    events::StateSensorHandler stateSensorHandler;
 };
 
 } // namespace platform