common: use aserver property constructor
Since PDI gen code now [1] supports constructing DBus interfaces with
property values, simplify the common code to use that API.
Tested: Unit Tests Pass
References:
[1] https://gerrit.openbmc.org/c/openbmc/sdbusplus/+/78790
Change-Id: Ic29531b391f8609377105dbcbac2e8a55b29746c
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/common/src/device.cpp b/common/src/device.cpp
index b71b2cb..1e4b810 100644
--- a/common/src/device.cpp
+++ b/common/src/device.cpp
@@ -9,6 +9,7 @@
#include <sdbusplus/async/context.hpp>
#include <sdbusplus/bus.hpp>
#include <xyz/openbmc_project/Association/Definitions/server.hpp>
+#include <xyz/openbmc_project/Software/ActivationProgress/aserver.hpp>
#include <xyz/openbmc_project/State/Host/client.hpp>
#include <utility>
@@ -17,6 +18,13 @@
using namespace phosphor::software::device;
+using SoftwareActivationProgress =
+ sdbusplus::aserver::xyz::openbmc_project::software::ActivationProgress<
+ phosphor::software::Software>;
+
+using SoftwareActivationProgressProperties = sdbusplus::common::xyz::
+ openbmc_project::software::ActivationProgress::properties_t;
+
const auto applyTimeImmediate = sdbusplus::common::xyz::openbmc_project::
software::ApplyTime::RequestedApplyTimes::Immediate;
@@ -145,7 +153,7 @@
return false;
}
- softwarePending->softwareActivationProgress->setProgress(progress);
+ softwarePending->softwareActivationProgress->progress(progress);
return true;
}
@@ -162,7 +170,8 @@
std::string objPath = softwarePending->objectPath;
softwarePending->softwareActivationProgress =
- std::make_unique<SoftwareActivationProgress>(ctx, objPath.c_str());
+ std::make_unique<SoftwareActivationProgress>(
+ ctx, objPath.c_str(), SoftwareActivationProgressProperties{0});
softwarePending->setActivationBlocksTransition(true);