diff options
Diffstat (limited to 'redfish-core/lib/power_supply.hpp')
-rw-r--r-- | redfish-core/lib/power_supply.hpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/redfish-core/lib/power_supply.hpp b/redfish-core/lib/power_supply.hpp index aa88e09988..4fc0ce9e48 100644 --- a/redfish-core/lib/power_supply.hpp +++ b/redfish-core/lib/power_supply.hpp @@ -310,6 +310,29 @@ inline void }); } +inline void getPowerSupplyFirmwareVersion( + const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, + const std::string& service, const std::string& path) +{ + sdbusplus::asio::getProperty<std::string>( + *crow::connections::systemBus, service, path, + "xyz.openbmc_project.Software.Version", "Version", + [asyncResp](const boost::system::error_code& ec, + const std::string& value) { + if (ec) + { + if (ec.value() != EBADR) + { + BMCWEB_LOG_ERROR << "DBUS response error for FirmwareVersion " + << ec.value(); + messages::internalError(asyncResp->res); + } + return; + } + asyncResp->res.jsonValue["FirmwareVersion"] = value; + }); +} + inline void doPowerSupplyGet(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, const std::string& chassisId, @@ -359,6 +382,8 @@ inline void powerSupplyPath); getPowerSupplyAsset(asyncResp, object.begin()->first, powerSupplyPath); + getPowerSupplyFirmwareVersion(asyncResp, object.begin()->first, + powerSupplyPath); }); }); } |