Refactor the platform event message handler code
This commit makes slight code change to use some functions both
in BMC requester and responder flow.
Tested : Using pldmtool platformEventMessage is sent and D-Bus
property is verified.
Change-Id: Id433f136ad4c7be0d94817deed1d6b60df36b3e4
Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
diff --git a/pldmd/pldmd.cpp b/pldmd/pldmd.cpp
index 1495db4..c99ab18 100644
--- a/pldmd/pldmd.cpp
+++ b/pldmd/pldmd.cpp
@@ -182,8 +182,8 @@
if (hostEID)
{
hostPDRHandler = std::make_unique<HostPDRHandler>(
- sockfd, hostEID, event, pdrRepo.get(), entityTree.get(),
- dbusImplReq);
+ sockfd, hostEID, event, pdrRepo.get(), EVENTS_JSONS_DIR,
+ entityTree.get(), dbusImplReq);
hostEffecterParser =
std::make_unique<pldm::host_effecters::HostEffecterParser>(
&dbusImplReq, sockfd, pdrRepo.get(), dbusHandler.get(),
@@ -201,12 +201,11 @@
// FRU table is built lazily when a FRU command or Get PDR command is
// handled. To enable building FRU table, the FRU handler is passed to the
// Platform handler.
- invoker.registerHandler(PLDM_PLATFORM, std::make_unique<platform::Handler>(
- dbusHandler.get(), PDR_JSONS_DIR,
- EVENTS_JSONS_DIR, pdrRepo.get(),
- hostPDRHandler.get(),
- dbusToPLDMEventHandler.get(),
- fruHandler.get(), true));
+ invoker.registerHandler(
+ PLDM_PLATFORM, std::make_unique<platform::Handler>(
+ dbusHandler.get(), PDR_JSONS_DIR, pdrRepo.get(),
+ hostPDRHandler.get(), dbusToPLDMEventHandler.get(),
+ fruHandler.get(), true));
invoker.registerHandler(PLDM_FRU, std::move(fruHandler));
#ifdef OEM_IBM