oem-ibm: Implement Host lamp test interface

IBM has a feature called LampTest and what it does is this:
  - BMC would set the state of LEDs to [ON] on all the BMC accessible
    LEDs.
  - For LEDs that are not accessible by BMC, a message is sent to the
    Host, so that the Host can exercise all the LEDs on the connected
    drawers and anything else that the BMC does not have access to.

This commit adds support to send message to Host when BMC has to tell
the Host to exercise LEDs accessible by host.

When Host sees the effector is set, it goes ahead and turns [ON] all
the LEDs for a specified time and automatically restores the states
at timer expiration. BMC does not have to tell the Host to stop the
test and it is part of Host's lamp test requirement.

TESTED: By setting the asserted property of the LED groups object

busctl set-property xyz.openbmc_project.LED.GroupManager
/xyz/openbmc_project/led/groups/lamp_test
xyz.openbmc_project.Led.Group Asserted b true

And verifying that the setEffecterStates call was made to the
remote state effecter to turn on all LEDs

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I990dce28d3017f20c73ff9029fced0e7ac84868f
diff --git a/pldmd/oem_ibm.hpp b/pldmd/oem_ibm.hpp
index 2fa7521..60e2a51 100644
--- a/pldmd/oem_ibm.hpp
+++ b/pldmd/oem_ibm.hpp
@@ -1,5 +1,6 @@
 #pragma once
 
+#include "../oem/ibm/host-bmc/host_lamp_test.hpp"
 #include "../oem/ibm/libpldmresponder/file_io.hpp"
 #include "../oem/ibm/libpldmresponder/fru_oem_ibm.hpp"
 #include "../oem/ibm/libpldmresponder/oem_ibm_handler.hpp"
@@ -80,6 +81,8 @@
         createOemIbmPlatformHandler();
         oemIbmPlatformHandler->setPlatformHandler(platformHandler);
 
+        createHostLampTestHandler();
+
         registerHandler();
     }
 
@@ -124,6 +127,14 @@
             oemFruHandler.get());
     }
 
+    void createHostLampTestHandler()
+    {
+        auto& bus = pldm::utils::DBusHandler::getBus();
+        hostLampTest = std::make_unique<pldm::led::HostLampTest>(
+            bus, "/xyz/openbmc_project/led/groups/host_lamp_test", mctp_eid,
+            instanceIdDb, repo, reqHandler);
+    }
+
     /** @brief Method for registering PLDM OEM handler */
     void registerHandler()
     {
@@ -176,6 +187,8 @@
 
     /** @brief oem IBM Fru handler*/
     pldm::responder::oem_ibm_fru::Handler* oemIbmFruHandler = nullptr;
+
+    std::unique_ptr<pldm::led::HostLampTest> hostLampTest;
 };
 
 } // namespace oem_ibm