monitor: Support target_path option in configuration file
The target path containing the interface
xyz.openbmc_project.control.FanPwm or
xyz.openbmc_project.control.FanSpeed can be different between
phosphor-hwmon and dbus-sensor.
In phosphor-hwmon, it is "/xyz/openbmc_project/sensors/fan_tach/".
In dbus-sensor, it is "/xyz/openbmc_project/control/fanpwm/".
This commit supports making this path configurable via "target_path"
as a full object path.
By default, it is the same as the fan tach object path.
Signed-off-by: Chau Ly <chaul@amperecomputing.com>
Change-Id: I2658a462dd49a98ad77d684f2927e6ccae21cd15
diff --git a/monitor/fan.cpp b/monitor/fan.cpp
index 910d975..94bfcf8 100644
--- a/monitor/fan.cpp
+++ b/monitor/fan.cpp
@@ -69,10 +69,10 @@
_sensors.emplace_back(std::make_shared<TachSensor>(
mode, bus, *this, std::get<sensorNameField>(s),
std::get<hasTargetField>(s), std::get<funcDelay>(def),
- std::get<targetInterfaceField>(s), std::get<factorField>(s),
- std::get<offsetField>(s), std::get<methodField>(def),
- std::get<thresholdField>(s), std::get<ignoreAboveMaxField>(s),
- std::get<timeoutField>(def),
+ std::get<targetInterfaceField>(s), std::get<targetPathField>(s),
+ std::get<factorField>(s), std::get<offsetField>(s),
+ std::get<methodField>(def), std::get<thresholdField>(s),
+ std::get<ignoreAboveMaxField>(s), std::get<timeoutField>(def),
std::get<nonfuncRotorErrDelayField>(def),
std::get<countIntervalField>(def), event));