summaryrefslogtreecommitdiff
path: root/redfish-core
diff options
context:
space:
mode:
authorPotin Lai <potin.lai@quantatw.com>2023-11-09 07:18:20 +0300
committerEd Tanous <ed@tanous.net>2023-11-20 19:48:50 +0300
commit7a696974d7a987e3eb135a6cbad0a4ace8d109d2 (patch)
tree6b9160bdcecfcbe2561e4eabed660196a4c2be40 /redfish-core
parent3e7a8da60d70f4c42ae8ce0a3ecb0709194eb831 (diff)
downloadbmcweb-7a696974d7a987e3eb135a6cbad0a4ace8d109d2.tar.xz
managers: use async_method_call() set PID properties
In sdbusplus::asio::setProperty(), the property value will be wrapped by std:variant automaticly, it will fail and show `Invalid argument [generic:22]` error if we pass the property value that has been wrapped by std::variant into sdbusplus::asio::setProperty(). Because the type of property.second is DbusVariantType, we cannot use sdbusplus::asio::setProperty() for property setting, so change it back to use async_method_call(). Tested on Bletchley: Success PATCH the properties of StepwiseControllers. ``` { "Oem": { "OpenBmc": { "Fan": { "StepwiseControllers": { "Test1": { "NegativeHysteresis": 7.0, "PositiveHysteresis": 8.0 } } } } } } ``` Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I92d9e0d6ffe97fa6ce2905e17497d4d0fffa1d58
Diffstat (limited to 'redfish-core')
-rw-r--r--redfish-core/lib/managers.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index 314099b5e9..38add8be5b 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -1591,10 +1591,7 @@ struct SetPIDValues : std::enable_shared_from_this<SetPIDValues>
{
for (const auto& property : output)
{
- sdbusplus::asio::setProperty(
- *crow::connections::systemBus,
- "xyz.openbmc_project.EntityManager", path, iface,
- property.first, property.second,
+ crow::connections::systemBus->async_method_call(
[response,
propertyName{std::string(property.first)}](
const boost::system::error_code& ec) {
@@ -1606,7 +1603,10 @@ struct SetPIDValues : std::enable_shared_from_this<SetPIDValues>
return;
}
messages::success(response->res);
- });
+ },
+ "xyz.openbmc_project.EntityManager", path,
+ "org.freedesktop.DBus.Properties", "Set", iface,
+ property.first, property.second);
}
}
else