diff options
| author | Matthew Barth <msbarth@us.ibm.com> | 2018-04-25 15:05:58 -0500 |
|---|---|---|
| committer | Matthew Barth <msbarth@us.ibm.com> | 2018-04-27 15:09:34 -0500 |
| commit | bfcaf3d8c9de49453d85a2cbaf65e4fe276512d8 (patch) | |
| tree | 17b15395f226d2580b7764cd03484b49996daf2d /mainloop.cpp | |
| parent | 27c4a3943f05d762202432ac064f392253681265 (diff) | |
| download | phosphor-hwmon-bfcaf3d8c9de49453d85a2cbaf65e4fe276512d8.tar.gz phosphor-hwmon-bfcaf3d8c9de49453d85a2cbaf65e4fe276512d8.zip | |
Refresh sensor functional state
During the monitoring loop, the associated fault file of a sensor is
read and its functional status is updated prior to reading the sensor's
input file.
Tested:
The functional property is updated according to its fault file
Resolves: openbmc/openbmc#2329
Change-Id: Icc28e914df79c6681d45e92a5ea4054704ad8efd
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'mainloop.cpp')
| -rw-r--r-- | mainloop.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mainloop.cpp b/mainloop.cpp index 9944e09..11b182e 100644 --- a/mainloop.cpp +++ b/mainloop.cpp @@ -532,9 +532,15 @@ void MainLoop::read() auto it = obj.find(InterfaceType::STATUS); if (it != obj.end()) { + auto fault = ioAccess.read( + i.first.first, + i.first.second, + hwmon::entry::fault, + hwmonio::retries, + hwmonio::delay); auto statusIface = std::experimental::any_cast< std::shared_ptr<StatusObject>>(it->second); - if (!statusIface->functional()) + if (!statusIface->functional((fault == 0) ? true : false)) { continue; } |

