Skip to content

Commit

Permalink
Refresh sensor functional state
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
msbarth committed Apr 27, 2018
1 parent 27c4a39 commit bfcaf3d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mainloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bfcaf3d

Please sign in to comment.