sensors: change object_manager path
As per PDI, all sensor implementation shall put object manager at
`/xyz/openbmc_project/sensors`.
[1] https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Sensor/Value.interface.yaml#L20
Tested: on hardware, ipmitool sdr elist is working.
```
CPU | 36h | ok | 0.1 |
CPU_Kernel | 37h | ok | 0.1 |
CPU_User | 38h | ok | 0.1 |
Memory_Available | 39h | ok | 0.1 |
Storage_RW | 3Ah | ok | 0.1 |
```
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ia9b21eebf37cb22cfa4bc19f2369423ea4d5c035
diff --git a/healthMonitor.hpp b/healthMonitor.hpp
index bba3b52..c6e77dd 100644
--- a/healthMonitor.hpp
+++ b/healthMonitor.hpp
@@ -2,6 +2,7 @@
#include <phosphor-logging/lg2.hpp>
#include <sdbusplus/bus.hpp>
#include <sdbusplus/message.hpp>
+#include <sdbusplus/server/manager.hpp>
#include <sdeventplus/clock.hpp>
#include <sdeventplus/event.hpp>
#include <sdeventplus/utility/timer.hpp>
@@ -162,7 +163,8 @@
*
* @param[in] bus - Handle to system dbus
*/
- HealthMon(sdbusplus::bus_t& bus) : bus(bus)
+ HealthMon(sdbusplus::bus_t& bus) :
+ bus(bus), sensorsObjectManager(bus, "/xyz/openbmc_project/sensors")
{
// Read JSON file
sensorConfigs = getHealthConfig();
@@ -193,6 +195,7 @@
sdbusplus::bus_t& bus;
std::vector<HealthConfig> sensorConfigs;
std::vector<HealthConfig> getHealthConfig();
+ sdbusplus::server::manager_t sensorsObjectManager;
};
} // namespace health