Add object manager
Added object manager to sensor node so that it can be queried mapper
and GetManagedObjects method can be called.
Tested: verified this using busctl command and see object manager
interface has been added to this service.
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
Change-Id: I53e361ea81cabbba78aca2cec4939601d615d232
diff --git a/healthMonitor.cpp b/healthMonitor.cpp
index 4981cd6..361fe74 100644
--- a/healthMonitor.cpp
+++ b/healthMonitor.cpp
@@ -3,6 +3,7 @@
#include "healthMonitor.hpp"
#include <phosphor-logging/log.hpp>
+#include <sdbusplus/server/manager.hpp>
#include <sdeventplus/event.hpp>
#include <fstream>
@@ -392,6 +393,9 @@
// Request service bus name
bus.request_name(HEALTH_BUS_NAME);
+ // Add object manager to sensor node
+ sdbusplus::server::manager::manager objManager(bus, SENSOR_OBJPATH);
+
// Attach the bus to sd_event to service user requests
bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL);
event.loop();
diff --git a/meson.build b/meson.build
index cec97e7..cfcbe67 100644
--- a/meson.build
+++ b/meson.build
@@ -28,6 +28,7 @@
conf_data.set('HEALTH_CONFIG_FILE', '"/etc/healthMon/bmc_health_config.json"')
conf_data.set('HEALTH_BUS_NAME', '"xyz.openbmc_project.HealthMon"')
conf_data.set('HEALTH_SENSOR_PATH', '"/xyz/openbmc_project/sensors/utilization/"')
+conf_data.set('SENSOR_OBJPATH', '"/xyz/openbmc_project/sensors"')
configure_file(output : 'config.h',
configuration : conf_data)