summaryrefslogtreecommitdiff
path: root/redfish-core/lib/network_protocol.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'redfish-core/lib/network_protocol.hpp')
-rw-r--r--redfish-core/lib/network_protocol.hpp56
1 files changed, 14 insertions, 42 deletions
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index d864e222d6..00b5d9e309 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -252,16 +252,11 @@ inline void handleNTPProtocolEnabled(
"xyz.openbmc_project.Time.Synchronization.Method.Manual";
}
- sdbusplus::asio::setProperty(
- *crow::connections::systemBus, "xyz.openbmc_project.Settings",
- "/xyz/openbmc_project/time/sync_method",
- "xyz.openbmc_project.Time.Synchronization", "TimeSyncMethod",
- timeSyncMethod, [asyncResp](const boost::system::error_code& ec) {
- if (ec)
- {
- messages::internalError(asyncResp->res);
- }
- });
+ setDbusProperty(asyncResp, "xyz.openbmc_project.Settings",
+ sdbusplus::message::object_path(
+ "/xyz/openbmc_project/time/sync_method"),
+ "xyz.openbmc_project.Time.Synchronization",
+ "TimeSyncMethod", "NTP/ProtocolEnabled", timeSyncMethod);
}
inline void
@@ -362,16 +357,9 @@ inline void
continue;
}
- sdbusplus::asio::setProperty(
- *crow::connections::systemBus, service, objectPath,
- interface, "StaticNTPServers", currentNtpServers,
- [asyncResp](const boost::system::error_code& ec2) {
- if (ec2)
- {
- messages::internalError(asyncResp->res);
- return;
- }
- });
+ setDbusProperty(asyncResp, service, objectPath, interface,
+ "StaticNTPServers", "NTP/NTPServers/",
+ currentNtpServers);
}
}
}
@@ -400,30 +388,14 @@ inline void
{
if (entry.first.starts_with(netBasePath))
{
- sdbusplus::asio::setProperty(
- *crow::connections::systemBus, entry.second.begin()->first,
- entry.first,
+ setDbusProperty(
+ asyncResp, entry.second.begin()->first, entry.first,
"xyz.openbmc_project.Control.Service.Attributes", "Running",
- protocolEnabled,
- [asyncResp](const boost::system::error_code& ec2) {
- if (ec2)
- {
- messages::internalError(asyncResp->res);
- return;
- }
- });
- sdbusplus::asio::setProperty(
- *crow::connections::systemBus, entry.second.begin()->first,
- entry.first,
+ "IPMI/ProtocolEnabled", protocolEnabled);
+ setDbusProperty(
+ asyncResp, entry.second.begin()->first, entry.first,
"xyz.openbmc_project.Control.Service.Attributes", "Enabled",
- protocolEnabled,
- [asyncResp](const boost::system::error_code& ec2) {
- if (ec2)
- {
- messages::internalError(asyncResp->res);
- return;
- }
- });
+ "IPMI/ProtocolEnabled", protocolEnabled);
}
}
});