commit | 24e9a9bb8562f50cc8e40585ffa6b1782f4ec9aa | [log] [tgz] |
---|---|---|
author | Archana Kakani <archana.kakani@ibm.com> | Tue Feb 04 00:27:25 2025 -0600 |
committer | ManojKiran Eda <manojkiran.eda@gmail.com> | Mon Feb 10 05:16:53 2025 +0000 |
tree | 609cba8f1dae914635997ff0bf9fb92b2b8a152c | |
parent | db65c3b47728d7356728befb1df5a8dd7d3f298d [diff] [blame] |
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/custom_dbus.cpp b/host-bmc/dbus/custom_dbus.cpp index b02ed36..16b822a 100644 --- a/host-bmc/dbus/custom_dbus.cpp +++ b/host-bmc/dbus/custom_dbus.cpp
@@ -127,6 +127,16 @@ } } +void CustomDBus::implementPowerSupplyInterface(const std::string& path) +{ + if (!powersupply.contains(path)) + { + powersupply.emplace( + path, std::make_unique<PowerSupply>( + pldm::utils::DBusHandler::getBus(), path.c_str())); + } +} + void CustomDBus::implementFanInterface(const std::string& path) { if (!fan.contains(path))