Reorganize the setEventReceiver code
This commit is to re-organise the code to make the
setEventReceiver optional when GetTID gets called.
Currently, it is being called on every GetTID command.
This is and OEM behaviour, which was implemented at -
https://gerrit.openbmc.org/c/openbmc/pldm/+/41779/36
Also, setEventReceiver is a command defined in the platform
Spec, so rightfully placing it under the platform handler.
Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com>
Change-Id: Ib60e9d46a8eaf4806c5ec2e9575f4e219bc80eab
diff --git a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
index 0c2b02a..6ef74b7 100644
--- a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
@@ -30,8 +30,9 @@
auto outPDRRepo = pldm_pdr_init();
Repo outRepo(outPDRRepo);
auto event = sdeventplus::Event::get_default();
- Handler handler(&mockedUtils, "./pdr_jsons/state_effecter/good", inPDRRepo,
- nullptr, nullptr, nullptr, nullptr, event);
+ Handler handler(&mockedUtils, 0, nullptr, "./pdr_jsons/state_effecter/good",
+ inPDRRepo, nullptr, nullptr, nullptr, nullptr, nullptr,
+ event);
Repo inRepo(inPDRRepo);
getRepoByType(inRepo, outRepo, PLDM_STATE_EFFECTER_PDR);
@@ -130,8 +131,9 @@
auto outPDRRepo = pldm_pdr_init();
Repo outRepo(outPDRRepo);
auto event = sdeventplus::Event::get_default();
- Handler handler(&mockedUtils, "./pdr_jsons/state_effecter/good", inPDRRepo,
- nullptr, nullptr, nullptr, nullptr, event);
+ Handler handler(&mockedUtils, 0, nullptr, "./pdr_jsons/state_effecter/good",
+ inPDRRepo, nullptr, nullptr, nullptr, nullptr, nullptr,
+ event);
Repo inRepo(inPDRRepo);
getRepoByType(inRepo, outRepo, PLDM_NUMERIC_EFFECTER_PDR);
@@ -177,8 +179,9 @@
auto outPDRRepo = pldm_pdr_init();
Repo outRepo(outPDRRepo);
auto event = sdeventplus::Event::get_default();
- Handler handler(&mockedUtils, "./pdr_jsons/state_effecter/good", inPDRRepo,
- nullptr, nullptr, nullptr, nullptr, event);
+ Handler handler(&mockedUtils, 0, nullptr, "./pdr_jsons/state_effecter/good",
+ inPDRRepo, nullptr, nullptr, nullptr, nullptr, nullptr,
+ event);
Repo inRepo(inPDRRepo);
getRepoByType(inRepo, outRepo, PLDM_STATE_EFFECTER_PDR);
@@ -199,8 +202,9 @@
auto inPDRRepo = pldm_pdr_init();
auto event = sdeventplus::Event::get_default();
- Handler handler(&mockedUtils, "./pdr_jsons/state_effecter/good", inPDRRepo,
- nullptr, nullptr, nullptr, nullptr, event);
+ Handler handler(&mockedUtils, 0, nullptr, "./pdr_jsons/state_effecter/good",
+ inPDRRepo, nullptr, nullptr, nullptr, nullptr, nullptr,
+ event);
uint16_t entityType = 33;
uint16_t entityInstance = 0;
uint16_t containerId = 0;