diff options
| author | Patrick Venture <venture@google.com> | 2019-03-26 07:10:59 -0700 |
|---|---|---|
| committer | Patrick Venture <venture@google.com> | 2019-03-26 07:13:12 -0700 |
| commit | e3eeef45a722b57d4c3bb379df165e0bd14993bd (patch) | |
| tree | 5fa2191d8d7ecb7d26aaca3f524be41ffa667b0c /pid | |
| parent | 90e9dbcae6c1df3127dd3de41f9d1e1b5a438828 (diff) | |
| download | phosphor-pid-control-e3eeef45a722b57d4c3bb379df165e0bd14993bd.tar.gz phosphor-pid-control-e3eeef45a722b57d4c3bb379df165e0bd14993bd.zip | |
bugfix: grab hystersis parameter from pid json
The code incorrectly attempts to read the hystersis parameters from the
wrong scope of the json object. This fixes it to read from the pid
configuration's scope.
Tested: Added a new unit-test to hit this case.
Change-Id: I808bc907ec33a0b12d68a88fd316c3c9fae41516
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'pid')
| -rw-r--r-- | pid/buildjson.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pid/buildjson.cpp b/pid/buildjson.cpp index d31b6bc..ad51d9b 100644 --- a/pid/buildjson.cpp +++ b/pid/buildjson.cpp @@ -56,7 +56,7 @@ void from_json(const json& j, conf::ControllerInfo& c) } else { - j.at("positiveHysteresis").get_to(c.pidInfo.positiveHysteresis); + p.at("positiveHysteresis").get_to(c.pidInfo.positiveHysteresis); } auto negativeHysteresis = p.find("negativeHysteresis"); @@ -66,7 +66,7 @@ void from_json(const json& j, conf::ControllerInfo& c) } else { - j.at("negativeHysteresis").get_to(c.pidInfo.negativeHysteresis); + p.at("negativeHysteresis").get_to(c.pidInfo.negativeHysteresis); } } } // namespace conf |

