diff options
| author | Kun Yi <kunyi731@gmail.com> | 2019-07-10 22:26:26 -0700 |
|---|---|---|
| committer | Kun Yi <kunyi731@gmail.com> | 2019-07-11 16:55:51 +0000 |
| commit | fc2e803f5d9256944e18c7c878a441606b1f121c (patch) | |
| tree | 2d2c5ec2b2f02bbf13d3ffadfc9fde00cbbd0c46 | |
| parent | 6aae76f435209f6324c18f0ba3376ade7f35b848 (diff) | |
| download | phosphor-pid-control-fc2e803f5d9256944e18c7c878a441606b1f121c.tar.gz phosphor-pid-control-fc2e803f5d9256944e18c7c878a441606b1f121c.zip | |
sensors: ignore min/max in json for D-Bus passive sensor read
min/max values were meant to scale write to be PWM, but were
overloaded in commit 75eb769d351434547899186f73ff70ae00d7934a
to scale sensor read to percent as well. However currently the D-Bus sensors
built from JSON can only specify one pair of min/max values,so they
cannot be used for both read/write interfaces.
Fix the behavior by ignoring min/max in settings when building D-Bus passive
read interface and only read them from D-Bus.
Tested:
D-Bus passive sensor value is no longer scaled if there is no
MinValue/MaxValue specified.
Resolves: openbmc/phosphor-pid-control#14
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: I206bbe75c77e79f765eca76cfa015321dcba4aa7
| -rw-r--r-- | conf.hpp | 2 | ||||
| -rw-r--r-- | dbus/dbusconfiguration.cpp | 5 | ||||
| -rw-r--r-- | dbus/dbuspassive.cpp | 9 |
3 files changed, 0 insertions, 16 deletions
@@ -10,8 +10,6 @@ namespace conf { -constexpr int64_t inheritValueFromDbus = std::numeric_limits<int64_t>::lowest(); - /* * General sensor structure used for configuration. */ diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp index c33264c..7641eaf 100644 --- a/dbus/dbusconfiguration.cpp +++ b/dbus/dbusconfiguration.cpp @@ -527,11 +527,6 @@ bool init(sdbusplus::bus::bus& bus, boost::asio::steady_timer& timer) { config.timeout = 0; } - else if (config.type == "fan") - { - config.max = conf::inheritValueFromDbus; - config.min = conf::inheritValueFromDbus; - } } else if (sensorPathIfacePair.second == pwmInterface) { diff --git a/dbus/dbuspassive.cpp b/dbus/dbuspassive.cpp index 5614335..c199563 100644 --- a/dbus/dbuspassive.cpp +++ b/dbus/dbuspassive.cpp @@ -60,15 +60,6 @@ std::unique_ptr<ReadInterface> DbusPassive::createDbusPassive( { return nullptr; } - if (info->max != conf::inheritValueFromDbus) - { - settings.max = info->max; - } - - if (info->min != conf::inheritValueFromDbus) - { - settings.min = info->min; - } return std::make_unique<DbusPassive>(bus, type, id, helper, settings, failed, path, redundancy); |

