host-bmc: Implement PowerSupply interface
Adding support to host Powersupply dbus interface.
Based on the PDRs received from remote PLDM terminus,
PLDM hosts the dbus interface based on the entity type.
The powersuppply 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/PowerSupply.interface.yaml
Change-Id: I2f8c57a2db7e6ffffe14b7dff646e73164f84f86
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/host-bmc/dbus/power_supply.hpp b/host-bmc/dbus/power_supply.hpp
new file mode 100644
index 0000000..40e26e3
--- /dev/null
+++ b/host-bmc/dbus/power_supply.hpp
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <sdbusplus/bus.hpp>
+#include <sdbusplus/server.hpp>
+#include <sdbusplus/server/object.hpp>
+#include <xyz/openbmc_project/Inventory/Item/PowerSupply/server.hpp>
+
+#include <string>
+
+namespace pldm
+{
+namespace dbus
+{
+using ItemPowerSupply = sdbusplus::server::object_t<
+ sdbusplus::xyz::openbmc_project::Inventory::Item::server::PowerSupply>;
+
+class PowerSupply : public ItemPowerSupply
+{
+ public:
+ PowerSupply() = delete;
+ ~PowerSupply() = default;
+ PowerSupply(const PowerSupply&) = delete;
+ PowerSupply& operator=(const PowerSupply&) = delete;
+ PowerSupply(PowerSupply&&) = delete;
+ PowerSupply& operator=(PowerSupply&&) = delete;
+
+ PowerSupply(sdbusplus::bus_t& bus, const std::string& objPath) :
+ ItemPowerSupply(bus, objPath.c_str())
+ {}
+};
+
+} // namespace dbus
+} // namespace pldm