summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2019-07-15 11:05:17 -0700
committerPatrick Venture <venture@google.com>2019-07-16 10:47:51 -0700
commit081b035fbcdf9c08f783a662c695f4412cdbec5a (patch)
tree14fbb1be36fb2b06223552e1a17a5296866240b9
parent5ec202704d9952674ff91e5741ac00581733f73e (diff)
downloadphosphor-pid-control-081b035fbcdf9c08f783a662c695f4412cdbec5a.tar.gz
phosphor-pid-control-081b035fbcdf9c08f783a662c695f4412cdbec5a.zip
bugfix: writePath is the dbus object path for the sensor
For the sensor, if writePath is used for dbus active, it is always FanPwm (presently) and needs to be the object path. Tested: Not tested, only code inspected. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I4eafaff4316aac9dab9a2c9e1bd61093a670b023
-rw-r--r--configure.md9
-rw-r--r--util.cpp3
2 files changed, 4 insertions, 8 deletions
diff --git a/configure.md b/configure.md
index a027282..f33ec92 100644
--- a/configure.md
+++ b/configure.md
@@ -75,13 +75,10 @@ written sysfs path. There are two support paths:
* `/sys/devices/platform/ahb/1e786000.pwm-tacho-controller/hwmon/<asterisk
asterisk>/pwm1`
-If the `writePath` value contains: `/xyz/openbmc_project/control/fanpwm/` it
+If the `writePath` value contains: `/xyz/openbmc_project/sensors/fan_tach/fan{N}` it
sets of a sensor object that writes over dbus to the
-`xyz.openbmc_project.Control.FanPwm` interface. The `writePath` should end with
-the sensor's dbus name.
-
-**BUG NOTE** It's currently using the writePath specified for fanpwm as the
-sensor path, when in fact, the interface is attached to:
+`xyz.openbmc_project.Control.FanPwm` interface. The `writePath` should be the
+full object path.
```
busctl introspect xyz.openbmc_project.Hwmon-1644477290.Hwmon1 /xyz/openbmc_project/sensors/fan_tach/fan1 --no-pager
diff --git a/util.cpp b/util.cpp
index f66f20b..ec60d7a 100644
--- a/util.cpp
+++ b/util.cpp
@@ -21,7 +21,6 @@
static constexpr auto external_sensor =
"/xyz/openbmc_project/extsensors/"; // type/
static constexpr auto openbmc_sensor = "/xyz/openbmc_project/"; // type/
-static constexpr auto dbus_pwm = "/xyz/openbmc_project/control/fanpwm/";
static constexpr auto sysfs = "/sys/";
IOInterfaceType getWriteInterfaceType(const std::string& path)
@@ -37,7 +36,7 @@ IOInterfaceType getWriteInterfaceType(const std::string& path)
return IOInterfaceType::SYSFS;
}
- if (path.find(dbus_pwm) != std::string::npos)
+ if (path.find(openbmc_sensor) != std::string::npos)
{
return IOInterfaceType::DBUSACTIVE;
}
OpenPOWER on IntegriCloud