pldm: Implement PCIeSlot interface

Adding support to host dbus PCIeSlot interface.
Based on the PDRs received from remote PLDM terminus,
PLDM hosts the dbus interface based on the entity type.
The Slot interface is defined at [1].

Tested:
    Functional test passed.

[1]: https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Inventory/Item/PCIeSlot.interface.yaml

Change-Id: I98db6c31ddcb35e5c124d060c4ee0ab0f8819e72
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/host-bmc/dbus/custom_dbus.cpp b/host-bmc/dbus/custom_dbus.cpp
index 435d574..b1cae11 100644
--- a/host-bmc/dbus/custom_dbus.cpp
+++ b/host-bmc/dbus/custom_dbus.cpp
@@ -55,5 +55,25 @@
 
     return std::nullopt;
 }
+
+void CustomDBus::implementPCIeSlotInterface(const std::string& path)
+{
+    if (!pcieSlot.contains(path))
+    {
+        pcieSlot.emplace(path, std::make_unique<PCIeSlot>(
+                                   pldm::utils::DBusHandler::getBus(), path));
+    }
+}
+
+void CustomDBus::setSlotType(const std::string& path,
+                             const std::string& slotType)
+{
+    auto typeOfSlot =
+        pldm::dbus::PCIeSlot::convertSlotTypesFromString(slotType);
+    if (pcieSlot.contains(path))
+    {
+        pcieSlot.at(path)->slotType(typeOfSlot);
+    }
+}
 } // namespace dbus
 } // namespace pldm