mapper: use async client for GetSubTreePaths
Use the generated client bindings instead of hard-coding strings for
function names and parameters.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ica2c6f29961a81a484548a8f74634067c53cec3d
diff --git a/health_monitor.cpp b/health_monitor.cpp
index 0c732b0..36d027e 100644
--- a/health_monitor.cpp
+++ b/health_monitor.cpp
@@ -2,6 +2,8 @@
#include <phosphor-logging/lg2.hpp>
#include <sdbusplus/async.hpp>
+#include <xyz/openbmc_project/Inventory/Item/Bmc/common.hpp>
+#include <xyz/openbmc_project/Inventory/Item/common.hpp>
PHOSPHOR_LOG2_USING;
@@ -14,8 +16,12 @@
{
info("Creating Health Monitor with config size {SIZE}", "SIZE",
configs.size());
- constexpr auto BMCInventoryItem = "xyz.openbmc_project.Inventory.Item.Bmc";
- auto bmcPaths = findPaths(ctx.get_bus(), BMCInventoryItem);
+
+ static constexpr auto bmcIntf = sdbusplus::common::xyz::openbmc_project::
+ inventory::item::Bmc::interface;
+ static constexpr auto invPath = sdbusplus::common::xyz::openbmc_project::
+ inventory::Item::namespace_path;
+ auto bmcPaths = co_await findPaths(ctx, bmcIntf, invPath);
for (auto& [type, collectionConfig] : configs)
{